Free Support Forum - aspose.com

PDF to TIFF missing color


#1

I am using the sample example PDF to TIFF. Its always producing a black and white and removing all color.

I am using an evaluation copy. Is this the reason?

Document pdfDocument = new Document(“test.pdf”);

	// Create stream object to save the output image
	java.io.OutputStream imageStream = new java.io.FileOutputStream("C:\\Users\\a076040.ABC\\Desktop\\VM-Shared\\Converted_Image.tiff");
	
	// Create Resolution object
	//Resolution resolution = new Resolution(300);
	Resolution resolution = new Resolution(850,1100);
	
	// instantiate TiffSettings object
	TiffSettings tiffSettings = new TiffSettings();
	// set the compression of resultant TIFF image
	tiffSettings.setCompression(CompressionType.CCITT4);
	// set the color depth for resultant image
	tiffSettings.setDepth(ColorDepth.Default);
	// skip blank pages while rendering PDF to TIFF
	tiffSettings.setSkipBlankPages(true);
	
	
	// Create TiffDevice object with particular resolution
	TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
	// Convert a all pages of PDF file to TIFF format
	tiffDevice.process(pdfDocument, imageStream);
	
	// Close the stream
	imageStream.close();

#2

@PDFToTIFF2019

Thank you for contacting support.

We have noticed you to be using CompressionType.CCITT4 which generates Black and White TIFF images, so you may try using other compression options like CompressionType.None.

We hope this will be helpful. Please feel free to contact us if you need any further assistance.