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:
- 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.
- 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
ColorDepthoptions. - 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.