Hi,
I’m evaluating Aspose.PDF for use as an XPS to PDF converter inside of a larger .NET application. When trying to convert certain XPS documents, I am encountering the following exception.
Exception during XPS to PDF: System.ArgumentException: Parameter is not valid.
at System.Drawing.Bitmap…ctor(Stream stream)
at ??.?▲:heart:.▼∟⌂(XmlNode )
at ??.?▲:heart:.??(XmlNode )
at ??.?▲:heart:.?∟⌂(XmlNode )
at ??.▲?▲:heart:.??☼(XmlNode , ↑?☼:diamonds: )
at ??.⌂?▲:heart:.?∟⌂(XmlNode , ↑?☼:diamonds: )
at ??.⌂?▲:heart:.?∟⌂(XmlNode , ↑?☼:diamonds: )
at ??.??▲:heart:.?∟⌂(XmlNode )
at ??.?.↑:left_right_arrow:⌂(String )
at ??.?.Convert(Stream )
at ??.???.Convert(Stream , ?? )
at ?♫.¶.??☼(Stream , Document , XpsLoadOptions , Boolean )
at Aspose.Pdf.Document.→?(Stream , LoadOptions )
at Aspose.Pdf.Document…ctor(Stream input, LoadOptions options)
at TestPDFConversion.Program.XpsToPdf(Stream xpsFile) in c:\builds\STX-HostAgents-RemotePrinting\TestPDFConversion\Program.cs:line 48
This is using version 1.11.0.0 of Aspose.PDF, the attached XPS file, and the following Aspose code.
This is using version 1.11.0.0 of Aspose.PDF, the attached XPS file, and the following Aspose code.
var xpsStream = File.Open(filename, FileMode.Open);Thanks for any help you can offer!
MemoryStream pdfStream = new MemoryStream();
Document document = new Document(xpsStream, new XpsLoadOptions());document.Save(pdfStream);