Update AUG 2024:
pdfsharp.com has been shifted to
pdfsharp.net.
And as per official
FAQ, this is not possible:
Quote:
PDFsharp comes with a preview control designed to visualize drawing operations of the XGraphics object, but it cannot render PDF files.
Further the DrawImage function can be used to draw so called form XObjects in PDF pages. If you try to render such an object in the preview, only the bounding box is drawn to show that it cannot be rendered.
The PDFsharp Samples show how to invoke Adobe Reader or Acrobat to view or print PDF files and how to invoke GhostScript to create images from PDF pages.
So, if your primary goal is to show an existing PDF document inside your WinForm application, this is not your path to go.
Regards,
BH
I found that this is possible with PdfSharp. Please see:
http://www.pdfsharp.com/PDFsharp/[
^],
http://pdfsharp.codeplex.com/[
^].
Some code sample demonstrating a PDF viewer using this library and
System.Windows.Forms
can be found in Google Code:
http://reactivity.googlecode.com/svn/trunk/1.0/tools/PDF-2-JPEG/PDFsharp/PdfViewer/PdfViewer.Demo/PdfViewer.cs[
^].
—SA