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 Jul 07, 2017 8:32 pm

Is there a way to suppress the printing window from showing (see attached)?

Here is the code that prints:

Code: Select all
        Dim doc As New PdfDocument
        doc.LoadFromFile(fileName)
        doc.PrintDocument.Print()


My application calls this code in a loop and may be printing hundreds of PDF files. My application has it's own status window showing where printing is holding.
Currently the Printing window shows up hundreds of times and dances around the screen (it's not always in the same position).

yyp
 
Posts: 14
Joined: Thu Jun 15, 2017 10:54 pm

Fri Jul 07, 2017 8:57 pm

After posting, I found the answer. For those interested, see
https://stackoverflow.com/questions/5511138/can-i-disable-the-printing-page-x-of-y-dialog

(It really is a general .NET printing question/answer)

Here's the updated code:
Code: Select all
           
        Dim doc As New PdfDocument
        doc.LoadFromFile(fileName)
        doc.PrintDocument.PrintController = New Printing.StandardPrintController
        doc.PrintDocument.Print()

yyp
 
Posts: 14
Joined: Thu Jun 15, 2017 10:54 pm

Mon Jul 10, 2017 1:26 am

Dear yyp,

Glad to hear that the issue has been resolved by yourself.
If there is any question, please do not hesitate to contact us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF