Aspose.pdf pdf to xps conversion does not work correctly

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.

@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.

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.

@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.

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

@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.

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…

@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.

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

@Brian_THOMAS

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

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

After 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. 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

@Brian_THOMAS

We would like to assure that your issue will definitely be resolved. Please note that we resolve every issue - however, resolution of the issue may depend upon the support model under which it was logged and your issue was logged under free support model where issues have low priority. We will surely take care of your concerns and resolve the issue on first come first serve basis.

We have recorded your latest concerns and consider them during investigation process. We will let you know as soon as some updates are available regarding resolution. Please spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-46373) have been fixed in Aspose.PDF for .NET 20.2.

I tried to confirm the claimed fix. But my test program threw this Exception:

Message=The subscription included in this license allows free upgrades until 08 Jan 2020, but this version of the product was released on 14 Feb 2020. Please renew the subscription or use a previous version of the product.

I can verify the fix if I don’t try to apply our licence, which means the XPS file created contains the Evaluation message.

But I originally reported this issue on 8 May 2019, eight months before our current licence expired. Please tell me we don’t have to purchase a renewal before we can use this fix.

The issue was resolved in 20.2 version of the API and you need to upgrade your license in order to use the fix. You may surely try using free temporary license in order to verify the fix.

Brian_THOMAS:

But I originally reported this issue on 8 May 2019, eight months before our current licence expired.

Please note that the issue was resolved on a first come first serve basis due to being logged under normal support which caused this delay regretfully. Furthermore, it is always recommended to use latest version because it contains maximum fixes and new improvements in terms of features and performance. In case you have further inquiry, please feel free to let us know.