Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Render Checkbox Stream |
Post Reply |
Author | |
Renaud
Beginner Joined: 12 Feb 20 Location: France Status: Offline Points: 8 |
Post Options
Thanks(0)
Posted: 12 Feb 20 at 6:08AM |
Hello Everyone,
First of all, thank you for this forum, It helped me many times. I'm using activex rev 1613 on windows 2012 R2 server. I face something I cannot explain. I draw some formfield into new pdf, then I render the page into a png. text field, or button or signature are shown but no checkbox just like if the fonction UpdateAppearanceStream had no effect on checkbox I followed the recommandations here : https://www.debenu.com/kb/appearance-streams-pdf-form-fields/ (where it is said that generation of appearance streams is (...) supported for (...), checkbox) and set SetNeedAppearances(0) then generate Appearance streams in a loop. but nothing helps. checkboxes are not shown until I set SetNeedAppearances(1) , open the pdf with acrobat, save it and renderpagetofile Any Idea is welcomed here below a sample code : <?php $qp = new COM('DebenuPDFLibrary64AX1613.PDFLibrary'); if ($qp->UnlockKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxx') != 1){ echo ('PDF License validation failed!'); die(); } $qp->SetOrigin(1); $qp->SetMeasurementUnits(0); $qp->SetNeedAppearances(0); //direct text to test renderoption(3,1) $qp->DrawText(20,20, "pipopipo"); //text box is ok $fftx_index= $qp->NewFormField("newtextfield", 1); $qp->SetFormFieldBounds($fftx_index, 20, 40 ,30, 15); $qp->SetFormFieldValue($fftx_index, "text1"); //checkbox is never shown using page render $ffcb_index= $qp->NewFormField("newcheckbox", 3); $qp->SetFormFieldPrintable($ffcb_index,1); $qp->SetFormFieldCheckStyle($ffcb_index, 2, 1); $qp->SetFormFieldBounds($ffcb_index, 20, 60 ,30, 15); $qp->SetFormFieldValue($ffcb_index, "Yes"); // with or without this block does not change anything $qp->AddStandardFont(0); $qp->SetFormFieldStandardFont($ffcb_index,0); $qp->SetFormFieldBorderColorGray($ffcb_index, 0.5); $qp->SetFormFieldBorderStyle($ffcb_index,2,0,0,0); $qp->SetFormFieldBackgroundColor($ffcb_index,1.0,0.0,0.0); $qp->SetFormFieldAlignment($ffcb_index, 1); $qp->SetFormFieldTextSize($ffcb_index, 24); $qp->SetFormFieldVisible($ffcb_index, 1); // end of with or without this block does not change anything $retour =''; for ($i = 1; $i <= $qp->FormFieldCount();$i++){ if (1== $qp->UpdateAppearanceStream($i)){ $retour .= ' ok'; } } print_r ($retour); $qp->SaveToFile('./testfile.pdf'); $qp->SetRenderOptions(1, 1); //$qp->SetRenderOptions(3, 1); //does not help, checkbox $retour = $qp->RenderPageToFile(72, 1, 5, './rendertest.PNG'); echo '<img src="./rendertest.PNG"/>'; ?> Edited by Renaud - 12 Feb 20 at 6:10AM |
|
Renaud
Beginner Joined: 12 Feb 20 Location: France Status: Offline Points: 8 |
Post Options
Thanks(0)
|
SOLVED
the parameter SetFormFieldCheckStyle, shall be the last one called. other wise other parameters are not taken in account. //create the form $ffcb_index= $qp->NewFormField("newcheckbox", 3); //asign all parameters $qp->SetFormFieldBounds($ffcb_index, 20, 60 ,30, 15); $qp->SetFormFieldValue($ffcb_index, "Yes"); $qp->SetFormFieldPrintable($ffcb_index,1); $qp->AddStandardFont(0); $qp->SetFormFieldStandardFont($ffcb_index,0); $qp->SetFormFieldBorderColorGray($ffcb_index, 0.5); $qp->SetFormFieldBorderStyle($ffcb_index,2,0,0,0); $qp->SetFormFieldBackgroundColor($ffcb_index,1.0,0.0,0.0); $qp->SetFormFieldAlignment($ffcb_index, 1); $qp->SetFormFieldTextSize($ffcb_index, 24); // AND LAST ONE SHALL BE STYLE $qp->SetFormFieldCheckStyle($ffcb_index, 1, 1); |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store