Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Thumbnail generated incorrectly by pdf library

$
0
0
The thumbnail generated from the code below does not match the pdf. Run the attached code and extract the thumbnail from example_pdf.pdf. example_thumb.jpg illustrates the incomplete rendering.

privatestaticvoid MakeThumbnail(string filePath, string thumbPath)

        {

            //Load the document

            Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(filePath);

 

            using (FileStream imageStream = newFileStream(thumbPath, FileMode.Create))

            {

               //Create PNG device with specified resolution

                Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);

                Aspose.Pdf.Devices.JpegDevice jpgDevice = new Aspose.Pdf.Devices.JpegDevice(resolution, 100);

 

               //Convert page 1 and save the image to stream

                jpgDevice.Process(pdfDocument.Pages[1], imageStream);

 

               //Close stream

                imageStream.Close();

            }

        }


Viewing all articles
Browse latest Browse all 3131

Trending Articles