View PDF files in C# using the Xpdf library, Print PostScript.

02 Oct


Xpdf is an Open Source library released under GPL license; they have an ActiveX with commercial license, but some time ago, before I knew about this commercial control, I wrote this wrapper library to render PDF files in C#.


The basic idea is create a preview of PDF files in C#. After looking at many places in the internet, I found this wonderful library; the only problem is that the library uses XLib, and there is no XLib available for Windows. Fortunately, Xpdf can render the generated PDF into a Win32 DC.

Download AFPDFLib – 3 MB

Download PDF Viewer – 670 KB


  • this.pageViewControl1.DrawShadow = true;
  • this.pageViewControl1.PaintControl += new PDFView.PageViewer.PaintControlHandler(this.doubleBufferControl1_PaintControl);

Reference by:

Antonio Sandoval

Member I’m a Chemical Engineering that loves the programming.
2003 – Graduated from Technical Programmer UNIVA México.
2009 – Graduated from Chemical Engineering Universidad de Guadalajara, Mexico.
Programmer by Hobby since 6 years ago.

Occupation: Engineer
Company: HidraQuim SA de CV
Location: Mexico Mexico

Posted by on October 2, 2009 in C#


6 responses to “View PDF files in C# using the Xpdf library, Print PostScript.

  1. kniskelia

    March 4, 2011 at 11:26 AM

    Diky za zajimave informace

    • sochinda

      March 8, 2011 at 1:17 PM

      Oh! díky Kniskelia


    June 22, 2013 at 5:03 AM

    The EPSON Expression Home XP-400 is available at major computer, office and electronic
    superstores, a variety of retail stores nationwide and Epson’s retail site, For more information, please visit. The benefit of draft print mode is consumption of less ink. By contrast, pigment-based inks are more expensive and difficult to manufacture than dye-based inks and consequently, less likely to be found in colour desktop printers.

  3. liftmaster garage door opener manual

    September 2, 2014 at 9:21 PM

    I rarely write remarks, but i did some searching and wound up
    here View PDF files in C# using the Xpdf library,
    Print PostScript. | Sochinda’s Blog. And I do have a couple of questions
    for you if you don’t mind. Could it be only me or does it seem
    like some of these remarks come across like they are written by brain dead individuals?
    😛 And, if you are posting on additional social sites, I would like
    to keep up with anything new you have to post. Could you make a
    list of the complete urls of your communal sites like your Facebook page, twitter feed, or linkedin profile?

  4. garage door repair

    September 2, 2014 at 10:26 PM

    Hey I know this is off topic but I was wondering if you knew of any widgets I
    could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was
    hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  5. paleo cereal

    December 11, 2014 at 7:38 PM

    It’s impressive that you are getting thoughts from this post
    as well as from our dialogue made here.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: