PDF converted with blank fields

PDF converted with blank fields, i’m using Aspose.PDF 19.9.0.0 Version. When trying to converting to TIFF image, blank image with just outline is displaying without any data.
Converted Image.png (49.6 KB)

@seshuncv

Cause

The issue of converting a PDF to a TIFF image and receiving a blank image with just outlines can occur due to several reasons, including the structure of the PDF or the configuration of the conversion settings. This often happens if the PDF contains form fields or other elements that are not rendered correctly during the conversion process.

Solution

To resolve this issue, follow these steps:

  1. Check PDF Content: Ensure that the PDF contains visible content and is not limited to form fields or annotations that might not render as expected.

  2. Update Aspose.PDF Version: Since you are using version 19.9.0.0, upgrade to a newer version of Aspose.PDF. Numerous improvements and bug fixes in later versions may resolve your issue.

  3. Adjust Conversion Settings: Modify the settings used during the conversion process. For example, set the rendering options to ensure that hidden areas are shown and adjust the resolution.

Code Example

Here’s a sample code snippet to convert a PDF to TIFF with adjusted settings:

using Aspose.Pdf;
using Aspose.Pdf.Devices;

Document pdfDocument = new Document("input.pdf");
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.LZW; // Set compression type
tiffSettings.Depth = ColorDepth.Default; // Set color depth

// Create a TiffDevice with the specified settings
TiffDevice tiffDevice = new TiffDevice(tiffSettings);
tiffDevice.Process(pdfDocument, "output.tiff");

Next Steps

  1. Test the above code with your PDF file.
  2. If the issue persists, check the content of the PDF to ensure it is not empty or improperly formatted.
  3. If the problem continues, reach out to Aspose support with the specific PDF file for further assistance.

Please let me know if this resolves your issue!

Thanks for you inputs,
We have tried the steps suggested but still see the same issue. Right now we are unable to upgrade to latest aspose pdf version, if you could suggest some other alternative code fixes will help us.

@seshuncv

Please try using Document.Flatten() method before converting PDF document into images and in case issue still persists, please share your sample PDF document with us so that we can test the scenario in our environment with the latest version of the API and address it accordingly.

Thank you for your input.
Yes, we had already tried using the Document.Flatten() method before converting the PDF document, but unfortunately, it did not resolve the issue.

We’re sharing a sample PDF file that contains a table. When we attempt to convert it to a TIFF image, the result is a blank image showing only the outline, without any of the actual data.
RVC W2.pdf (22.0 KB)

@seshuncv

Please check below code snippet that we have used in our environment with 25.6 version of the API:

Document pdfDocument = new Document(dataDir + "RVC W2.pdf");
pdfDocument.Flatten();
/// Create Resolution object
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);

/// Create TiffSettings object
Aspose.Pdf.Devices.TiffSettings tiffSettings = new Aspose.Pdf.Devices.TiffSettings
{
    Depth = Aspose.Pdf.Devices.ColorDepth.Default,
    SkipBlankPages = true
};

tiffSettings.Compression = Aspose.Pdf.Devices.CompressionType.LZW;

/// Create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
tiffDevice.Process(pdfDocument, dataDir + "RVC W2.tif");

RVC W2.zip (2.1 MB)

Please note that we did not notice any issues in the generated output TIFF which is also attached for your kind reference. Looks like the issue is due to the older version of the API. Can you please make sure that you are using the latest version of the API? In case issue still persists, please let us know.