I’m facing an issue when converting some forms PDF to image (Png or Jpeg).
The used PDF (provided in attachment) is a form with several fields.
As we can see at opening the pdf, the fields are filled.
But, when converting to image, all the fields appears empty, with no value.
Here is the code that I use (with Aspose.Pdf v19.7.0.0) :
var pdfFilename = @“D:\Test\PdfForm.pdf”;
var pngFileName = pdfFilename.Replace(".pdf", “.png”);
using (var imageFileStream = new FileStream(pngFileName, FileMode.Create))
{
var pdfDocument = new Document(pdfFilename);
var resolution = new Resolution(300);
var pngDevice = new PngDevice(resolution);
pngDevice.Process(pdfDocument.Pages[1], imageFileStream);
imageFileStream.Close();
} PdfForm.pdf (265.9 KB)
Can you please figure out why the field values are not embeeded in the created image.
Otherwise, is there any way to detect the lack of field values ?
We were able to replicate the issue in our environment and logged it as PDFNET-46653 in our issue tracking system. We will further look into details of the issue and keep you posted with the status of its correction.
We are afraid that there is no such way to detect empty fields in an image. However, we will surely share additional updates with you as soon as we have some regarding ticket investigation. Please be patient and spare us little time.
To add some input on this subject, this issue seems to be related to the Rectangle property not being set properly. We’ve notice that it has [0,0,0,0] values at runtime.
When we open the faulty pdf (generated by itext-paulo-155) with notepad, we can see this :
We have logged provided details along with previously logged ticket and it would definitely be helpful during investigation. We will surely let you know in case we have some additional updates. Please spare us little time.
Do you have any news regarding this issue.
Can you confirm that Aspose.PDF is only able to deal with direct coordinates for /Rect?
Like this : /Rect [74.00000 519.14000 555.50000 533.89000]
And that it cannot deal with indirect references like :
/Rect 145 0 R
endobj
145 0 obj [224 0 R 225 0 R 226 0 R 227 0 R]
endobj
224 0 obj 74.00000
endobj
225 0 obj 519.14000
endobj
226 0 obj 555.50000
endobj
227 0 obj 533.89000
Regretfully the ticket is not yet resolved due to other pending high priority issues. Regarding your rectangle processing related query, we will be able to share our feedback once the logged ticket is investigated and resolved. We greatly appreciate your patience and cooperation in this matter. Please spare us some time. We will inform you as soon as logged ticket is resolved.
I’m facing the similar issue. From some reason, when I’m converting PDF to PNG some of the data from first page are lost (screenshot of original and converted in the attachment).
Can you please try using 23.6 version of the API and if issue still persists, please share your sample code and the sample file with us. We will test the scenario in our environment and address it accordingly.