I have done 3 trials of varying types of XPS documents, and so far none of the resulting PDF documents are correct.
First, here is how I am doing the conversion (C#):
Code: Select all
acPDFCreatorLib.Initialize();
Stream xps = File.OpenRead("test.xps");
IacDocument doc = new IacDocument();
doc.Open(xps, "");
Stream pdf = File.Create("PdfDocument.pdf");
doc.Save(pdf, IacFileSaveOption.acFileSaveView);
acPDFCreatorLib.Terminate();
Trial 1
Input XPS document: A 2-page document generated by my application, which consists entirely of tables and text, save for an image in the header.
Output PDF document: A 2-page document; however, each page is blank -- except for a small, solid black rectangle in the upper left corner of each page, and except that the image in the header appears on both pages in the right spot.
Trial 2
Input XPS document: A 1-page simple document I created for text purposes. The only content is the text "Hello World!" with no font specified (so as to use the default).
Output PDF document: A 1-page blank document.
Trial 3
Input XPS document: A 5-page printout of C# code, printed from Visual Studio 2008 through the Microsoft XPS Document Writer. Due to my personal color settings in Visual Studio, there is a dark green background where any text appears.
Output PDF document: A 5-page document containing no text. However, interestingly, the dark green color behind all of the text *is* present, and the color *is* arranged just as in the input document.
I should also note that I have tried using the text search feature to see if the expected text was in fact present in the PDF file, just not visible, and I was not able to find any of my expected text in either document (only the watermarked Amyuni copyright notice text that is stamped by the developer trial version was present).
Perhaps I am improperly using the library. I would much appreciate any advice from the Amyuni staff or other users.
Thanks and best regards,
Brian