Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/fpdm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,7 @@ function parsePDFEntries(&$lines){
$ap_d_yes='';
$ap_d_no='';
$ap_line=0;
$ap_n_line=0;
$ap_d_line=0;
$as='';
//ENDFIX
Expand Down Expand Up @@ -1715,6 +1716,7 @@ function parsePDFEntries(&$lines){
$ap_d_yes='';
$ap_d_no='';
$ap_line=0;
$ap_n_line=0;
$ap_d_line=0;
$as='';
//ENDFIX
Expand Down Expand Up @@ -1845,25 +1847,31 @@ function parsePDFEntries(&$lines){
//preg_match("/^\/Type\s+\/(\w+)$/",$CurLine,$match)
$match=array();
//FIX: parse checkbox definition
//see page 498: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pdf_reference_archives/PDFReference.pdf
if($this->useCheckboxParser && ('' == $ap_d_yes || '' == $ap_d_no || '' == $as)) {
if (!$ap_line && '/AP' == substr($CurLine, 0, 3)) {
if ($verbose_parsing) {
echo("<br>Found AP Line '<i>$Counter</i>'");
}
$ap_line = $Counter;
} elseif (!$ap_n_line && '/N' == substr($CurLine, 0, 2)) {
if ($verbose_parsing) {
echo("<br>Found N Line '<i>$Counter</i>'");
}
$ap_n_line = $Counter;
} elseif (!$ap_d_line && '/D' == substr($CurLine, 0, 2)) {
if ($verbose_parsing) {
echo("<br>Found D Line '<i>$Counter</i>'");
}
$ap_d_line = $Counter;
} elseif (($ap_line==$Counter-4)&&($ap_d_line==$Counter-2)&&($ap_d_yes=='')&&$this->extract_pdf_definition_value("name", $CurLine, $match)) {
$ap_d_yes=$match[1];
} elseif(($ap_n_line == $Counter-2 || $ap_d_line == $Counter-2) && $ap_d_yes == '' && $this->extract_pdf_definition_value("name", $CurLine, $match)) {
$ap_d_yes = $match[1];
if ($verbose_parsing) {
echo("<br>Object's checkbox_yes is '<i>$ap_d_yes</i>'");
}
$object["infos"]["checkbox_yes"]=$ap_d_yes;
} elseif (($ap_line==$Counter-5)&&($ap_d_line==$Counter-3)&&($ap_d_no=='')&&$this->extract_pdf_definition_value("name", $CurLine, $match)) {
$ap_d_no=$match[1];
} elseif(($ap_n_line == $Counter-3 || $ap_d_line == $Counter-3) && $ap_d_no == '' && $this->extract_pdf_definition_value("name", $CurLine, $match)) {
$ap_d_no = $match[1];
if ($verbose_parsing) {
echo("<br>Object's checkbox_no is '<i>$ap_d_no</i>'");
}
Expand Down