Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri May 23, 2025 4:38 am

When I print the PDF directly to the default printer.

pdf.PrintSettings.PrinterName = print(1)
pdf.PrintSettings.PrintController = New StandardPrintController()
pdf.Print()

I want to preview the PDF.How do I code it?

maemaemae
 
Posts: 12
Joined: Tue Jan 21, 2025 5:33 am

Fri May 23, 2025 10:46 am

Hello,

Thanks for your inquiry.
You can refer to the following code to preview the PDF. If you have any other questions later, please contact us in time. Thank you in advance.
Code: Select all
Dim pdf As New PdfDocument()
pdf.LoadFromFile("1.pdf")
pdf.PrintSettings.PrintController = New StandardPrintController()
Dim ppd As New PrintPreviewDialog()
pdf.Preview(ppd.PrintPreviewControl)
ppd.ShowDialog()


Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Fri Jul 04, 2025 1:43 am

We have successfully implemented the preview feature, and I’m glad to see it working properly.
However, I’ve found that navigating between pages is still a bit difficult. Would it be possible to enable page scrolling using the mouse wheel?
If that’s not feasible, would it be possible to make the page navigation buttons larger?

maemaemae
 
Posts: 12
Joined: Tue Jan 21, 2025 5:33 am

Fri Jul 04, 2025 10:16 am

Hello,

The print preview mentioned above uses the .NET native PrintPreviewControl control. Its internal UI cannot be customized by our product, and the control itself does not provide direct properties to implement mouse scrolling or modify button sizes.

If you have any further questions, please feel free to let us know.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Wed Jul 09, 2025 6:39 am

Thank you for your explanation regarding the PrintPreviewControl.

I understand that the control’s internal UI cannot be customized and that it does not support mouse wheel scrolling or button resizing directly. Thank you for clarifying this.

As navigating between pages is still a bit difficult, I was wondering if there might be any possible workarounds or alternative approaches to improve this aspect of the user experience.

Please let me know if any further input is needed from my side.

maemaemae
 
Posts: 12
Joined: Tue Jan 21, 2025 5:33 am

Wed Jul 09, 2025 10:05 am

Thank you for your understanding.

Currently, there are no available methods to optimize the navigation functionality when using Spire.PDF.

For an enhanced preview experience, we recommend using our Spire.PDFViewer https://www.e-iceblue.com/Download/download-pdf-viewer-for-net-now.html. This product not only supports print preview functionality but also enables scrollable preview with more intuitive navigation.

To integrate Spire.PDFViewer into your project , please refer to our integration guide:
https://www.e-iceblue.com/Tutorials/Spire.PDFViewer/Program-Guide/Print-PDF-Document-Pages-via-PDF-Viewer-with-C-VB.NET.html

Should you require any assistance with the implementation, please don't hesitate to contact us.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.PDF

cron