Fillable/printable .pdf software for Pi?

Is there a program that can fill, save and print PDF forms?

In poking around Buster the default .pdf viewer seems to be gpdfview and it doesn't seem to work well with fillable forms (won't display correctly and can't make changes). Xpdf doesn't allow changes and does not seem to recognize changes made on a Mac using Preview.

Chromium seems to recognize and display changes correctly but silently declines to save any change made. It does at least print correctly when a change is made and printed immediately.

I thought LibreOffice might do the trick, but not in any intuitive way that I could easily find.

Is there a better approach?

Thanks for reading,

bob prohaska

Reply to
bob prohaska
Loading thread data ...

It's not particularly easy, but there is. pdftk is what you need, which in Debian and Raspbian is now available in pdftk-java.

Short version, given A.pdf with the blank form in it:

pdftk A.pdf dump_data_fields_utf8 >FD.fdf

Edit FD.fdf with a text editor

pdftk A.pdf fill_form FD.fdf output B.pdf

and B.pdf will contain the filled form.

Note that you may need several iterations as you work out what to put where in form_data.fdf.

Longer instructions going into crunchy details:

formatting link

Reply to
Roger Bell_West

Yikes! That's ugly 8-)

Makes word processing with MacPencil look good!

Thanks for reading and the speedy, if disheartening, reply!

bob prohaska

Reply to
bob prohaska

It does have the advantage that if you have to fill in a form repeatedly you can manipulate the FDF in other software to do so automatically.

But PDF forms seem to be a bit of a nightmare in general.

R
Reply to
Roger Bell_West

I was able to edit a PDF document with it just now. I'm currently running LibreOffice version 6.3.4.2.0 - this is the latest version for Fedora 31.

It was pretty straight forward. I opened a PDF document I happened to have lying around with LibreOffice Writer and edited it just like any other Writer document. Then I exported it as a PDF document. xpdf opened it without any complaints and showed my test edit where I expected to see it.

The only surprise was that when I saved the edited document by clicking 'Save', it was written to disk with an odg extension rather than the odt I expected.

What did you do that was different to the above? Do you have an earlier version of OfficeLibre?

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Not much, far as I can tell. The test document was a 2019 IRS form 1040. The cursor tended to be in the form of a hand. Clicking in one of the text boxes selected the grab handles for the formatting boxes most of the time. I did manage to put text in the "first name middle initial box", but the font was way too big and I couldn't repeat the feat in any of the other key entry boxes I tried.

It was _very_ eager to let me tinker with the existing text and formatting, which of course I didn't want.

It's 6.1.5.2, latest apt-get knows about.

I ended up using Google Chrome on an old Mac. That least let me fill the forms and print them.

Thanks for replying,

bob prohaska

Reply to
bob prohaska

I _believe_ that, while you can indeed add text to a document that way, it does not constitute "filling in the PDF form fields". So that's fine if you're just going to print it, but if someone else is expecting to parse it with software it's unlikely to work.

Reply to
Roger Bell_West

I have to say what I usually do is to use Gimp to save the pdf as a series of 300dpi images, import them into Scribus and then fill them in and spit then out as emal-able PDFS...

Horrid bodge but better than printing filling and scanning.

--
"In our post-modern world, climate science is not powerful because it is  
true: it is true because it is powerful." 

Lucas Bergkamp
Reply to
The Natural Philosopher

Thats useful to know. The PDF file I experimented on was just plain text.

For Bob: this is probably worth raising as either an enhancement request or a bug report to the Office Libre gang. Having form filling on PDF files work properly, or even just documented in Office Libre help text, would be useful for a lot of people.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

You can create PDF forms from LibreOffice, but it doesn't seem to obey the rules when editing them:

formatting link

I suspect any PDF form wouldn't survive a roundtrip through LO cleanly enough to be machine readable by the originaing software.

Theo

Reply to
Theo

I'm using Buster Mate (Debian on the PC, not Raspbian at the moment) and the default PDF viewer is Atril (the Mate fork of Gnome Evince). With that I can edit PDF forms and save and print them. I believe Raspbian Buster has evince ...

The only slight oddity is that when I open a form and fill it in I can't "Save" it (over the original file), I can only "Save as" it (to a new file). I suppose this is a safeguard to prevent people from overwriting their blank PDF form the first time they try filling it in!

.. or did you mean filling in the form programmatically, rather than interactively? I can't help, there.

--
Cheers, 
 Daniel.
Reply to
Daniel James

I was going to suggest evince. Caveat: I sent someone an evince-filled form, and their Acrobat wouldn't open it for them. So...I did a print-to-PDF and sent that, and they could open it. They didn't really need a form PDF at that point. But I don't know if that is still a problem, or if it was some stupidity I committed on my end.

--
Consulting Minister for Consultants, DNRC 
I can please only one person per day. Today is not your day. Tomorrow 
isn't looking good, either. 
I am BOFH. Resistance is futile. Your network will be assimilated.
Reply to
I R A Darth Aggie

Re: Re: Fillable/printable .pdf software for Pi? By: bob prohaska to Martin Gregorie on Wed Mar 11 2020 00:56:10

bp> Admittedly I didn't look at help under LibreOffice Writer to bp> see if there was some special trick to filling out PDFs. Given bp> the popularity of fillable PDFs I hoped there'd be something bp> straightforward.

my understanding is that PDFs with fillable forms in them are meant to be filled when using a PDF viewer... i don't see how libreoffice comes into play, with that aspect... i would think it would be your PDF viewer that would be in question...

)\/(ark

Reply to
mark lewis

Admittedly I didn't look at help under LibreOffice Writer to see if there was some special trick to filling out PDFs. Given the popularity of fillable PDFs I hoped there'd be something straightforward.

If you've got any hints how to raise the issue with LibreOffice please share them. I can't even find a bug reporting link.

Thanks for reading!

bob prohaska

Reply to
bob prohaska

There seem to be problems with evince similar to some of the other programs I've tried: xpdf, preview (on a mac): The page opens, but the filled fields display nothing until focused on. When focus moves the entry becomes invisible. Checkboxes don't see to react at all. Some fields don't accept focus. Somewhat to my surprise, after opening evince, I tried clicking on document viewer in the applications menu. Immediately the still-open evince window came to the foreground. Is "document viewer" really evince?

Thanks for reading,

bob prohaska

Reply to
bob prohaska

I've never looked there. Since its a bog-standard part of the Fedora Distro, if I was going to raise a bug against it I'd do so through the Fedora Bugzilla system.

Raspbian probably has a similar setup but, since I've never found anything that needed a bug report, I've not yet worked how to file a bug there, so obviously I don't use Raspbian hard enough!

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Re: Re: Fillable/printable .pdf software for Pi? By: Martin Gregorie to mark lewis on Wed Mar 11 2020 16:20:13

ml>> my understanding is that PDFs with fillable forms in them are meant to ml>> be filled when using a PDF viewer... i don't see how libreoffice comes ml>> into play,

MG> Apparently the US tax people are expecting people to do this.

they're certainly not the only ones... i've had quite many form PDFs over the years since it was introduced... only one time did i actually fill out the form in the PDF... all others i print the PDF and manually fill the fields and then send that back... we can blame adobe acrobat for this ugliness...

FWIW: i don't see this form filling in a PDF as "editing the pdf"... i mean, you're only filling in some fields but i don't know how/where this data is stored in the PDF when it is sent back...

)\/(ark

Reply to
mark lewis

In the course of following this thread and installing the suggested packages a new entry appeared in the "accessories" menu.

It has the same icon as xpdf, but identifies itself as qpdfview 0.4.17.99 and appears able to edit fields and save changes.

Unfortunately it does not seem able to display them uniformly. All filled field display when one is selected. If an uneditable field is selected the filled fields become invisible.

It does seem worthwhile to report this as a bug, but where?

Thanks for reading,

bob prohaska

Reply to
bob prohaska

This website:

formatting link
looks as good as any.

The bugs page shows a good selection of bugs being worked on. If I was reporting it I'd certainly point out any problems it has with tax returns: that should certainly get the developer's attention.

I've added qpdfview to my list of programs I might need some day. Thanks for spotting it. Its a Fedora standard package, so I've just installed it here (version 0.4.18).

My initial impression is good, but unfortunately I haven't got any PDF files with data entry boxes to play with, though I do have problems in that area at present: my current version of LibreOffice Writer can't handle tick boxes in a M$ Word .docx format document. Grrr.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Just been tidying up my internal reference pages: added a PDF viewer and editor page which currently just mentions qpdfview and xpdf.

Anyway, about XPDF: I always thought it was simply the viewer, but on visiting its project page for the first time, I discovered a whole raft of useful command-line programs are associated with it. They do stuff like converting a PDF doc to another format and extracting images and text from them. Not stuff you'd do every day, but handy to know about when you need them.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.