Hi, we require help with one of the use case of ours, we have created a PDF using Aspose.pdf where we have embedded an SVG file which contains expanded text, but when we try and open it in adobe reader, these expanded texts are not rendered correctly, but when we open the same PDF on a browser, it gets rendered correctly.
Please find the link to the zip file of the SVG and the generated PDF here. Please check the differences on the logo on the left side and the Govt. warning on the right side of the PDF in adobe reader and browsers(Chrome/FF/Safari etc).
Please find the code that we have used to generate the PDF below:
SAXBuilder builder = new SAXBuilder();
org.jdom2.Document document = builder.build(new FileInputStream(new File(“/home/ubuntu/Desktop/svg_with_preserve_aspect_ratio.svg”)));
document.getRootElement().setAttribute(“width”, “648”);
document.getRootElement().setAttribute(“height”, “408”);
String outputSvg = new XMLOutputter().outputString(document);
com.aspose.pdf.Document pdfDocument1 = new com.aspose.pdf.Document();
com.aspose.pdf.Page page = pdfDocument1.getPages().add();
page.setPageSize(720, 1072);
com.aspose.pdf.Image image = new com.aspose.pdf.Image();
image.setFixHeight(306);
image.setFixWidth(486);
image.setFileType(com.aspose.pdf.ImageFileType.Svg);
image.setImageStream(new ByteArrayInputStream(outputSvg.getBytes()));
image.getMargin().setBottom(-3);
for(int i=0;i<2;i++){
page.getParagraphs().add(image);
}
pdfDocument1.save(“/home/ubuntu/Desktop/generated_pdf_using_preserve_aspect_ratio.pdf”);
Looking forward to hearing from you.