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

Free Support Forum - groupdocs.com

XPS to PDF: "Not supported file type" or "Stream is corrupt and cannot be parsed!" when rendered using GroupDocs.Conversion 21.10

Dear Team,

We are using GroupDocs.Conversion for 21.10 for converting different formats to pdf in java. We observed that while converting XPS to PDF
we see “Not supported file type” OR “Supplied XPS file or stream is corrupt and cannot be parsed!” while converting from below 2 ways:

Case1: “Not supported file type” when using below code snippet

final Converter converter = new Converter(new ByteArrayInputStream(sourceBytes));
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
final PdfConvertOptions options = new PdfConvertOptions();
converter.convert(outputStream, options);
return outputStream.toByteArray();

Case2: “Supplied XPS file or stream is corrupt and cannot be parsed!” when using below code snippet

final Document document = new Document(new ByteArrayInputStream(sourceBytes), new XpsLoadOptions());
document.save(outputStream, new PdfSaveOptions());
return outputStream.toByteArray();

This works fine on Windows machine however fails on integration environment where we are using Linux system.

For the above issue, the environment details are as mentioned below.

  1. Linux Environment:
  • NAME=“Red Hat Enterprise Linux Server”
  • VERSION=“7.9 (Maipo)”
  • ID=“rhel”
  • ID_LIKE=“fedora”
  • VARIANT=“Server”
  • VARIANT_ID=“server”
  • VERSION_ID=“7.9”
  1. Java:
  • OpenJDK 1.8.0_291
  1. Sample xps file (sampleXps.zip) is attached which is used to convert from XPS to PDF.
    sampleXps.zip (97.0 KB)
1 Like

@ChourasiyaRajesh

We are investigating this issue. Your investigation ticket ID is CONVERSIONJAVA-1553.

@ChourasiyaRajesh

We failed to reproduce this issue on Linux. Could you please share a Docker or VirtualBox image?

Hello @Atir_Tahir,

We have sent you a message with all the details related to image and execution output.

Thank you
Rajesh Chourasiya

1 Like

@ChourasiyaRajesh

Thank you for sharing the details. We’ll now further investigate it and let you know about the outcomes.