Code: Select all
GdPictureImaging img = new GdPictureImaging();
GdPicturePDF pdf = new GdPicturePDF();
pdf.LoadFromFile(@"C:\Input.pdf", false);
pdf.SelectPage(1);
int renderedImageId = pdf.RenderPageToGdPictureImage(300, true);
img.ConvertTo8Bpp216(renderedImageId);
// Commenting IsBlank call produces different C:\Out.tif image
img.IsBlank(renderedImageId);
img.SaveAsTIFF(renderedImageId, @"C:\Out.tif", TiffCompression.TiffCompressionLZW);
img.ReleaseGdPictureImage(renderedImageId);
img.Dispose();
pdf.CloseDocument();
pdf.Dispose();
When I execute such code, I expect that the resulting file "C:\Out.tif" will be 8 bit (because of img.ConvertTo8bpp216 call) but it is not - when I see properties for the file, it says "24 bit LZW" and in my case the file size is about 830 KB. If I comment the line that calls IsBlank and leave all other code intact, the resulting file properties are "8 bit LZW" and file size is about 340 KB.
Is it by design (modifying original image in order to determine if it is blank) or it is a bug in GdPicture ? Could it be fixed for next release and when it will happen ?