Completing PDF forms and adding your signature without having to print the form

A recent post in the Gentoo Forums made me interested to find out what is actually achievable with fillable PDF forms in Gentoo Linux and Windows 10 without being required to purchase a software licence, be it for personal or professional use, in order to be able to complete PDF forms (including forms that have automatically-updating bar codes).

Designing PDF Forms

It is possible to create PDF forms with LibreOffice, although LibreOffice cannot create a form containing bar codes that get updated automatically with the information entered in fields on the form. In order to create PDF forms that contain automatically-updating bar codes it is necessary to purchase Adobe Acrobat DC or Adobe LiveCycle Designer, which are Windows-only applications. As forms usually have several fields, 2D bar code symbologies are used in order to be able to encode the amount of data in a practical way. See the Adobe demonstration video Capture electronic data from printed forms.

Using PDF Forms

However, the enquiry in the above-mentioned forum thread was not about designing PDF forms, it was about being able to complete existing PDF forms (including forms that have automatically-updating bar codes, and including being able to add a written signature to the form without printing it out):

Hi,

I need to sign pdfs, and sometimes fill out pdf forms which also need to be signed. At the moment I get them, print them, sign them and scan them back in to return to the sender. I’d like to simplify that.

I know that on Windows and Mac OS your adobe software can sign the pdf, but I don’t even know how that works exactly.

It would be really neat if there were an app which could handle all that.

Oh yeah, another thing. Some forms (all?) when you fill them out and print them have a bar of machine-readable gobbledygook on the page which lets the recipient of a printed pdf scan the data back in with 100% accuracy. That would be neat too.

Thanks.

Although I have sometimes added my signature to a PDF form before printing it out — more on that later — I had never come across PDF forms with automatically-updating bar codes, so my curiosity was piqued. I decided to investigate if free applications could be used to complete PDF forms (including those with automatically-updating bar codes) and add a written signature. My investigations were carried out in Linux and Windows 10, and my findings are given below. In summary, I discovered that I could do all these things in Linux as well as in Windows 10, although in Linux I had to resort to running a Windows application under WINE if a PDF form contained automatically-updating bar codes. I did not bother trying the GNOME document viewer Evince, as I could find no evidence on the Web of it having the capability of updating bar codes automatically, and I use KDE.

For my tests I used the following four PDF forms I found on the Web:

  1. acrobat8_barcodedforms.pdf, an October 2006 PDF article from Adobe containing three sample form fields and an associated automatically-updating bar code (PDF417 symbology).
  2. barcode_field.pdf, a February 2013 sample PDF form with three fields and three associated bar codes of different symbologies (PDF417, Data Matrix and QR Code).
  3. PdfFormExample.pdf, a June 2013 sample PDF form created using LibreOffice (and therefore not containing automatically-updating bar codes).
  4. sample_barcoded_demo.pdf, a December 2005 sample PDF form from Adobe with an automatically-updating bar code (PDF417 symbology).

1. Windows 10

1.1 Acrobat Reader DC

This is the ubiquitous ‘free’ closed-source application you can download from Adobe.

Below are screenshots of the four sample PDF forms opened in Acrobat Reader DC…

1.1.1 I could enter text in the three fields in acrobat8_barcodedforms.pdf, and the bar code was updated accordingly:

Acrobat Reader DC - acrobat8_barcodedforms.pdf

Acrobat Reader DC - acrobat8_barcodedforms.pdf

I used my smartphone’s Barcode Scanner app to read the bar code on the hard-copy form printed by Acrobat Reader DC:

Text1Text2Text3I am able to change the text in these fields of this form to see how 2D barcodes work.

1.1.2 I could enter text in the three fields in barcode_field.pdf, but the three bar codes were not visible:

Acrobat Reader DC - acrobat8_barcodedforms.pdf

Acrobat Reader DC - barcode_field.pdf

1.1.3 I could enter text in the fields in PdfFormExample.pdf:

Acrobat Reader DC - PdfFormExample.pdf

Acrobat Reader DC - PdfFormExample.pdf

1.1.4 I could enter text in all fields of sample_barcoded_demo.pdf and the field contents were echoed in the box ‘Barcode Contents’ but the bar code itself was not visible:

Acrobat Reader DC - sample_barcoded_demo.pdf

Acrobat Reader DC - sample_barcoded_demo.pdf

So, in summary, Acrobat Reader DC is not a viable option if you have to deal with forms that include automatically-updating bar codes.

1.2 PDF-XChange Editor

This application from Canadian company Tracker Software Products supersedes their deprecated PDF-XChange Viewer and has additional features. Neither application is open-source, though. Some features only work fully if you purchase a software licence and enter the licence key. For example, if you add a signature to a PDF form (‘Document’ > ‘Signatures and Initials’) and then save it, DEMO stamps are added to the new PDF file (which still has editable fields). However, if you print the PDF form (either to a PDF file or to paper) then DEMO stamps are not added (but the new PDF file is not fillable/editable). Click on the two links below to view the sample PDF file PdfFormExample.pdf signed and saved to a new PDF file, and the sample PDF file PdfFormExample.pdf signed and printed to a new PDF file:

PdfFormExample_with_signature_added_then_Saved.pdf

PdfFormExample_with_signature_added_then_Printed_to_PDF.pdf

If you save them to disk and open them in PDF-XChange Editor, you will see the distinction.

As stated on the company’s Web site, the free application can be used for private and work purposes:

The FREE download of the PDF-XChange Editor may be used without limitation for Private, Commercial, Government and all uses, provided it is not: incorporated or distributed for profit/commercial gain with other software or media distribution of any type – without first gaining permission.

Below are screenshots of the four sample PDF forms opened in PDF-XChange Editor…

1.2.1 I could enter text in the three fields in acrobat8_barcodedforms.pdf, and the bar code was updated accordingly:

PDF-XChange Editor - acrobat8_barcodedforms.pdf

PDF-XChange Editor - acrobat8_barcodedforms.pdf

I used my smartphone’s Barcode Scanner app to read the bar code on the hard-copy form printed by PDF-XChange Editor:

Text1Text2Text3
I am able to change the text in these fields of this formto see how 2D barcodes work.

Notice that the layout of the encoded text is slightly different to the bar code generated by Adobe Acrobat Reader DC.

1.2.2 I could enter text in the three fields in barcode_field.pdf, and the three bar codes were visible:

PDF-XChange Editor - barcode_field.pdf

PDF-XChange Editor - barcode_field.pdf

I used my smartphone’s Barcode Scanner app to read the three bar codes on the hard-copy form printed by PDF-XChange Editor:

The PDF417 bar code was read as follows:

text_0:PDF417 barcode:I can enter text in these fields of this form and can see the three barcodes to the right of these fields in PDF-XChange Editor.

The Data Matrix bar code was read as follows:

text_1:Data Matrix barcode:
To change the barcode field to the right, type in this box. The barcode field to the right will reflect the contents of the text field as barcode after the text field lost the focus. To reset the contents of all barcode fields, cick the ‘Rset’ button.

Notice that the words ‘click’ and ‘Reset’ in the field were apparently not encoded correctly.

The QR Code bar code was read as a meaningless apparently random bunch of characters.

The PDF file and the three bar codes were generated on the fly by PHP code calling the pdflib library produced by the company PDFlib GmbH. I do not know how accurate this particular PDF file is, or how accurate is the Bar Code Scanner app on my smartphone.

1.2.3 I could enter text in the fields in PdfFormExample.pdf:

PDF-XChange Editor - PdfFormExample.pdf

PDF-XChange Editor - PdfFormExample.pdf

1.2.4 I could enter text in all fields of sample_barcoded_demo.pdf, and the field contents were echoed in the box ‘Barcode Contents’ and the bar code itself was visible:

PDF-XChange Editor - sample_barcoded_demo.pdf

PDF-XChange Editor - sample_barcoded_demo.pdf

I used my smartphone’s Barcode Scanner app to read the PDF417 bar code on the hard-copy form printed by PDF-XChange Editor:

Brian
S
Fitzgerald
Calle Fitzcarrald, 225
Iquitos

bsf@iquitos.nom.pe

So, in summary, PDF-XChange Editor appears to be a possible option in Windows 10, whether or not you have to deal with forms that include automatically-updating bar codes. I am quite impressed with the application.

2. Linux

2.1 Acrobat Reader 9

This is the free closed-source Linux application you can install via the Portage package manager (the package is app-text/acroread).

Below are screenshots of the four sample PDF forms opened in Acrobat Reader 9 for Linux.

2.1.1 I could enter text in the three fields in acrobat8_barcodedforms.pdf, and the bar code was updated accordingly:

Acrobat Reader 9 Linux - acrobat8_barcodedforms.pdf

Acrobat Reader 9 Linux - acrobat8_barcodedforms.pdf

I used my smartphone’s Barcode Scanner app to read the bar code on the hard-copy form printed by Acrobat Reader 9 for Linux:

Text1Text2Text3I am able to change the text in these fields of this form to see how 2D barcodes work.

2.1.2 I could enter text in the three fields in barcode_field.pdf, but the three bar codes were not visible:

Acrobat Reader 9 Linux - barcode_field.pdf

Acrobat Reader 9 Linux - barcode_field.pdf

2.1.3 I could enter text in the fields in PdfFormExample.pdf:

Acrobat Reader 9 Linux - PdfFormExample.pdf

Acrobat Reader 9 Linux - PdfFormExample.pdf

2.1.4 I could enter text in all fields of sample_barcoded_demo.pdf, and the field contents were echoed in the box ‘Barcode Contents’ but the bar code itself was not visible:

Acrobat Reader 9 Linux - sample_barcoded_demo.pdf

Acrobat Reader 9 Linux - sample_barcoded_demo.pdf

So, in summary, Acrobat Reader 9 for Linux is not a viable option if you have to deal with forms that include automatically-updating bar codes.

2.2 Okular

This is the well-known KDE document viewer application.

Below are screenshots of the four sample PDF forms opened in Okular.

2.2.1 I could enter text in the three fields in acrobat8_barcodedforms.pdf but the bar code was not visible:

Okular - acrobat8_barcodedforms.pdf

Okular - acrobat8_barcodedforms.pdf

2.2.2 I could enter text in the three fields in barcode_field.pdf but the three bar codes were not visible:

Okular - barcode_field.pdf

Okular - barcode_field.pdf

2.2.3 I could enter text in the fields in PdfFormExample.pdf:

Okular - PdfFormExample.pdf

Okular - PdfFormExample.pdf

2.2.4 I could enter text in all fields of sample_barcoded_demo.pdf but the field contents were not echoed in the box ‘Barcode Contents’ and the bar code itself was not visible:

Okular - sample_barcoded_demo.pdf

Okular - sample_barcoded_demo.pdf

So, in summary, Okular is not a viable option if you have to deal with forms that include automatically-updating bar codes. In fact, Okular was the worst of the bunch.

2.3 PDF-XChange Editor

To install this Windows application under WINE in Linux:

$ export WINEPREFIX=$HOME/.wine-pdfxve6
$ export WINEARCH="win32"
$ winecfg # Select Windows 10.
$ cd .wine-pdfxve6/drive_c/
$ # Copy downloaded installer to C: drive:
$ cp ~/Downloads/PDFXVE6.zip .
$ unzip PDFXVE6.zip
$ # Install PDF-XChange Editor:
$ wine PDFXVE6.exe

  • Click ‘Install’.
  • Click ‘Next’.
  • Select ‘I accept the terms in the License Agreement’ and click ‘Next’.
  • Click ‘Custom’.
  • Click ‘Browsers Plugins’ and select ‘Don’t install’. Click ‘Next’.
  • Leave ‘Create a Start Menu folder’ ticked. Untick ‘Create Desktop Icons.’ Untick ‘Set PDF-XChange Editor as default application for PDF files’. Untick ‘Set Printer “PDF-XChange Lite V6” As Default’. Click ‘Next’.
  • Select ‘Free Version’ and click ‘Next’.
  • Click ‘Install’.
  • Untick ‘Launch PDF-XChange Editor’ and click ‘Finish’.
  • Click ‘Close’.

KDE Plasma 5 then has an entry for PDF-XChange Editor in the Application Launcher under ‘Applications’ > ‘Wine’ > ‘Programs’ > ‘Tracker Software’. Alternatively, to launch PDF-XChange Editor from the command line, you should enter:

$ WINEPREFIX="$HOME/.wine-pdfxve6" && WINEARCH="win32" && wine $WINEPREFIX/drive_c/Program\ Files/Tracker\ Software/PDF\ Editor/PDFXEdit.exe

If you also want the Windows application running under WINE to be able to access PDF files on a NAS, i.e. to be able to open Samba shares, see my previous post How to enable a Windows application in WINE to access a Samba share on a NAS.

I will not bother showing screenshots of the four sample PDF files open in PDF-XChange Editor running under WINE in Linux, as the application’s behaviour is the same as in Windows (see the screenshots in sections 1.2.1 to 1.2.4 above). So, in summary, PDF-XChange Editor appears to be a viable option in Linux (albeit running under WINE), irrespective of whether or not you have to deal with forms that include automatically-updating bar codes.

3. Adding a signature to a soft copy of the PDF form

I am referring to a person’s written signature here, not to a digital signature. Rather than having to print the completed form on paper in order to sign it with a pen, then scan the fully-completed form in order to send it via e-mail, fax or whatever, many people wish to add their signature directly to the PDF form without having to print it. Below I explain the method I use to do this in both Linux and Windows.

3.1 Create a PNG file with your signature (one-time operation)

  1. Get a blank white piece of paper.
  2. Sign your name on the page.
  3. Scan the page with your scanner and save the image as a PNG file.
  4. Open the image with GIMP.
  5. Crop the image around the signature.
  6. Select ‘Layer’ > ‘Transparency’ > ‘Add Alpha Channel’.
  7. Select the Fuzzy Select Tool from the toolbox.
  8. Click on each white area and press the Delete key. Do this for the area around the signature and inside any loops. Obviously don’t click on the signature itself.
  9. Select ‘File’ > ‘Export’.
  10. Save the image as a PNG file.

3.2 Signing PDF documents

  1. Launch LibreOffice Draw and open the PDF file you wish to sign.
  2. Select ‘Insert’ > ‘Image…’ and select the PNG file of your signature. The image will be inserted.
  3. To move the signature around on the page, hover the mouse cursor over the image until the cursor changes to a red dot with four arrowheads, then click-and-hold to grab the image drag it.
  4. To reduce the size of the signature, hover the mouse cursor over the image until the cursor changes to a red dot with four arrowheads, then click and release. You will then see small blue ‘handles’ on the outline of the image. Hover the mouse cursor over a handle at one of the four corners of the image until the cursor changes to a Resize cursor. Click-and-hold and move the cursor to increase or decrease the size of the signature whilst maintaining the ratio of width to height.
  5. To save the completed and signed PDF form, select ‘File’ > ‘Export as PDF…’, click on ‘Export’ and give the file a name of your choice.

The new PDF file will contain all the information visible on the previous PDF file plus your written signature. However, unlike the original PDF file, you will not be able to modify any of the data. Therefore I recommend you retain a copy of the original PDF file before you added the signature, in case you wish to change any of field entries in future.

Note that the free PDF-XChange Editor can be used instead of LibreOffice Draw providing the PDF form is not secured or restricted, and providing you print it to a new PDF file using a virtual PDF printer driver. If the PDF form is secured or changes restricted, then use LibreOffice Draw as described above.

If you are using a PDF viewer that refuses to save your completed form as a PDF file after you have entered data in the fields (notice the message in the purple bar in the screenshots of Acrobat Reader 9 for Linux, for example), print the page to a PDF file instead by using the virtual PDF printer (‘Microsoft Print to PDF’ in Windows; CUPS ‘Virtual PDF Printer’ in Linux) at a resolution of e.g. 600 dpi (if possible). You should then be able to open that PDF file in LibreOffice Draw or PDF-XChange Editor to add your signature as explained above and print the signed form to a new PDF file.

About Fitzcarraldo
A Linux user with an interest in all things technical.

One Response to Completing PDF forms and adding your signature without having to print the form

  1. foobar says:

    Thanks for sharing 🙂 Instead of fuzzy selecting the white areas around the written signature in gimp using ‘Color to alpha …’ in the Transparency submenu worked really well for me.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.