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.

Sat Oct 24, 2015 11:09 am

i post with new page because past post was done.
(how-to-set-my-pdf-size-and-save-html2pdf-exactly-same-size-t5451.html)

at the post, you taught me how to print doc (doc.PrintDocument.Print();)

now i'm using your plugins then how can i print pdf?
i tried "System.Drawing.Printing.PrintDocument()" but it doesn't work.

best regards
boom

bomboom
 
Posts: 15
Joined: Fri Jul 17, 2015 7:08 am

Mon Oct 26, 2015 1:32 am

Hi,

Thanks for your further inquiry.
Sorry that there is no method with plugins to print pdf document, the plugins solution just to convert HTML to PDF.
At present, we have only the below two solutions for printing.
There are some sample code are shared here.
Code: Select all
solution 1:
         //Use the default printer and print all pages
         pdfDocument.PrintDocument.Print();
solution 2:
            //Select printer and the page range to print
            PrintDialog dialogPrint = new PrintDialog();
            dialogPrint.AllowPrintToFile = true;
            dialogPrint.AllowSomePages = true;
            dialogPrint.PrinterSettings.MinimumPage = 1;
            dialogPrint.PrinterSettings.MaximumPage = pdfDocument.Pages.Count;
            dialogPrint.PrinterSettings.FromPage = 1;
            dialogPrint.PrinterSettings.ToPage = pdfDocument.Pages.Count;
            if (dialogPrint.ShowDialog() == DialogResult.OK)
            {
                pdfDocument.PrintFromPage = dialogPrint.PrinterSettings.FromPage;
                pdfDocument.PrintToPage = dialogPrint.PrinterSettings.ToPage;
                pdfDocument.PrinterName = dialogPrint.PrinterSettings.PrinterName;
                PrintDocument printDoc = pdfDocument.PrintDocument;
                dialogPrint.Document = printDoc;
                printDoc.Print();
            }


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2772
Joined: Wed Jun 27, 2012 8:50 am

Tue Oct 27, 2015 8:35 am

thanks for reply
i solved it.

best regards
boom

bomboom
 
Posts: 15
Joined: Fri Jul 17, 2015 7:08 am

Tue Oct 27, 2015 8:38 am

Hi boom,

Thanks for your message. Welcome to write to us again for further problem.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2772
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron