We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Image quality is poor after convertion

Hi Team,
When i try to convert a pdf file to tiff image its quality became very poor.

I need to use CCITT4 compression . That is mandatory.
with this compression is there any way to make the converted image more clear.

Here i am attaching both the pdf file and tiff file.

Please see the code which i am using.

 public static System.Drawing.Image[] ConvertPDFtoMultiPageTiff(string OutputFolder, string FullInputFileName)
System.Drawing.Image[] sourceImages = null;
        <span style="color:blue;">try</span>

            <span style="color:#2b91af;">Document</span> pdfDocument = <span style="color:blue;">new</span> <span style="color:#2b91af;">Document</span>(FullInputFileName);
            <span style="color:green;">//create Resolution object</span>
            <span style="color:#2b91af;">Resolution</span> resolution = <span style="color:blue;">new</span> <span style="color:#2b91af;">Resolution</span>(300);
            <span style="color:green;">//create TiffSettings object</span>
            <span style="color:#2b91af;">TiffSettings</span> tiffSettings = <span style="color:blue;">new</span> <span style="color:#2b91af;">TiffSettings</span>();
            tiffSettings.Compression = <span style="color:#2b91af;">CompressionType</span>.CCITT4;
            <span style="color:blue;">if</span>(tiffSettings.Shape == <span style="color:#2b91af;">ShapeType</span>.Landscape)
            tiffSettings.Shape = <span style="color:#2b91af;">ShapeType</span>.Portait;
            tiffSettings.SkipBlankPages = <span style="color:blue;">false</span>;
            tiffSettings.Brightness = .40f;

            <span style="color:#2b91af;">Stream</span> output = <span style="color:blue;">null</span>;
            sourceImages = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Image</span>[pdfDocument.Pages.Count];
            <span style="color:green;">//create TIFF device</span>
            <span style="color:#2b91af;">TiffDevice</span> tiffDevice = <span style="color:blue;">new</span> <span style="color:#2b91af;">TiffDevice</span>(resolution, tiffSettings);
            <span style="color:blue;">for</span> (<span style="color:blue;">int</span> page = 1; page <= pdfDocument.Pages.Count; page++)

                output = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>();

                tiffDevice.Process(pdfDocument, page, page, output);
                sourceImages[page - 1] = System.Drawing.<span style="color:#2b91af;">Image</span>.FromStream(output);
                sourceImages[page - 1].Save(<span style="color:#2b91af;">Path</span>.Combine(OutputFolder, <span style="color:#2b91af;">String</span>.Concat(<span style="color:#2b91af;">Path</span>.GetFileNameWithoutExtension(FullInputFileName), page.ToString().PadLeft(3, <span style="color:#a31515;">'0'</span>), <span style="color:#a31515;">"."</span>, <span style="color:#a31515;">"tiff"</span>)));
                output = <span style="color:blue;">null</span>;


        <span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)
            sourceImages = <span style="color:blue;">null</span>;
            <span style="color:blue;">throw</span> <span style="color:blue;">new</span> <span style="color:#2b91af;">Exception</span>(<span style="color:#2b91af;">String</span>.Format(<span style="color:#a31515;">"Error in splitTiffPages: {0}"</span>, ex.Message));

        <span style="color:blue;">return</span> sourceImages;
    }</pre><br>Can you please help me<br>
Hi Anish,

Sorry for the inconvenience faced. After initial investigation, We've logged the issue as PDFNEWNET-35319 in our issue tracking system for further investigation. We will keep you updated about issue progress via this forum thread.

Best Regards,

So can i expect a resolution for this issue right ?


Hi Anish,

Thanks for your patience. I’m afraid the reported issue is still not resolved and pending for analysis in queue with other priority tasks. As soon as our development team completes the analysis then we will be in good position to share our findings/ETA. We will keep you updated about issue progress via this forum thread.

Sorry for the inconvenience faced.

Best Regards,

Hi Anish,

Thanks for your patience. After investigation, we have found that its not a bug. As the initial document contains very low quality and low resolution scanned grayscale image. So the 1-bit image conversion will have lower quality than initial. Moreover Adobe shows similar very low quality output.

Please feel free to contact us for any further assistance.

Best Regards,