When converting a PDF to TIF using Adobe, I get a small sizes clear TIF. When I use Aspose.pdf tools, I get a huge TIF without compression and if I use compression the file size is small but the image is not clear. Turns out, if I match the resolution to what Adobe creates, the TIF looks fine and is small, not as small as adobe’s but ok (Adobe gets me 50k, Aspose 70k). Question is, how do I get that resolution from the PDF so I can dynamically get those numbers?
Code:
Aspose.Pdf.Facades.PdfConverter converter = new Aspose.Pdf.Facades.PdfConverter();
converter.Resolution = new Resolution(204, 117);
converter.BindPdf(@“C:\PdfFile.pdf”);
converter.DoConvert();
converter.SaveAsTIFF(@“C:\TifFile.tif”, CompressionType.CCITT4);
converter.Close();
OR
Document pdfDocument = new Document(@“C:\PdfFile.pdf”);
TiffDevice tifDevice = new TiffDevice();
tifDevice.Resolution.X = 204;
tifDevice.Resolution.Y = 117;
tifDevice.Settings.Compression = CompressionType.CCITT4;
tifDevice.Process(pdfDocument, @“C:\TifFile.tif”);