We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Image in Pdf document

I have a large .tif image 20000x15000 - (24bit RGB, no compression) that I can successfully insert into a PDF.
However, the pdf file is always compressed even though I write in code:"PdfCompressionLevel.None".
My code:

            document.ColorSpace = PdfColorSpace.RGB;
            document.Compression = PdfCompressionLevel.None;
            document.FileStructure.Version = PdfVersion.Version1_6;
            document.DocumentInformation.Author = "TW";

            PdfSection section = document.Sections.Add();

            PdfBitmap image = new PdfBitmap(@"D:\GM_1404_2015_A_PD.tif");
            image.Quality = 100;
            image.ActiveFrame = 0;
            section.PageSettings.Width = image.PhysicalDimension.Width;
            section.PageSettings.Height = image.PhysicalDimension.Height;
            section.PageSettings.Margins.All = 0;
            section.PageSettings.Orientation = PdfPageOrientation.Landscape;

            PdfPage page = section.Pages.Add();

Any suggestions?


3 Replies

PH Praveenkumar H Syncfusion Team December 30, 2015 04:57 AM UTC

Hi Tobias,

Thank you for using syncfusion products,

Can you please send us your tiff image, so we will investigate and provide you the proper details in this.

With Regards,

TO Tobiasz December 30, 2015 10:43 AM UTC

Thank you for your quick reply,

 I have attached the image you requested this email (image_in.tif).
This is the sample of the original image.

 The file image_in.tif is the original file.
 The file image_in.pdf is the pdf I get as result using C# code.
 The file image_in_photoshop.pdf after using Photoshop. 
Both pdf files I get with "compress none" option.

 Thank you for your time,

Attachment: Image_in_c196780b.zip

PH Praveenkumar H Syncfusion Team December 31, 2015 11:07 AM UTC

Hi Tobias,

Thank you for your update,

We do compression option only for content of the PDF document, so by default we are compressing the image when drawing in to the PDF document. So that  “document.Compression = PdfCompressionLevel.None;” doesn’t make any changes in the image compression. if you want compress the image further please refer the below UG documentation link.

Please let us know if you need further assistance.

With Regards,

Live Chat Icon For mobile
Up arrow icon