Convert PDF to Multipage TIFF with different DPIs

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Rasterizer for .NET (v3)  /  Convert PDF to Multipage TIFF with different DPIs

DynamicPDF Rasterizer for .NET (v3) Forum

Hi,

I need  convert a PDF to multi-page TIFF, but 2 different DPIs.

B/W => 200dpi
Color => 100dpi

Is this possible using PDFRasterizer?

Thanks you.
Posted by a ceTe Software moderator
Hello,

You can create color or monochrome (black and white) multipage tiff images using DynamicPDF Rasterizer. Below are code samples:

// Code to create a color multipage TIFF image
PdfRasterizer rastObj = new PdfRasterizer(@"Input PDF file path");
string output = @"Output Tiff file path";
// Set the images DPI
DpiImageSize imageSizeObj = new DpiImageSize(100, 100);
TiffImageFormat oTiffImageFormat = new TiffImageFormat(TiffColorFormat.Rgb);
rastObj.DrawToMultiPageTiff(output, oTiffImageFormat, imageSizeObj);

//Code to create a black and white multipage TIFF image
PdfRasterizer rastObj = new PdfRasterizer(@"Input PDF file path");
string output = @"Output Tiff image file path";
// Set the images DPI
DpiImageSize imageSizeObj = new DpiImageSize(200, 200);
TiffMonochromeColorFormat tiffColorFormat = new TiffMonochromeColorFormat(TiffMonochromeCompressionType.CcitGroup4);
TiffImageFormat oTiffImageFormat = new TiffImageFormat(tiffColorFormat);
rastObj.DrawToMultiPageTiff(output, oTiffImageFormat, imageSizeObj);

Thanks,
ceTe Software Support Team
Thank you.

But is there a way from the Input PDF file, I can identify if it is a colored page then create colored TIFF with 100DPI else create a B/W TIFF with 200DPI?
Since my input PDF will have both kind of pages.
Posted by a ceTe Software moderator
Hello,

We don't have this functionality built in, but you could use Rasterizer to create a color rasterization of each page and sample it for color values. You could probably do this at a lower resolution for added efficiency.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 4:33 AM.