Comments (5)
Ok so I managed to get it working. (idk why tho)
So I started to look into the PR and the fork, I found this one: https://github.com/cedson61/fpdm
Which seems to work at first glance, but I got weird behavior after, and one of my checkboxes doesn't get recognize anymore. So I rolled back to this repo
So for whatever reason, I edited the PDF with Acrobat DC, I deleted the checkboxes, save the PDF, and I re-added them with the same names and save.
I made sure that I had nothing into the tooltip like said in the repo above:
Just make sure you don't have any alt text on your fields like so (or your checkboxes will come out blank)
I converted the PDF with pdftk like said in the readme of the repo pdftk old.pdf output new.pdf
And now it's working, the only thing that I noticed is that to have the checkbox correctly checked I needed to inverse the boolean
True
or "anything"
= checkbox unchecked
False
or ""
= checkbox checked
To solves this (idk how I managed to find that first try)
I changed the export Value in the checkbox properties to something else than "Yes"
, I put "Oui"
(french) and now True
= checked
I can't share this PDF, I will try to share a working one today.
I'm happy to see someone active on this repo, the odds that you had the same problem as me today are quite low
from fpdm.
I can't get them to work either. I have tried all sorts of combinations. Can you please provide a working code example so we can use that as a reference? It may be of note that my array has checkboxes, but also text areas that I need to populate and those are being passed along without issue.
from fpdm.
Same here. Doesn't matter what I use, the fields simply won't populate checkboxes. If the developer can give us the sample pdf and code they used to verify the checkbox function as working, I'm sure I could pull that apart to understand the proper syntax.
Can we get a little bit more info on the checkboxes, please?
from fpdm.
Well, I also have the same problem, but not exactly sure why, I have a PDF with forms and checkboxes, I can fill them using the library (I got it from someone in my company, but he is not here anymore), but once I edit the PDF through Adobe Acrobat DC or a online PDF editor, the checkbox cannot be filled anymore.
So I'm wondering if the PDF needs to be "encoded" in a specific format (or at least the format on checkbox is changing after editing) and that's why it's not working.
By enabling verbose mode in the library
$pdf->verbose = true;
$pdf->verbose_level = 3;
$pdf->useCheckboxParser = true;
With the old checkbox I got this output:
Change checkbox of the field chpb at line 9387 to value [Oui]
Change checkbox of the field chlu at line 9458 to value [Oui]
Change checkbox of the field chim at line 9426 to value [0]
Change checkbox of the field chgl at line 9490 to value [0]
And with the edited one through Adobe Acrobat DC and converted back with pdftk old.pdf output new.pdf
it's not recognizing the checkboxes anymore:
Change checkbox value aborted, the field chpb has no checkbox definition.
Change checkbox value aborted, the field chlu has no checkbox definition.
Change checkbox value aborted, the field chim has no checkbox definition.
Change checkbox value aborted, the field chgl has no checkbox definition.
So I'm guessing there is something wrong with the format of checkboxes
from fpdm.
Running pdftk will break the "checkbox definition" somehow. I have set tooltip and name correctly in Acrobat CC, turned off fast web view an compression, set it all the way down to Acrobat 5.0+ compatible, and on and on...
Right now, I can either format it in Acrobat and get a "field not found" error, or run pdftk on it, and get the dreaded "no checkbox definition" error. :p'''''''
The problem here is that this developer got checkboxes working, but didn't give anyone specs on the PDF. If they developer could simply post a working demo that we can download and pull apart, then the rest is not hard to figure out. But there seems to be some sort of specific setup to the document that must be in place for the "checkbox definition" to be present.
from fpdm.
Related Issues (20)
- FPDF-Merge Error: No more resource to execute the command
- PHP 7.4 Deprecated function : Array and string offset access syntax with curly braces is deprecated HOT 1
- PHP 7.4 Warning: implode(): Invalid arguments passed in \fpdm\fpdm->get_buffer()
- Don't replace fields containing parentheses
- Checkboxes in a parent group can not be addressed HOT 2
- a new version is released by fpdf.org
- Question, can we extracted list of fields(names) of the template pdf HOT 2
- radiobuttons (checkbox-groups) added HOT 1
- FPDF-Merge Error: Object streams are not supported HOT 2
- Link on textbox is not working
- php 8.1.5 from php 7.4 FPDF-Merge Error: field Speciality not found HOT 1
- uppgrading from php 7.4 to php 8.1.5. Fields contatining åäö FPDF-Merge Error: field Månader not found HOT 8
- Sign PDF with FPDM ?
- FilterFlateDecode: invalid stream data error HOT 1
- FPDM Output Not Saving File HOT 1
- FPDF-Merge Error: Number of objects (277) differs with number of xrefs (280), something , pdf xref table is corrupted :(
- Mapping fields in the template with the values in Array
- Compatibility with php 8.1 HOT 1
- New release of original script (v2.10) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpdm.