Hi Team,
We are having image quality issue while converting PDF to tiff for Aspose.PDF version 19.9.
Please find attached the original PDF and the converted tiff images.
sample.zip (68.1 KB)
Code snippet used below:
Document pdfDocument = new Document(FullInputFileName);
//create Resolution object
Resolution resolution = new Resolution(300);
//create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format8bpp;
if (tiffSettings.Shape == ShapeType.Landscape)
tiffSettings.Shape = ShapeType.None;
tiffSettings.SkipBlankPages = false;
Stream output = null;
sourceImages = new System.Drawing.Image[pdfDocument.Pages.Count];
//create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
Could you please help us what we can do improve the image quality.
@cndtsumesh
With the library version 24.08 using the code below I got a valid document.
var pdfDocument = new Document(dataDir + "OriginalPDF.pdf");
//create Resolution object
var resolution = new Resolution(300);
//create TiffSettings object
var tiffSettings = new TiffSettings()
{
Compression = CompressionType.CCITT4,
Depth = Aspose.Pdf.Devices.ColorDepth.Format8bpp,
SkipBlankPages = false
};
if (tiffSettings.Shape == ShapeType.Landscape)
{
tiffSettings.Shape = ShapeType.None;
}
//create TIFF device
var tiffDevice = new TiffDevice(resolution, tiffSettings);
using (var output = new FileStream(dataDir + "Converted-Out.tiff", FileMode.OpenOrCreate))
{
tiffDevice.Process(pdfDocument.Pages[1], output);
}
Converted-Out.zip (31.0 KB)
Hi sergei.shibanov,
Thank you for your response. We tried with the same code and latest dll version 24.8 but the image quality remains the same low quality.
Could you help us what could be the issue here.
Thank you
@cndtsumesh
Could you please share the output PDF generated at your end? We will further proceed accordingly.
Hi ,
Please find the generated TIFF file attached below.
OutputTIFF.zip (14.5 KB)
@cndtsumesh
By setting the resolution to 600 in the code above, I got an image with better quality (but also a larger size, of course).
Converted-Out.zip (27.1 KB)
Thank you for the reply, We tried this scenario and its increasing the file size.
In an alternate way can we have the input file font increased or made to bold from our side.
Could you suggest the font size so that the quality of the image is not lost.
Since the display may be different depending on the environment (OS, sdk) - you should choose this experimentally for your environment.
A good workaround if you have the opportunity.