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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to reduce the file size when drawing the TIFF image into PDF document ?

How to reduce the file size when drawing the TIFF image into PDF document?


To reduce the file size when drawing the TIFF image (which contains large no of frames) into PDF document, we can save an each frame to Jpeg format and then draw the image into PDF document.

Please refer to the below code example how to draw the TIFF image into PDF document:


//Create a PDF document

Syncfusion.Pdf.PdfDocument document = new Syncfusion.Pdf.PdfDocument();


//Load the image

using (System.Drawing.Image imageFile = System.Drawing.Image.FromFile("../../Data/image.tiff"))


FrameDimension frameDimensions = new FrameDimension(


//Get frame count

int frameNumber = imageFile.GetFrameCount(frameDimensions);

for (int frame = 0; frame < frameNumber; frame++)


// Selects one frame at a time and save as Jpeg.

imageFile.SelectActiveFrame(frameDimensions, frame);

MemoryStream ms = new MemoryStream();

//save the frame as Jpeg image

using (Bitmap bmp = new Bitmap(imageFile))


ImageCodecInfo encoderInfo = this.GetEncoderInfo("image/jpeg");

EncoderParameters encoderParams = new EncoderParameters(1);

encoderParams.Param[0] = new EncoderParameter(Encoder.Quality, 50L);

bmp.Save(ms, encoderInfo, encoderParams);



ms.Position = 0;

//Load the Jpeg image

PdfBitmap image = new PdfBitmap(ms);

//Add the page

Syncfusion.Pdf.PdfPage page = document.Pages.Add();

//Create a PDF graphics

PdfGraphics g = page.Graphics;

//Draw the image into PDF page

g.DrawImage(image, new RectangleF(0, 0, page.GetClientSize().Width, page.GetClientSize().Height));

//Dispose the memory




// Save and close the document.




Sample Link:



Article ID: Published Date: Last Revised Date: Platform: Control:
6029 01/20/2016 01/20/2016 WinForms PDF
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon