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

Free Support Forum - aspose.com

Fit (maximize content) to printed page

I am using this code:

Dim ps As New System.Drawing.Printing.PrinterSettings()
Dim viewer As New PdfViewer
viewer.AutoResize = True
ps.DefaultPageSettings.Margins.Left = 0
ps.DefaultPageSettings.Margins.Right = 0
ps.DefaultPageSettings.Margins.Top = 0
ps.DefaultPageSettings.Margins.Bottom = 0

Still, the final printed image is not maximized on paper. Am I missing any setting?

Hello Henrik,

Thanks for your inquiry.

In order to fit the image according to paper size, you need to set both AutoResize and AutoRotate properties to true. Please try printing by setting those properties to true and if you still face any issue, we will really appreciate if you please share a sample input document. This way we can test the scenario in our environment and share our finding with you.

Best Regards,

AutoRotate was already set to true. Still no maximize of content. It is still about 3-4 cm margin on each side.

Hello Henrik,

It seems an issue related to printer settings which you have installed in your printer. It is quite possible the printer settings supplied by your code would have been overruled by printer’s setting. Please try to set “Page Scaling” to none and deselect “Auto-Rotate and Center” options in your printer settings.

In a case if you still face any issue, please share your sample input document and environment information i.e printer version, OS version, application target framework, so that we can test the scenario is our environment.

We are sorry for the inconvenience.

Best Regards,