Convert a PDF to TIFF without loss of quality
Posted: 2017-07-10T03:44:23-07:00
Hi All,
I am trying to convert a PDF file to a TIFF file without losing its quality. But I see there is a loss of quality as a result when I OCR the TIFF file using Tesseract words are being misread. I am using Magick.NET-Q16-AnyCPU dll of version 7.0.0.0 in my C# application.
Here is my piece of code for creating a TIFF file from PDF bytes -
Tried even increasing the DPI from 300 to 400/500 but I don't see much difference in the quality. Looking for some inputs here on how to retain the quality while TIFF conversion.
Thanks in Advance,
Hari
I am trying to convert a PDF file to a TIFF file without losing its quality. But I see there is a loss of quality as a result when I OCR the TIFF file using Tesseract words are being misread. I am using Magick.NET-Q16-AnyCPU dll of version 7.0.0.0 in my C# application.
Here is my piece of code for creating a TIFF file from PDF bytes -
Code: Select all
public void ConvertToTIFF(byte[] bytes)
{
ImageMagick.MagickReadSettings settings = new ImageMagick.MagickReadSettings();
settings.Density = new ImageMagick.Density(300, 300);
settings.UseMonochrome = true;
settings.CompressionMethod = CompressionMethod.LZW;
using (MagickImageCollection images = new MagickImageCollection())
{
images.Read(bytes, settings);
images.Write(targetFile);
}
}
Thanks in Advance,
Hari