AcroForm rendering quetion

324 views
Skip to first unread message

Shawn

unread,
Jan 25, 2018, 1:03:35 PM1/25/18
to pdfium
Hi,
I use FPDF_RenderPage(dc, page, ...) to print PDF document. It works fine until I met the attached document and the filled out information is not printed. 
 From the metadata, it seems this document including AcroForm. I am wondering how to get this worked. Also try to enable v8 and XFA and the 
result is the same. 

After some investigation, I found the filled out information is there if the PDF is converted to an image. It looks like there are two steps rendering, one for 
page and one for form:
FPDFBitmap_FillRect(bitmap, ...);
FPDF_FFLDraw(formHandle, ...);

Also try to printing the same document with Chrome and the filled out information on the first page is missing, but other pages seems OK. I am not sure it is a 
bug of PDFium?

All in all, I am wondering how to enable form rendering for FPDF_RenderPage()? Thanks!

Shawn


form.pdf

Shawn

unread,
Jan 25, 2018, 5:02:40 PM1/25/18
to pdfium
Here are list of functions when printing:
doc = FPDF_LoadMemDocument();
form = FPDFDOC_InitFormFillEnvironment();
FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD);
FPDF_SetFormFieldHighlightAlpha(form, 100);
FORM_DoDocumentJSAction(form);
FORM_DoDocumentOpenAction(form);
page = FPDF_LoadPage(doc);
FORM_OnAfterLoadPage(page);
FORM_DoPageAAction(page);
FPDFPage_Flatten(page, FLAT_PRINT);
FPDF_RenderPage(dc,page);
Reply all
Reply to author
Forward
0 new messages