xps

php and xps files

こ雲淡風輕ζ 提交于 2019-12-24 09:57:30
问题 i only want to import the content as text but im getting the binary values, tried something like but its doesnt work: $data = file_get_contents("input.xps"); theres any lib that i can use? thank you 回答1: You need a tool that can convert .xps files. There is a GhostScript variant called gxps which does exactly that. http://ghostscript.com/GhostXPS.html Conversion to text would be a two step process with it, but still simple: exec("gxps -sDEVICE=pdfwrite -sOutputFile=input.pdf -dNOPAUSE input

Serialization of derived FixedDocument

会有一股神秘感。 提交于 2019-12-24 04:14:07
问题 Since you can only add pages to a FixedDocument, I wrote a derived class: public class CustomFixedDocument : FixedDocument { public void RemoveChild(object child) { base.RemoveLogicalChild(child); } } to replace FixedDocument, which works fine, until I try to print the document and receive the following error: An unhandled exception of type 'System.Windows.Xps.XpsSerializationException' occurred in ReachFramework.dll Additional information: Serialization of this type of object is not

How to default the file name when printing to XPS file in .NET

别来无恙 提交于 2019-12-24 04:06:37
问题 When the Microsoft XPS Document Writer is selected for printing from my .NET application, the user is presented with a file dialog where the file name is initially "*.XPS". I'd like it to default to a more useful name instead (ideally, using the document name I am providing). I read the following question: Way to default the name of the generated XPS file? ...and tried setting the PrinterSettings.PrintFileName as suggested in the answers, but it does not seem to work... PrintDialog printDlg =

How to default the file name when printing to XPS file in .NET

拥有回忆 提交于 2019-12-24 04:06:07
问题 When the Microsoft XPS Document Writer is selected for printing from my .NET application, the user is presented with a file dialog where the file name is initially "*.XPS". I'd like it to default to a more useful name instead (ideally, using the document name I am providing). I read the following question: Way to default the name of the generated XPS file? ...and tried setting the PrinterSettings.PrintFileName as suggested in the answers, but it does not seem to work... PrintDialog printDlg =

How to validate an XPS document?

旧时模样 提交于 2019-12-24 01:36:10
问题 Is there any C# API to validate a generated XPS document? (i.e. to make sure the file is a valid xps file) 回答1: Don't know about an API, but there is a Microsoft tool that tests a file's conformity to the XML Paper Specification: http://msdn.microsoft.com/en-us/library/aa348104.aspx Cheers! 回答2: Xps just an XML format. You could try: Rename the XPS file to *.zip, and unzip it. You will see all the xml. There are quite a few files and directories. Download the XML Paper Specification for xps

display PDF file into WinForms

浪子不回头ぞ 提交于 2019-12-22 09:49:19
问题 I am working on a C# .Net Windows application. Here I create report using Infragistics.Documents.Report and export to .pdf & .xps format. Here I want to bringthose 2 files(.pdf & .xps) into WinForms and display. How to bring saved .pdf & .xps file into win forms. 回答1: Put a web browser control in your form and navigate it to the PDF / XPS file. Providing a PDF Reader is installed on your system it should work great. 回答2: You can also use: Process.Start("Foo.pdf"); This is equivalent to the

What is XPS files and how it is being used

独自空忆成欢 提交于 2019-12-22 05:30:12
问题 I have a simple C# .net web application. In that I'm working with XPS files. I have used the following code private void button1_Click(object sender, EventArgs e) { try { string xpsFile = "D:\\Completed-Form.xps"; xpsToBmp(xpsFile); MessageBox.Show("Done"); } catch (Exception ex) { MessageBox.Show (ex.Message); } } static public void xpsToBmp(string xpsFile) { XpsDocument xps = new XpsDocument(xpsFile, System.IO.FileAccess.Read); FixedDocumentSequence sequence = xps.GetFixedDocumentSequence()

Print PDF to XPS using Powershell

送分小仙女□ 提交于 2019-12-21 23:13:04
问题 I would like to convert a folder containing PDF files into XPS files using Powershell. Due to system restrictions, I am unable to download any third party software like iTextSharp to make this work. I have been able to get Powershell to open the document and open the print window for XPS, but the name is always blank. Is it possible to have the new file name match the original file name? Also, how can the process be automated so user input is not required (ie entering the file name or

remove page from fixed document?

霸气de小男生 提交于 2019-12-21 16:47:23
问题 How can I remove a page from a fixedDocument? I add pages like this: // Add page to pageContent PageContent pageContent = new PageContent(); ((IAddChild)pageContent).AddChild(fixedPage); // Add pageContent to wholeDoc fixedDocument.Pages.Add(pageContent); //Add to documentVeiwer documentViewer1.Document = fixedDocument; But there is no 'fixedDocument.Pages.Remove(page)' method! What can I do? 回答1: Could you try "cloning" the document into a new document and copy / move all pages over to the

Way to default the name of the generated XPS file?

戏子无情 提交于 2019-12-21 07:56:20
问题 If a user prints a report, and they happen to be using the Microsoft XPS printer , i would like the default the filename to something meaningful. i would have thought that the XPS printer would take the name of the print job, and use that as the default filename - but it doesn't. Is there some other, programatic, way to default the name of the generated XPS file when i print to that printer? i was thinking there might be something like: a registry key global shared memory API call like