We are converting source images and documents to PDF for archiving purposes. It is important that all information is stored in its original shape and form. I use Aspose.Total Version 22.2.0.0, runtime version v4.0.30319…
Input image:
image.jpg (177.7 KB)
Note: Grey = CCCCCC (RGB)
Output image:
image.jpg (184.6 KB)
Note: Grey = D6D6D6 (RGB)
All colors seem to be a bit “Lighter” after conversion to PDF. Now this image was part of an Excel document, but other types of conversion to PDF show the same behaviour (from JPG, from Word, etc).
Code:
// Open the Excel file
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(inputPath);
// create explicit SaveOptions
Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();
pdfSaveOptions.OnePagePerSheet = true;
// Save the pdf file.
string outputFile = Path.GetFileNameWithoutExtension(inputPath) + “_out.pdf”;
string outputPath = System.IO.Path.Combine(_outDir, outputFile);
wb.Save(outputPath, pdfSaveOptions);
How can we prevent colors from changing?