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

Free Support Forum - aspose.com

Convert HTML to PDF but disable ZOOM while conversion

Hello,

I am using ASPOSE Words to convert HTML string to PDF document.

Now when I convert my HTML to PDF, I get a ZOOMED version of the HTML document , due to which my design gets disturbed.
Please let me know as to how I can prevent this internal ZOOM of the PDF document being created.

Please find my code below:-

LoadOptions loadOptions = new LoadOptions();
loadOptions.BaseUri = MyDir;
Document doc = new Document(stream, loadOptions);
// You can close the stream now, it is no longer needed because the document is in memory.
// doc.ViewOptions.ViewType= Viewtype.
//doc.ViewOptions.ZoomPercent=-30;
//
DocumentBuilder docBuilder = new DocumentBuilder();
docBuilder.Document = doc;
PageSetup ps = docBuilder.PageSetup;
ps.RightMargin = 5;
ps.LeftMargin = 10;
//
stream.Close();
doc.Save(MyDir + strFileName);

Hi Vishal,

Thanks for your inquiry. Please use PdfSaveOptions.ZoomFactor property to get or set a value determining zoom factor (in percentages) for a document and PdfSaveOptions.ZoomBehavior get or set a value determining what type of zoom should be applied when a document is opened with a PDF viewer.

In your case, i suggest you please use PdfSaveOptions.ZoomBehavior as PdfZoomBehavior.None. Hope this helps you.

Please let us know if you have any more queries.