We have used Aspose.Pdf.Kit before to get a thumbnail of the first page of a pdf document and it have worked fine on both Windows7 and Windows Server 2008. I came across a pdf which didn't work (got an Exception) and got the suggestion to use Adobe.Pdf instead. That solved my problem, but it gave me another one. Another test pdf document which have always worked now stopped working when run in Windows Server 2008 environment. I get an image, but it looks no good. I made a little test program where I use the same file with the two libraries and displays the result in two picture boxes. I send two screen dumps of that program, one when executed on Windows 7 SP1 (named Win7.jpg) which looks good and one when executed on Windows Server 2008 SP2 (named WinServer2008.jpg) which doesn't look good on the right picture where Adobe.Pdf library used. The code I used added below. I also send the pdf document I am using for the test. What can the problem be? Is there something missing on the Windows Server machine?(but every other pdf I have tested looks good)
// Use Aspose.Pdf.Kit
Aspose.Pdf.Kit.PdfConverter converter1 = new Aspose.Pdf.Kit.PdfConverter();
converter1.BindPdf(strInPath);
converter1.StartPage = 1;
converter1.EndPage = 1;
converter1.DoConvert();
converter1.GetNextImage(msPdfKit, System.Drawing.Imaging.ImageFormat.Jpeg, 619, 540, 100);
Image img1 = Image.FromStream(msPdfKit);
pictureBox1.Image = img1;
// Use Aspose.Pdf
Aspose.Pdf.Facades.PdfConverter converter2 = new Aspose.Pdf.Facades.PdfConverter();
converter2.BindPdf(strInPath);
converter2.StartPage = 1;
converter2.EndPage = 1;
converter2.DoConvert();
converter2.GetNextImage(msPdf, System.Drawing.Imaging.ImageFormat.Jpeg, 619, 540);
Image img2 = Image.FromStream(msPdf);
pictureBox2.Image = img2;