Losing field values when converting Pdf Form to image


#1

Hi,

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 ?

Regards,


#2

@ThomasNk

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.

We are sorry for the inconvenience.


#3

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 :

/Type /Annot
/T (nom_jeune_fille)
/Rect 145 0 R

endobj
152 0 obj 88.6395
endobj
153 0 obj 519.645
endobj
154 0 obj 547.139
endobj
155 0 obj 535.348
endobj
151 0 obj [152 0 R 153 0 R 154 0 R 155 0 R]
endobj
150 0 obj

When we open another working pdf (generated by Scribus PDF Library 1.4.1) with notepad, we can see this :

/Type /Annot
/T (nom)
/Rect [ 74.00000 519.14000 555.50000 533.89000 ]

To summarize, it seems that Aspose is not able to retrieve Rect values generated by itext-paulo-155.


#4

@ThomasNk

Thanks for sharing more details.

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.