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

Free Support Forum - aspose.com

PDF and Word Create bitonal TIFF without loosing light colored features?

We receive wild-type TIFFs, PDFs, and Word documents submitted by users, then convert these to 200 dpi bitonal TIFF for storage.



But it appears that the image rendering uses a simple threshold to map color into B&W so we lose light colored artifacts.



Is there any way to get Aspose.Imaging, Aspose.PDF and Aspose.Word to render an image with shaded effects, so we don’t loose artifacts to pure white and pure black?



The attached Word doc and Tif doc demonstrate the issue.

Hi Matthew,


Thanks for contacting support.

Can you please share the input PDF file which can help us in testing the scenario related to PDF to TIFF conversion. Meanwhile we are testing the scenarios related to Aspose.Words and Aspose.Imaging.

We are sorry for your inconvenience.

I have added a sample PDF also.

I have discovered that setting
options.TiffBinarizationMethod = ImageBinarizationMethod.FloydSteinbergDithering;

work to create a readable TIFF for a Word Document.

However when converting a PDF to TIFF, if I set the output to 1bpp I get an output that is all noise, no image.

Since we are licensed for Aspose.Total, I have found two solutions for my issue.

  1. Save the PDF as a Word document, and then save the Word document as a Tiff using TiffCompression=Ccitt4, and TiffBinarizationMethod = FloydSteinbergDithering

mcrose:
I have added a sample PDF also.
Hi Matthew,

Thanks for sharing the PDF document.

I have tested the PDF to TIFF conversion using latest release of Aspose.Pdf for .NET 11.5.0 where I have used following code snippet and as per my observations, the TIFF image contains green and blue colors, as available in input PDF document.

However when using default options, the colors are preserved in resultant TIFF but resultant file size is increased and when using values from CompressionType enumeration, the colors of resultant TIFF are lost but file size is significantly reduced.

[C#]

// Open document<o:p></o:p>

Document pdfDocument = new Document("c:/pdftest/OnePageColor.pdf");

// Create Resolution object

Resolution resolution = new Resolution(300);

// Create TiffSettings object

TiffSettings tiffSettings = new TiffSettings();

tiffSettings.Compression = CompressionType.None;

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

// Create TIFF device

TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);

// Convert a particular page and save the image to stream

tiffDevice.Process(pdfDocument,
“c:/pdftest/OnePageColor_output.tif”);

Using the most recent version, the following code satisfied my requirements.

No further information needed.

Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(fName);

Resolution resolution = new Resolution(200);

// Create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Depth = ColorDepth.Format1bpp;
tiffSettings.SkipBlankPages = true;

        // Create TIFF device
        TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);

        tiffDevice.Process(pdfDoc, @"c:\output.tif");

Hi Matthew,


Thanks for the acknowledgement. We are glad to hear that your problem is resolved. Please continue using our API’s and in the event of any further query, please feel free to contact.