We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Regression in Save pdf as XPS behaviour

I created a very simple sample C# program, which opens the supplied pdf file:

static void Main(string[] args)
{
    Aspose.Pdf.Document pdf = new Aspose.Pdf.Document("14 Ausden Clark - Luggage Allowance Policy.pdf");
    pdf.Save("output.xps", Aspose.Pdf.SaveFormat.Xps);
}

When I use aspose.pdf up to and including 11.9.0 the generated xps file is OK and can be opened with the xpsrchvw program built in to Windows.

But from 16.10.1 onward, the generated XPS cannot be opened by xpsrchvw, and causes the IsXPS program to raise errors because the XPS is malformed:

+Start Test: /Documents/1/Pages/1.fpage Markup
    Info: Performing XSD validation of Part /Documents/1/Pages/1.fpage using content type "application/vnd.ms-package.xps-fixedpage+xml"
    Fail: Markup is not conformant:  Number of errors: 3
    Info: Error #1: At position (304,9) Message: The element 'Canvas' in namespace 'http://schemas.microsoft.com/xps/2005/06' has invalid child element 'Canvas.OpacityMask' in namespace 'http://schemas.microsoft.com/xps/2005/06'. List of possible elements expected: 'Path, Glyphs, Canvas' in namespace 'http://schemas.microsoft.com/xps/2005/06'.
    Info: Error #2: At position (366,7) Message: The element 'Canvas' in namespace 'http://schemas.microsoft.com/xps/2005/06' has invalid child element 'Canvas.OpacityMask' in namespace 'http://schemas.microsoft.com/xps/2005/06'. List of possible elements expected: 'Path, Glyphs, Canvas' in namespace 'http://schemas.microsoft.com/xps/2005/06'.
    Info: Error #3: At position (588,7) Message: The element 'Canvas' in namespace 'http://schemas.microsoft.com/xps/2005/06' has invalid child element 'Canvas.OpacityMask' in namespace 'http://schemas.microsoft.com/xps/2005/06'. List of possible elements expected: 'Path, Glyphs, Canvas' in namespace 'http://schemas.microsoft.com/xps/2005/06'.
-End Test: /Documents/1/Pages/1.fpage Markup Result: Fail

It’s illegal for a Canvas to have a Canvas.OpacityMask as a child.

Hi Brian,


Thanks for contacting support.

I have tested the scenario with latest version of the API, which is Aspose.Pdf for .NET 17.4.0, and observed the same issue which you have reported. Therefore, I have logged this issue as PDFNET-42710 in our issue tracking system. We will further look into the details and keep you updated with the status. Please be patient and spare us little time.

We are sorry for the inconvenience.


Best Regards,

Hi


Please can I have an update on your progress with this issue?

Thanks

Hi Brian,


Thanks for your inquiry.

I am afraid that earlier logged issue is not resolved yet as development team has been busy in resolving other high priority issue in the queue, which were logged prior to this. However product team has investigated your issue and planned to provide a fix against this in Aspose.Pdf for .NET 17.7, which is expected to be released in July 2017. We greatly appreciate your patience and cooperation in this regard. Please spare us little time.

We are sorry for the inconvenience.


Best Regards,

Hi

Has Aspose.pdf for .NET 17.7 been released yet? If so how do I get hold of it?

Thanks

@Brian_THOMAS

Thanks for your inquiry.

You may please download Aspose.Pdf for .NET 17.7 from downloads section of our website. In case of any further assistance, please feel free to contact us.

I just searched in the release notes and PDFNET-42710 isn’t fixed in v17.7

When do you think this will be fixed? We really do need it.

Why has the promised fix not been included in V17.7? We have waited 4 months for this as it is.

What can be done on this? We have customers waiting on it

Thanks

@Brian_THOMAS,
We have converted your source PDF to XPS format with the latest version 17.7 of Aspose.Pdf for .NET API. We can open the output XPS file in the XPS viewer. This is the output XPS file: outputXPS.zip (574.0 KB)

Best Regards,
Imran Rafique

I confirm that with Aspose.Pdf 17.7 I can generate an XPS file that will open without complaint using either xpsrchvw or glcnd.

Should I be concerned that the generated XPS file still generates failure messages when processed with the Microsoft IsXPS tool?

+Start Test: Validating that package conforms to OPC specification 
  +Start Test: Validating package part names
  -End Test: Validating package part names Result: Pass
  +Start Test: Checking Content Types
    Fail: The following parts do not have an associated Content Type. [OPC M2.4]
    Info: Documents/1/FixedDocuMent.fdoc
    Info: Documents/1/Pages/1.fpage
    Info: FixedDocumentSequence.fdseq
    Info: Resources/1cfecc8f-0000-0000-0000-000000000000.odttf
    Info: Resources/452e6c5e-0000-0000-0000-000000000000.odttf
    Info: Resources/576c1967-0000-0000-0000-000000000000.odttf
    Info: Resources/9846c82f-0000-0000-0000-000000000000.odttf
    Info: Resources/a346a809-0000-0000-0000-000000000000.odttf
    Info: Resources/fdb780a6-0000-0000-0000-000000000000.odttf
  -End Test: Checking Content Types Result: Fail

@Brian_THOMAS

Thanks for writing back.

I have run a test over generated XPS document with IsXps.exe utility and observed that it did not pass the test completely. Hence, I have logged an issue as PDFNET-43174 in our issue tracking system. We will further investigate the reasons behind this issue and keep you updated with the status of its correction. Please be patient and spare us little time.

We are sorry for this inconvenience.