Windows Server 2003 vs XP. PDF to JPG
Posted: Tue Mar 06, 2012 6:35 pm
Hi,
We are creating JPGs from PDFs using the following sequence of calls:
_______________________________________________________________________
const int drawingsWidthMax = 748;
GdPicture.GdPicturePDF gdPicturePDF = new GdPicture.GdPicturePDF();
GdPicture.GdPictureStatus status = gdPicturePDF.LoadFromFile(pdfPath, false);
if (!gdPicturePDF.SelectPage(1)) { ... error ... }
GdPicture.GdPictureImaging gdPictureImaging = new GdPicture.GdPictureImaging();
int imageID = gdPicturePDF.RenderPageToGdPictureImageEx(72f, true);
if (imageID == 0) { ... error ... }
int height = gdPictureImaging.GetHeight(imageID);
int width = gdPictureImaging.GetWidth(imageID);
gdPictureImaging.SetROI(0, 0, width, height);
gdPictureImaging.ConvertTo1Bpp(imageID, 220);
int jpgID = gdPictureImaging.CreateThumbnailHQ(imageID, drawingsWidthMax, drawingsWidthMax * height / width);
status = gdPictureImaging.SaveAsJPEG(jpgID, pathWithoutExtension + ".jpg", 75);
if (status != GdPicture.GdPictureStatus.OK) { ... error ... }
______________________________________________________________________
The attached PDF creates a good image when using XP machine under Visual Studio 10 web server, however 'a white' JPG is created using Windows Server 2003 (both 32-bit and up to date in service packs).
Is there difference between Windows Server 2003 and XP?
(we are currently running GdPicture.NET SDK version 8.5.17, .NET 3.5. it also fails with an earlier 8.5 version)
Regards Dave
We are creating JPGs from PDFs using the following sequence of calls:
_______________________________________________________________________
const int drawingsWidthMax = 748;
GdPicture.GdPicturePDF gdPicturePDF = new GdPicture.GdPicturePDF();
GdPicture.GdPictureStatus status = gdPicturePDF.LoadFromFile(pdfPath, false);
if (!gdPicturePDF.SelectPage(1)) { ... error ... }
GdPicture.GdPictureImaging gdPictureImaging = new GdPicture.GdPictureImaging();
int imageID = gdPicturePDF.RenderPageToGdPictureImageEx(72f, true);
if (imageID == 0) { ... error ... }
int height = gdPictureImaging.GetHeight(imageID);
int width = gdPictureImaging.GetWidth(imageID);
gdPictureImaging.SetROI(0, 0, width, height);
gdPictureImaging.ConvertTo1Bpp(imageID, 220);
int jpgID = gdPictureImaging.CreateThumbnailHQ(imageID, drawingsWidthMax, drawingsWidthMax * height / width);
status = gdPictureImaging.SaveAsJPEG(jpgID, pathWithoutExtension + ".jpg", 75);
if (status != GdPicture.GdPictureStatus.OK) { ... error ... }
______________________________________________________________________
The attached PDF creates a good image when using XP machine under Visual Studio 10 web server, however 'a white' JPG is created using Windows Server 2003 (both 32-bit and up to date in service packs).
Is there difference between Windows Server 2003 and XP?
(we are currently running GdPicture.NET SDK version 8.5.17, .NET 3.5. it also fails with an earlier 8.5 version)
Regards Dave