Web based Adobe PDF Forms replacement

tridev

Well-Known Member
Joined
Mar 11, 2012
Messages
197
#1
I need to generate web based electronic populated completed pdf documents with a fixed format and design.

The form is this:
cci02222018_orig.jpg
I need to populate it with data that was captured via HTML elements or populate it directly in the form (like the SARS Adobe Forms but not with Flash)

Any suggestions? Product or web programming based solutions

What tech are the other companies using? I only know of the Adobe Flash forms that home affairs and SARS make use of.
 

John_Phoenix

Well-Known Member
Joined
Jul 8, 2017
Messages
339
#2
For populating it from web forms...

Cheeky? Do it in canvas, in their browser.

Sane? python PIL

Insane? Bash & Imagemagick <- I would try this, cause I'm loco like that.

Populating it using Adobe forms? Meh, you just need someone that can produce a fillable pdf for you.
 

tridev

Well-Known Member
Joined
Mar 11, 2012
Messages
197
#6
That seems to be more sending,sharing and signing. I want a user to capture certain fields.

PSPDFKit is a PDF framework that supports all major platforms (iOS, Android, Windows) including Web and WebAssembly.
https://pspdfkit.com/pdf-sdk/web/

Here's a PDF form example:
https://web-examples.pspdfkit.com/form?i=01D8RP6CC594KQDJ9K4QPKQAWF.mjK3GjGy9JBChbTxEqGHZA.Bzl9
That looks pretty cool. I would have to investigate as I have fixed government forms I need to populate with text in the correct spot. I am not sure that solution allows you to add your own buttons e.g. a save button and a submit as final button that I can catch in my workflow code.
 

tridev

Well-Known Member
Joined
Mar 11, 2012
Messages
197
#7
For populating it from web forms...

Cheeky? Do it in canvas, in their browser.

Sane? python PIL

Insane? Bash & Imagemagick <- I would try this, cause I'm loco like that.

Populating it using Adobe forms? Meh, you just need someone that can produce a fillable pdf for you.
Final deliverable is the government fixed format form that printed out will look just like the original. I can't be canvas or some image generator as it has to match exactly the original pdf form except with completed data of course.

Thinking about it the best solution would be to capture it in html elements and store it. That allows me full control over validation, skip logic etc. Then just overlay the stored data over a pdf form with placeholders in each field. I just need to find the right tech to do that.
 

tridev

Well-Known Member
Joined
Mar 11, 2012
Messages
197
#8
I have used Apache PDFBox and iText in the past to do this
Thanks. iText looks to do what I want on the generation side but I can't find the licensing cost on their website if I want to use it for commercial purposes.
 
Joined
Aug 5, 2015
Messages
1
#9
Final deliverable is the government fixed format form that printed out will look just like the original. I can't be canvas or some image generator as it has to match exactly the original pdf form except with completed data of course.

Thinking about it the best solution would be to capture it in html elements and store it. That allows me full control over validation, skip logic etc. Then just overlay the stored data over a pdf form with placeholders in each field. I just need to find the right tech to do that.
The file descriptor and hash (dublin core) will change the second you touch the file with anything
so there is no way to keep the file "exactly" the same.

If you mean with respect to fonts and layout, with all these options, they would for the most
for the most part look identical.

You only really have 2 options (in practice)

1. Raster based manipulation... Something that writes pixels to an existing bitmap and saves it as a PDF.
2. Vector based manipulation... Something that changes the value of a pre-existing field into what you want.

Pitfalls for both would be font selection and string length.(Long string line wrapping etc.)

How would I solve this? Think of it as a pipeline.

data + process = final

Data, as JSON or Dict
-> Processor linked to a master (blank) document(Probably a svg... so vector)
-> Vector or Raster actions to manipulate a in-memory copy of the master template.
-> Dump and name output into the correct place with the correct extension (pdf in your case).

Maybe give this a bash?
https://github.com/pmaupin/pdfrw/#examples

BTW, which language are you doing this in... I'm assuming Python / PHP!? due to your
interest in having a webform...
 

[)roi(]

Executive Member
Joined
Apr 15, 2005
Messages
5,898
#10
That looks pretty cool. I would have to investigate as I have fixed government forms I need to populate with text in the correct spot. I am not sure that solution allows you to add your own buttons e.g. a save button and a submit as final button that I can catch in my workflow
You should have no problem doing that; it's a very flexible framework and the team behind it are very responsive.
 

Johnatan56

Honorary Master
Joined
Aug 23, 2013
Messages
23,933
#11
Final deliverable is the government fixed format form that printed out will look just like the original. I can't be canvas or some image generator as it has to match exactly the original pdf form except with completed data of course.

Thinking about it the best solution would be to capture it in html elements and store it. That allows me full control over validation, skip logic etc. Then just overlay the stored data over a pdf form with placeholders in each field. I just need to find the right tech to do that.
Why exactly wasn't this your first thought rather than forcing a pdf? Mobile responsiveness for users, you can re-order fields, not force users to fill in ones you already know, etc.

Chrome Headless if you have the server resources to convert html to pdf after, so build final form in html. Easy for dev to later change it if needed. If you're saving it, you probably also want to keep it in a table, no need to have a pdf copy that you can't search through/use and it adds more storage space requirements. Another advantage is if that form changes, you can always generate a "newer standard" of the pdf without the user having to refill everything.
If not, client side: https://github.com/MrRio/jsPDF have them render it if they want it. :p
 

tridev

Well-Known Member
Joined
Mar 11, 2012
Messages
197
#12
Why exactly wasn't this your first thought rather than forcing a pdf? Mobile responsiveness for users, you can re-order fields, not force users to fill in ones you already know, etc.

Chrome Headless if you have the server resources to convert html to pdf after, so build final form in html. Easy for dev to later change it if needed. If you're saving it, you probably also want to keep it in a table, no need to have a pdf copy that you can't search through/use and it adds more storage space requirements. Another advantage is if that form changes, you can always generate a "newer standard" of the pdf without the user having to refill everything.
If not, client side: https://github.com/MrRio/jsPDF have them render it if they want it. :p
Yip HTML5 for the capturing makes sense in a mobile world.

I guess I was lazy and wanted a all in one solution like Adobe Forms.


I prefer to stay away from html to pdf. I have done it in the past but so many different screen,browser and printer setups caused me too much pain.
Seeing the forms can vary in future I don't want to code creating the whole thing in code each time I get a new form so I think a template with placeholders would be best. I just have to find a product that supports prebuilt pdf templates and placeholders.
 
Last edited:

tridev

Well-Known Member
Joined
Mar 11, 2012
Messages
197
#13
Googling I find there are hundreds of pdf generators and converters out there. Let me ask my question differently.

If you were the SARS IT head, what solution stack to capture tax returns would you use to replace the existing Adobe Flash based system?
Your requirement is that the end user can output a printout of his ITA34 pdf that looks exactly like it does currently.

BTW. I don't work for SARS
 

_kabal_

Expert Member
Joined
Oct 24, 2005
Messages
2,666
#14
Thanks. iText looks to do what I want on the generation side but I can't find the licensing cost on their website if I want to use it for commercial purposes.
Code:
        <dependency>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>2.1.7</version>
        </dependency>
That is the version I used because it was still open source, but it fit my purposes
 

John_Phoenix

Well-Known Member
Joined
Jul 8, 2017
Messages
339
#15
The current SARS IT Head?


Would use "cryons"... And possibly cadre supplied R35 per sheet mondi rotatrim A4s.

For the rest of us, there is java, python and pdf.

PS. Supplying a functional solution to SARS would result in a singularity. You would pay more tax and they would have less incentives to do actual work.

Is it really worth it!
 
Last edited:
Joined
Apr 2, 2015
Messages
12
#16
Best thing to do is a create a web based form, capture your data then 'merge' it into the pdf generation process. You can create the pdf template in html and pass it to the generator.
 

RandomGeek

Well-Known Member
Joined
May 14, 2015
Messages
317
#17
The current SARS IT Head?


Would use "cryons"... And possibly cadre supplied R35 per sheet mondi rotatrim A4s.

For the rest of us, there is java, python and pdf.

PS. Supplying a functional solution to SARS would result in a singularity. You would pay more tax and they would have less incentives to do actual work.

Is it really worth it!
Lolz
 
Top