Esempio n. 1
0
        private void ShowPDF(string fileName)
        {
            PDFLibrary qp = new PDFLibrary();

            qp.UnlockKey(LicenseKey);
            qp.LoadFromFile(fileName);
            // Fit width of PDF to width of picture box
            int dpi = Convert.ToInt32((pictureBox1.Width * 72) / qp.PageWidth());

            byte[]       bmpData = (byte[])qp.RenderPageToVariant(dpi, 1, 0);
            MemoryStream ms      = new MemoryStream(bmpData);
            Bitmap       bmp     = new Bitmap(ms);

            pictureBox1.Image = bmp;
            ms.Dispose();
        }