codeshell/fpdm

checkox no working

zigomario opened this issue · 3 comments

Hello,

after multiple test, i think that we have some trouble with checkbox.

1 . Checbox must be have "exported value" ( don't now wording exact ) set. ( see that with : https://www.pdfescape.com )

  1. After multi dump/verbose etc etc , i see that

`
if ($verbose_set) {
echo "
Change checkbox of the field $name at line $field_checkbox_line to value [$value]";
}
$state = $this->value_entries["$name"]["infos"]["checkbox_no"];

                    if ($value) {  
                        var_dump('change state plop : ' . $state);
                    }
                    $CurLine =$this->pdf_entries[$field_checkbox_line];
                    $OldLen=strlen($CurLine);
                    $CurLine = '/AS /'. $state;
                    $NewLen=strlen($CurLine);
                    $Shift=$NewLen-$OldLen;
                    $this->shift=$this->shift+$Shift;
                    //Saves
                    $this->pdf_entries[$field_checkbox_line]=$CurLine;

                    return $Shift;

`

when we dump var_dump($this->value_entries["$name"]["infos"]) and $this->pdf_entries ( script in and out )
we can see that value of checkox is not changed . Script change state ( $CurLine = '/AS /'. $state; ) but not the value .

So..my pdf checbox is never change.

now if u add :
$this->pdf_entries[$field_checkbox_line - 1]= '/V /' . $state; ( i change value )
It's working !!

But... maybe it's not good and cause trouble.. i don't know.
I

I have the same problem. But I tried yout patch and behaviour hasn't changed :-(.

I have the same problem. But I tried yout patch and behaviour hasn't changed :-(.

i have surrender this repo ... i use : https://github.com/mikehaertl/php-pdftk _ all work

This looks like a duplicate of #19