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.
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
<?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"/>';
?>