Quick PDF Library, my companies PDF SDK, lo ayudará a procesar archivos PDF. No es software gratuito, pero la licencia permite la distribución libre de regalías de las aplicaciones compiladas que construyes con él. Encontrar componentes de código abierto/gratuito para renderizar archivos PDF es un poco más complicado que otras tareas básicas de manipulación de PDF porque renderizar archivos PDF puede ser bastante difícil.
Aquí hay un código fuente de muestra C# que muestra cómo renderizar el PDF en el cuadro de imagen de su formulario.
private void Form1_Load(object sender, EventArgs e)
{
QuickPDFAX0718.PDFLibrary pdf = new QuickPDFAX0718.PDFLibrary();
qp.UnlockKey("......Licence Key......");
// Open PDF File
int Handle = qp.DAOpenFile("C:\\sample.pdf", null);
// Get Total Number of Pages in a PDF File
int PageCount = qp.DAGetPageCount(Handle);
int PageNo = 1;
// It will get Reference of page 1 from PDF file
int PageRefNo = qp.DAFindPage(Handle, PageNo);
// You can change this parameter for Zoom In/Zoom Out purpose
int Zoom = 76;
double pageWidth = qp.DAGetPageWidth(Handle, PageRefNo)/Zoom;
double pageHeight = qp.DAGetPageHeight(Handle, PageRefNo)/Zoom;
// DPI use for rendering the page. Increase DPI will increate quality of image
int dpi = 92;
// Calculate Dimension of final output image
Bitmap b = new Bitmap(Convert.ToInt32(pageWidth * dpi), Convert.ToInt32(pageHeight * dpi));
// This will Draw render image on GDI
using (Graphics g = Graphics.FromImage(b))
{
IntPtr dc = g.GetHdc();
qp.DARenderPageToDC(Handle, PageRefNo, dpi, (int)dc);
g.ReleaseHdc(dc);
}
// Assigne rendered image to PictureBox Control which will display PDF on Windows Form.
pictureBox1.Image = b;
pictureBox1.BorderStyle = BorderStyle.Fixed3D;
}
La biblioteca no incluye funciones integradas para ayudarle con el zoom, pero ya que estás reproduciendo el archivo PDF como una imagen BMP que puede hacerse cargo del zoom con bastante facilidad.
Al seguir esta pista, dejaremos de publicar en stackoverflow, ya que podemos encontrar casi todo en google ... Créame, he hecho investigaciones antes. Me interesan los componentes que los carteles probaron y encontraron útiles/flexibles y pueden aconsejar su uso. – Maciej