Best way to print a pdf document

Discussions about document printing in GdPicture.NET using GdPictureImaging.
Post Reply
Posts: 1
Joined: Wed Oct 28, 2009 12:06 pm

Best way to print a pdf document

Post by benilu » Wed Dec 02, 2009 12:53 pm


We are using version of GDPicture.NET.dll.

I have to do the following in a .NET application Iam developing:

* Load a document stored on the file system. (without showing it)
* Print its content. Printing should not be blocking the application, so it has to run in background.
* Delete de document from the file system.

This is the way I am trying to perform this printing (pseudo code):

Code: Select all

Public Sub PrintDoc()

Dim pathOfDoc = ... 'here I set the path to the document

'I create a new viewer in order to load the document
'NOTE: I don't show the viewer itself on the GUI
Dim mygdviewer as New GDviewer
mygdviewer.DisplayFilefromByteArray (IO.File.ReadAllBytes(pathOfDoc))

'I set the pages to print
mygdviewer.PrintSetFromToPAge(1, mygdviewer.PageCount)

'I tell the viewer to pring

'I delete the file

In order to perform background printing I call PrintDoc() from a separate thread (is that a good idea?)

So, now I get following problems/questions:

* Printing is slow
* I don't know how to avoid the prinitng dialog
* Is there another class for printing than GDViewer?
* What is the best way to print the pdf file when no displaying of the file is required?
* The GDViewer in my separate thread seems to interfere with other GDViewers displayed in my GUI. Once I have printed, I get error messages when I continue using other GDViewers instantiated before printing. NOTE: My aplication contains a tab control that displays one GDViewer per tab page. So, several GDViewer can be displayed at the same time.

Can you answer my questions?

Best regards!

User avatar
Site Admin
Posts: 5656
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Best way to print a pdf document

Post by Loïc » Wed Dec 02, 2009 7:57 pm


The current version is not thread safe for PDF rendering. We will add this support ASAP.

To avoid printing dialog I suggest you ta call the PrintSetShowPrintingProgress(False) & use printing method such as PrintImage() instead of PrintImageDialog()...

If you encounter any problem related to bad PDF rendering/printing, please send your file to our support team at esupport (at) gdpicture (dot) com.

With best regards,


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest