After the greyscale pdf pages are getting blacked out

Hi Team
I am trying to print a pdf document using Aspose.pdf but i am getting black pages with white text black pages with white text in the printed sheet. Can you check this as a priority as we are facing issue in the production

@Lingesh_M

It sounds like you’re experiencing an issue where the PDF pages are printing as black with white text, which can be quite frustrating. This problem can arise due to several factors, including printer settings, PDF rendering issues, or specific content in the PDF.

Cause: The issue may stem from incorrect printer settings, outdated software, or the nature of the PDF content itself.

Solution: Here are some steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Printer Settings: Ensure that the printer is set to print in grayscale or black and white mode. Incorrect settings can lead to unexpected results.

  2. Update Aspose.PDF Library: Make sure you are using the latest version of the Aspose.PDF library. Updates often include bug fixes and improvements that could resolve your issue.

  3. Test with Different PDF Files: Try printing a different PDF document to see if the issue persists. This can help determine if the problem is with the specific PDF or the printing process itself.

  4. Review PDF Content: If the PDF contains complex graphics or images, consider simplifying the content or converting it to a different format before printing.

  5. Print to PDF First: As a workaround, try printing the PDF to another PDF file first and then print that new file. This can sometimes resolve rendering issues.

Next Steps: If these steps do not resolve the issue, please provide more details about your environment, such as your printer model, operating system, and Aspose.PDF version. This information will help us assist you further.

Thank you for your patience, and I look forward to helping you resolve this issue!

Before the printing the pdf itself after converting into the greyscale and some its corrupting the entire pdf.
Currently we are using v24.9.0 and v24.2.0

@Lingesh_M
Could you provide source document and code you are using to recreate the issue you facing?

These are the code snippet used for the greyscale conversion

using (Aspose.Pdf.Document document = new Aspose.Pdf.Document(item.FullName))
{
Aspose.Pdf.RgbToDeviceGrayConversionStrategy strategy = new Aspose.Pdf.RgbToDeviceGrayConversionStrategy();
for (int idxPage = 1; idxPage <= document.Pages.Count; idxPage++)
{
// Get instance of particular page inside PDF
Page page = document.Pages[idxPage];
// Convert the RGB colorspace image to GrayScale colorspace
//strategy.Convert(page);
try
{
//if (page.ColorType == ColorType.Grayscale || page.ColorType == ColorType.Rgb || page.ColorType == ColorType.BlackAndWhite)
//{
// Convert the RGB colorspace image to GrayScale colorspace
strategy.Convert(page);
//}

    }
    catch (Exception ex)
    {
        WriteErrorLogError("ConverttoGrayscalePDF Exception - " + " - " + ex);
        continue;
    }
}
// Save resultant file
document.Save(ConvertedImagePath);
document.Dispose();

}

@Lingesh_M
Could you also provide document that you passed to new Aspose.Pdf.Document(item.FullName))?

Hi ilyazhuykov,

We cannot provide the document because its confidential is there any other options to stimulate it.

@Lingesh_M
You can try to upgrade version to check if issue was solved on later versions.
I tried to reproduce issue but it seems to be more document specific
Test_document_out.pdf (2.0 MB)
and it seems that there’s no similar open issues that have same problem, so i can’t point this one as related

Is it possible to clear confidential information from document with some not meaningful values and provide it in such way?

Hi ilyazhuykov

We had already faced the same issue i have shared the ticket reference below

@Lingesh_M
Thank you for context
I tried documents that were mentioned in the topic but unfortunately it seems that none of them reproduces the issue you facing
Tasks that were created by support have already been closed so I suppose the problem was partially fixed but some document specific issues remain.

Without any means to reproduce I can only suggest to check it on latest version (currently 25.8)

I can add task to investigate for development team but since there’s no option to reproduce issue or check it state at the moment the task most likely won’t be resolved in any nearest future - therefore, it’s not recommended to add such tasks for developers.
In case you are concerned about document accessibility on Forum , only the author and moderators have access to attached files and document won’t become available to forum.