Printing PDF from C#

Example requests & Code samples for GdPicture Toolkits.
Post Reply
marchino
Posts: 3
Joined: Fri Nov 14, 2008 7:55 pm

Printing PDF from C#

Post by marchino » Tue Oct 19, 2010 1:14 pm

Hi, I'm trying to print a PDF file in a windows service written in C#.
I'm using:

Code: Select all

            
AxGdPicturePro5.AxGdViewer viewer = new AxGdPicturePro5.AxGdViewer();
viewer.SetLicenseNumber("xxxxxxxxxxxxxxxxxxxxxxx");
viewer.LockControl = true;
viewer.DisplayFromPdfFile(filename);
viewer.PrintSetActivePrinter("printername");
viewer.PrintSetFromToPage(1, viewer.PageCount);
viewer.PrintImage();
viewer = null;
Unfortunately I recevice a System.Windows.Forms.AxHost+InvalidActiveXStateException.
How can I solve this problem?
I don't need to show PDF, as I can't show forms in a windows service.
I just need to print it...

Thanks, Marco

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Printing PDF from C#

Post by Loïc » Tue Oct 19, 2010 1:57 pm

Hi Marco,

Unfortunately you can not do that with the ActiveX version.
This feature is provided in GdPicture.NET only.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests