PDF to TIFF Conversion Issue – Black Background Content Not Visible

image.png (23.5 KB)
Environment:
Aspose.PDF Version: 21.6.0
Platform: .NET 3.0
Operating System: Windows / Linux
Conversion Type: PDF → TIFF (Color and B/W)

Issue Description:
We are experiencing a critical issue when converting PDF documents to TIFF format using Aspose.PDF 21.6.0.

During the conversion process, all pages that contain a black background display the content incorrectly in the final TIFF output:

  1. Color TIFF Output Problem
  • The TIFF is generated successfully, but the content in the black background area becomes extremely faint or distorted.

  • Text is barely readable or appears washed out.

  • The output does not match the original PDF appearance.

  1. Black & White (B/W) TIFF Output Problem
  • When using B/W conversion, the affected page becomes completely black.

  • All text, shapes, and content inside the black background area disappear.

  • Only a solid black rectangle is visible in the final TIFF.

A screenshot of the problematic converted TIFF output is attached.

Expected Behavior:

  • The TIFF output should preserve the visual appearance of the PDF accurately.

  • Text over black or dark backgrounds should remain readable.

  • B/W conversion should still show the actual text instead of turning the entire area into solid black.

Actual Behavior:

  • Color TIFF: Content on black background becomes difficult to read.

  • B/W TIFF: Black background areas convert into a fully black box, losing all content.

  • This issue makes the converted TIFF unusable for document processing.

Sample Code Used (Representative):

            var resolution = new Resolution(300);
            var tiffSettings = new TiffSettings
            {
                Depth = blackAndWhite ? ColorDepth.Format1bpp : ColorDepth.Format8bpp,
                Shape = ShapeType.None,
                SkipBlankPages = false
            };

            if (blackAndWhite)
            {
                tiffSettings.Compression = CompressionType.CCITT4;
                tiffSettings.Brightness = 0.5f;
            }
            else
            {
                tiffSettings.Compression = CompressionType.LZW;
            }

            var tiffDevice = new TiffDevice(resolution, tiffSettings);

            if (multiPageTiff)
            {
                // Combine all pages into one TIFF
                tiffDevice.Process(document, outputFilePath);
            }
            else
            {
                // Create a separate TIFF for each page
                string dir = Path.GetDirectoryName(outputFilePath)!;
                string baseName = Path.GetFileNameWithoutExtension(outputFilePath);

                for (int pageIndex = 1; pageIndex <= document.Pages.Count; pageIndex++)
                {
                    string singlePagePath = Path.Combine(dir, $"{baseName}_page{pageIndex}.tiff");
                    tiffDevice.Process(document, pageIndex, pageIndex, singlePagePath);
                }
            }

Even with ColorDepth.Default or other settings (e.g., ColorDepth.Format8bpp , Format1bpp ), the issue persists.

Troubleshooting Already Attempted

  • Tested with multiple PDFs containing dark backgrounds.
  • Tried various ColorDepth options.
  • Used different compression modes (LZW, CCITT, None).
  • Tried reducing and increasing DPI.
  • Tested the same code on both Windows and Linux environments. But, Linux environment only got this issue.
  • Verified that the issue does not appear when converting the same PDF using other tools.

Despite all testing, the output is still incorrect.

@mukeshkanna

The behavior you’re seeing is not expected for the PDF → TIFF conversion APIs.
To investigate it as a potential defect we need a reproducible sample.

Please provide the following:

  1. Exact Aspose.PDF for .NET version you are using (e.g., 21.6.0 build xxxx).
  2. Full runtime details – .NET Core/.NET Framework version, OS (Windows 10/Server 2019, Linux distro and version, any container image).
  3. A minimal PDF file that contains a black background page and reproduces the faint/black output (attach the PDF).
  4. The exact code you run (the snippet you posted is sufficient, just include the using statements and the document loading line).
  5. Any console or log output – enable Aspose logging (Aspose.Pdf.Logging.Logger.EnableLogging = true;) and attach the generated log file.

In the meantime you can try the following quick checks:

  • Upgrade to the latest Aspose.PDF for .NET (the current release includes several rendering fixes for dark‑background pages).
  • On Linux, ensure the required native libraries for image rendering are present (e.g., libgdiplus for .NET Core). Missing libraries can affect color handling.
  • Set tiffSettings.Brightness to a higher value (e.g., 0.8f) for B/W conversion as a temporary workaround, though this does not address the root cause.

Once we have the sample PDF and environment details we can reproduce the issue and, if confirmed, log it for a fix.