Comments (12)
OK, I fixed this in a fork https://github.com/TristanHammat-AgilisIT/fpdm/. Not going to bother with a pull request as it has been about 1.5 years since once has been actioned. There are a couple of other changes and me tripping over my own commits here https://github.com/TristanHammat-AgilisIT/fpdm/commits/master. I will add some additional fixes if I get time.
If you test it out and have any issues, let me know. it should now update /AS, /V and /DV but only the ones that are already present in the PDF.
from fpdm.
Done
#42
It's my first pull request, I hope I made no mistakes.
from fpdm.
I can confirm this fixes the display error for acrobat. Thx @fabboyrie
from fpdm.
thanks!
from fpdm.
Can you submit a pull request?
from fpdm.
This doesn't update /V or /DV if present but rather it just adds new ones following /AS each time /AS is updated. If you run this multiple times on the same PDF you will get a buildup of detritus that would look something like this:
/V /Off
/AS /Off
/DV /Off
/V /Off
/DV /Yes
/V /Yes
/DV /Off
/V /Off
This will cause file bloat for anyone who uses fpdm repeatedly on the same file.
A better way might be to record the line numbers for /DV and /V to the "infos" array at the same place as it does for /AS and then only update them if they were already in the PDF file.
from fpdm.
Thanks! Fix verified on latest Adobe Acrobat Pro DC as well as FireFox.
from fpdm.
Thanks! Fix verified on latest Adobe Acrobat Pro DC as well as FireFox.
That is great to hear. As you may have seen, I ended up fixing a couple of other errors in that fork that could stop checkboxes from displaying at all or displaying the wrong state. Also fixed some deprecated PHP usage and have been using it successfully in a project ever since.
from fpdm.
I'm using Tristan's fork.. Has anyone run into an issue where some checkboxes will check and some won't? Definitely using the correct names and everything. Just specific checkboxes won't check even though I can manually check them.
from fpdm.
@TristanHammat-AgilisIT since this repo does not get updated very much how about putting your fork to its own repo and also sharing it via composer? It is a little bit of a mess otherwise to use your work in real projects.
Also can anyone confirm problems that @keithslater had?
from fpdm.
Hi @tertek, that is an interesting point. I will consider doing that when I have a free moment.
As for the problems @keithslater is experiencing, I am not sure what could be causing them as it could be a host of things. fpdm is not exactly bug-free, robust, up-to-date or full-featured. I believe there are also different types of PDF forms and this code only supports the simple old original ones. Here is my process for creating a form to fill out using fpdm:
- Use the free online pdfescape.com to add all the form fields to the PDF and give them unique names. We also lock all of the form fields so that users don't accidentally change the content. fpdm just ignores the locked status of fields and fills them out regardless when filling the form.
- Sometimes PDF files will have features not supported by fpdm so next, we convert the pdf files to a guaranteed editable format using free version of the pdftk (pdflabs.com) command-line tools for windows. No special arguments are required as we simply read in the PDF and write it out to a new file. Any features unsupported by fpdm should be lost from the PDF in this process.
pdftk form.pdf output form-fixed.pdf
This is the process that we used to make all of the PDF forms for our production project. We have about 20 different PDFs with form fields and we fill them out with different data ~400 times per quarter during an automated bulk mailout. The only issue we have hit with this process is that IOS and Android PDF viewers don't seem to recognise ticked checkboxes on the PDFs, however, all tested desktop viewers render the checkboxes correctly so I haven't bothered to work out why the mobile device PDF viewers can't do the same.
from fpdm.
I ended up switching to php-pdftk which worked out great
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
- Checkboxes not checked correctly. HOT 5
- 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.