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

Free Support Forum - aspose.com

Aspose.Pdf.Kit.PdfConverter inverting black and white when saving as tif

Hello, I’m using Aspose.Pdf.Kit.PdfConverter for .NET version 2011.01.26 to save a PDF as a tif image. For a particular document , black and white on the generated tif are being inverted. Is this a known issue? If required I can send you the document. Thanks.

Hi James,

First off, please make sure that you’re using the latest version at your end. If you still find the same problem then please share the input PDF file along with your code snippet and the problem details. We’ll further investigate this issue at our end and update you accordingly.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,

Hi,


I have tested with the latest Aspose.PDF.Kit and the issue persists. Here is the code I am using:

string inputFile = @“Original.pdf”;
string outputFile = @“Converted.tif”;

Aspose.Pdf.Kit.License lic1 = new Aspose.Pdf.Kit.License();
lic1.SetLicense(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\Aspose.Total.lic");

Aspose.Pdf.Kit.PdfConverter extractor = new Aspose.Pdf.Kit.PdfConverter();
extractor.BindPdf(inputFile);
extractor.StartPage = 1;
extractor.SaveAsTIFF(outputFile);
extractor.Close();

I will send you the documents privately. Note the inverted black/white on the logo above “creative Technologies Worldwide”. Thank you.

Hi James,

I have reproduced this issue at my end using the sample file you shared and logged it as PDFKITNET-24745 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience. If you have any further questions, please do let us know.
Regards,

Hi

I have the same issue with version 8.1.
Is it resolved ?
Thanks.

Hi Tellier,


Thanks for contacting support.

Please note that in recent release versions, we have made many improvements regarding PDF to Image conversion however if you are facing some problem during the conversion, the problem might be related to the structure and complexity of the source PDF file. Can you please share the source PDF causing the problem so that we can test the scenario at our end. We are really sorry for this inconvenience.

Hello

It’s very simple to replicate the problem.
You take a photo in jpg in grayscale.
You put the image in a pdf using Aspose.
First problem : the image appear negative on pdf.
And now you take a negatif grayscale jpg and you put on a pdf.
The pdf appear good.
But when you convert the pdf to image or extract image from pdf, on output the image appear negative.
So my conclusion is that in the pdf Aspose processing, grayscales images is bad process.

Thanks.

Hi Tellier,


I have tried replicating the issue using one of my sample Images present over my system and I am unable to reproduce the problem. Can you please share some sample resource files so that we can again try replicating the issue at our end. We are sorry for this inconvenience.

I have tested the scenario using Aspose.Pdf for .NET 8.3.0.

Hi

Problem is the same with 8.3.1 version.

I have send you a sample file.

Document document = new Document(@“C:\tmp\Example.pdf”);
PdfConverter converter = new PdfConverter();
converter.BindPdf(document);
converter.Resolution = new Resolution(96);
converter.DoConvert();
MemoryStream image = new MemoryStream();
if (converter.HasNextImage())
converter.GetNextImage(image);
image.Seek(0, SeekOrigin.Begin);
converter.Close();
using (Stream file = File.OpenWrite(@“C:\tmp\Example.jpg”))
{
byte[] buffer = new byte[8 * 1024];
int len;
while ( (len = image.Read(buffer, 0, buffer.Length)) > 0)
file.Write(buffer, 0, len);
}

Result is that Example.jpg shows the two pictures at right with negative colors.

Thanks.

Hi Tellier,


Thanks
for sharing the resource file.<o:p></o:p>

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-35737. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.