Free Support Forum - aspose.com

PDF to XML and XML to PDF conversion issue

Hi,

I have converted a pdf to xml using Aspose Pdf api and again I converted the xml to pdf back, during this xml to pdf
conversion process, an empty pdf document is created without any actual content in it.

And also I would like to know during this conversion process will the generated pdf documents contains the same actual font settings?

Regards,
Dharmender

Hi Dharmender,


Thanks for your inquiry. We have manged to reproduce the XML to PDF issue and logged it as PDFNEWJAVA-34385 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress via this forum thread.

Moreover, in reference to your font related issue. We are checking with our development team and will update you soon.

We are sorry for the inconvenience caused.

Best Regards,

Hi Dharmender,


Thanks for your patience. We have investigated the issue and would like to update you that unfortunately an XML format used to create a PDF document and an XML format used to export data from PDF are incompatible as used for other purposes.

If you want to use XML as some intermediate transmission format then you can try to use SVG-format for it (SVG is an XML-based format), you can use the snippet bellow for this. But, I am afraid there is some problems with a saving fonts to SVG , it uses Arial fonts only. However to fix this bug we have created aa issue PDFNEWJAVA-34948 in our issue tracking system. We will notify you as soon as it is resolved.


Document pdfDocument = new Document(“Demo.pdf”);<o:p></o:p>

pdfDocument.save(“test.svg”, new
SvgSaveOptions()); <o:p></o:p>

Document pdfDocument2 = new Document(“test.svg”, new SvgLoadOptions());<o:p></o:p>

pdfDocument2.save("fromSVG.pdf");


Please feel free to contact us for any further assistance.


Best Regards,