Free Support Forum - aspose.com

PDF->Tiff Conversion 1bpp quality

Hello, I am using the block of code below to convert the attached Pdf to Tif, saved as 1bpp.
The resulting tif does not have solid black letters, maybe because the lettering in the PDF is colored and not solid black.
That makes it a little harder to read and inflates the filesize because due to swapping between black and white on every pixel.
See attached 'aspose.tif' for the first page conversion.
I'd like to output similar to the attached 'print.tif', is there a way to control the quality of 1bbp?
        public static void ConvertToTif(string pdfFilePath, string outputFilePath)
    {
        PDF.<span style="color: rgb(43, 145, 175);">PdfConverter</span> pdfConverter = <span style="color: blue;">new</span> PDF.<span style="color: rgb(43, 145, 175);">PdfConverter</span>();
        <span style="color: rgb(43, 145, 175);">Resolution</span> resolution = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">Resolution</span>(200);
        pdfConverter.Resolution = resolution;
        pdfConverter.BindPdf(pdfFilePath);
        pdfConverter.DoConvert();

        <span style="color: rgb(43, 145, 175);">TiffSettings</span> tiffSettings = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">TiffSettings</span>();
        tiffSettings.Depth = <span style="color: rgb(43, 145, 175);">ColorDepth</span>.Format1bpp;
        pdfConverter.SaveAsTIFF(outputFilePath, tiffSettings);
        pdfConverter.Close();
    }</pre><pre style="background: white; color: black; font-family: Consolas;"> </pre>

Hi Duncan,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the sample code and template file.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34386. Oue development team will further look into this issue and share their feedback.

Sorry for the inconvenience

Hi Duncan,


Thanks for your patience.

We have further investigated this issue and have found that the source/input PDF document contains bright text. So in order to make the output result more contrast, text solid and close to your expectations, you need to configure brightness. i.e. 0.7 brightness value allows to get expected result:

[C#]

PdfConverter pdfConverter = new PdfConverter();<o:p></o:p>

Resolution resolution = new Resolution(200);

pdfConverter.Resolution = resolution;

pdfConverter.BindPdf("c:/pdftest/whitepaper.pdf");

pdfConverter.DoConvert();

TiffSettings tiffSettings = new TiffSettings();

tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format1bpp;

tiffSettings.Brightness = 0.7f;

pdfConverter.SaveAsTIFF("c:/pdftest/whitepaper.tiff", tiffSettings);

pdfConverter.Close();

The issues you have found earlier (filed as PDFNEWNET-34386) have been fixed in Aspose.Pdf for .NET 7.6.0.


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