Zoom in zoom out xml document

Hello,
I am converting an xml document to pdf using the below syntax.
var document = new com.aspose.pdf.Document(“input.xml”, new com.aspose.pdf.HtmlLoadOptions());
document.save(“output.pdf”, new PdfSaveOptions());

The conversion works fine. However I would like to zoom in or zoom out the document based on whether the document is readable or not.

I tried using PdfPageEditor().zoom, although it zoom in and zoom out did work, but the contents sometimes goes out of the margin of the converted pdf document.

Is there a way to zoom the contents of xml document and wrap the contents to fit in the page?

@rprasadcr

Would you kindly share your sample input file and complete code snippet for our reference which you are using to apply zoom in/out? We will test the scenario in our environment and address it accordingly.

import com.aspose.pdf.*;

var document = new Document(“sample.xsl”, new HtmlLoadOptions())
var pdfPageEditor = new PdfPageEditor(document)
pdfPageEditor.setVerticalAlignmentType(VerticalAlignment.Top);
pdfPageEditor.setZoom(1.5); // 150%
pdfPageEditor.save(“output.pdf”)sample.zip (325 Bytes)

@rprasadcr

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-42985

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like