Aspose.pdf pdf to xps conversion does not work correctly


#1

Earlier I posted about faulty aspose.pdf SaveToXPS behaviour, and you logged it as PDFNET-46334
Aspose.Pdf Save to xps - first page is entirely black

This behaviour is in aspose.pdf 19.4

While we wait for you to fix this, we made a change to our code so that instead of Save to XPS, we now Print to an XPS printer driver and capture the XPS file produced. Our workaround means we can print the pdf attached to that original post and its appearance is correct.

However, in an earlier post you logged PDFNET-42710 because there was faulty behaviour of aspose.pdf save as xps.
Regression in Save pdf as XPS behaviour

I have attached the original PDF document, which is in colour,
14 Ausden Clark - Luggage Allowance Policy.pdf (223.5 KB)

I’ve also attached a further two PDF files, each created by printing the XPS produced by aspose.pdf.
14 Ausden Clark - Luggage Allowance Policy.pdf [V2.3.1.13210].pdf (335.7 KB)
14 Ausden Clark - Luggage Allowance Policy.pdf [V2.3.1.13252].pdf (84.2 KB)

The first PDF was produced by printing the XPS created via aspose.pdf Save as XPS. The problem with the this PDF is that a pale gray watermark which is supposed to be in the page background is rendered as solid black, obscuring important page content.

The second PDF was produced by printing the xps created when aspose.pdf prints to an XPS printer driver. The problem with this second PDF is that most of the page content is missing, and there is only some sort of incomplete background shading.

So neither PDF is correct. There are quality issues in both the Save as XPS and Print to behaviours, so I would expect you to log two issues from this post. We have no means at all of producing correct xps from the original PDF. Please would you address at least one of these issues with urgency.


#2

@Brian_THOMAS

Thank you for contacting support.

Would you please share two SSCCE code snippets which reproduce ...[V2.3.1.13210].pdf and
...[V2.3.1.13252].pdf files while loading 14 Ausden Clark - Luggage Allowance Policy.pdf as source file. Please also specify if these files reproduce identical issues reported earlier as PDFNET-46334 or PDFNET-42710 or we need to log two entirely different issues.


#3

I’ve attached a zipped Visual Studio 2017 solution. This builds a console app which accepts two arguments - an input pdf file and an output xps file.

The Program.cs file contains implementations of two functions, one which produces xps using the aspose Save as xps method, and the other which produces xps by Printing to the Microsoft XPS Document Writer. Currently you have to modify Main to call one method or the other, and then do a rebuild. But the produced xps files demonstrate the issues reported previously.

Using the Save as xps method, the produced xps contains what should be a pale gray watermark rendered in solid black

Using the Print to XPS driver method, the produced xps contains the page background and no text or images at all.

case4334.zip (179.5 KB)

Neither of these issues has been logged before.
PDFNET-46334 remains an open issue where the first page prints solid black.
PDFNET-42710 is now closed - but it was an issue where the produced xps caused the isXPS tool to report errors. I only mentioned it because the pdf file that I attached when I logged PDFNET-42710 is the same as the one which reproduces these two new issues.


#4

@Brian_THOMAS

Thank you for elaborating further.

We have been able to notice the problem while converting PDF to XPS where both approaches does not produce expected results. Therefore, a ticket with ID PDFNET-46373 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.


#5

I just downloaded Aspose.PDF 19.9.0 and repeated the tests contained in the C# project zipped in case4334.zip

Aftert opening the “14 Ausden Clark - Luggage Allowance Policy.pdf” in an Aspose.Pdf.Document object…

  1. Calling the Save method produces XPS where the pale gray watermark in the source PDF has been rendered solid black. So this defect is still open
  2. Calling the PdfViewer.PrintDocumentWithSettings method, targeting the Microsoft XPS Document Writer produces XPS where the gray background of the source PDF has been rendered in the foreground, obscuring everything else on the page. So this defect is still open.

These defects have been open since May 2019 - more than 5 months. Please can you reassure me that you are working on this? I’d really like them fixed. These are serious issues - this PDF cannot be correctly converted to XPS at all via Aspose.PDF


#6

@Brian_THOMAS

Thank you for your kind feedback.

The ticket PDFNET-46373 has not been scheduled yet owing to previously logged and critical tickets. It has been logged under free support model thus may take few more months to resolve. We have recorded your comments and will inform you as soon as the ticket will be resolved. We appreciate your patience and comprehension in this regard.


#7

I’m puzzled because I’ve reported two different issues here. One relates to saving to XPS from a PDF object. The other relates to printing from a PDF object.

But only one ticket, PDFNET-46373 has been logged. Surely two tickets are required?

I’m not happy with the projection that it will take a few more months for these to be fixed. We’ve already been waiting five months…


#8

@Brian_THOMAS

Since you were unable to render PDF to XPS by any means, the ticket was logged to fix problems with PDF to XPS conversion, we will internally investigate it further and then will decide creating sub-tasks for taking care of all of your concerns.

About the resolution, we understand the importance of the problem and will try to schedule it soon. We are really thankful to you for the patience.


#9

Thank you for acknowledging the seriousness of this issue. I look forward to the new release containing the fix!


#10

@Brian_THOMAS

We will let you know once this ticket will be resolved. We appreciate your patience and comprehension in this regard.