PdfConverter: PDF to specific TIFF format HOWTO?

Can someone please point me to a sample explaining how to output a specific TIFF format using Aspose.Pdf.Kit.NET PdfConverter?

I need images in TIFF with 300 dpi, monochrome, CCITT group 4 compression

Thanks!

Hi Jed,

Please find a sample below to help you convert the PDF file to TIFF image according to your requirement:


//create PdfConverter object and open PDF file

PdfConverter pdfConverter = new PdfConverter();

pdfConverter.BindPdf(“input.pdf”);

//set resolution

pdfConverter.Resolution = 300;

//start conversion process

pdfConverter.DoConvert();

//save the PDF as TIFF with specified compression type

pdfConverter.SaveAsTIFF(“output.tif”, 500, 400, CompressionType.CCITT4);

pdfConverter.Close();

I hope this helps. If you have any further questions, please do let us know.
Regards,

Thank you for this sample. I have a few questions:


1. Does switching to CCITT4 compression automatically mean switching to monochrome? (The output is monochrome/1bpp, but I don’t see any specific code changes to specify this.)

2. What is the reasoning for the magic numbers in SaveAsTIFF parameters (resolutionX = 500, resolutionY = 400)? Shouldn’t both be set to match the initial pdfConverter.Resolution of 300? (I believe this is what happens when using other SaveAsTIFF method signatures which don’t require these parameters.)

Thanks for your help.

Hi Jed,

We’re looking into your concerns at our end and you’ll be updated shortly.

We’re sorry for the inconvenience.
Regards,

Hi Jed,

I would like to update you regarding your queries.

First of all, CCITT4 compression is designated for bi-level encoding, therefore the images generated either contain black and white color or grayscale.

Secondly, you can either specify the resolution value using Resolution property or using the parameter values for your custom X and Y resolution.

I hope this helps. If you have any further questions, please do let us know.
Regards,

1. If I understand your explanation, using CCITT4 compression will result in a TIFF that is either monochrome (black & white, 1bpp, the only type output I can use) -or- grayscale (something different from monochrome and thus unacceptable). I still would like to know what determines which color scheme is used. Is there any setting to force only monochrome output?

2. Thank you. I will use the same resolution value of 300 for all 3 parameters (PdfConverter.Resolution, PdfConverter.SaveAsTiff resolutionX, and PdfConverter.SaveAsTiff resolutionY). This portion of my questions has been answered.

Thanks for your help dealing with the TIFF format.

Hi Jed,

I’m afraid, this is currently not possible to force the monochrome only image production. I have logged this feature request as PDFKITNET-17621 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is supported.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 17621) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.