How to flatten PDF forms to avoid compatibility errors
Has it ever happened to you that you fill out a PDF form and when you sended to someone else, that person has received an empty form? I will teach you one way to fix these errors by using
pdftk is a great PDF tool (see Encrypting PDFs) and one thing it can do is extracting text from a form and re-add it as a plain text (removing the form inputs).
Script below takes two arguments: the input and output file. It will create a temporary file (inside working directory) with the form info. You can delete the file after the process if you want. After extracting the form inputs, it will fill out the PDF again but it will “flatten” it, i.e. it will convert the form inputs to plain text.
#!/bin/bash # ./flat-forms INPUT=$1 OUTPUT=$2 TEMPFILE=`basename -s .pdf $INPUT`.fdf pdftk $INPUT generate_fdf output $TEMPFILE pdftk $INPUT fill_form $TEMPFILE output $OUTPUT flatten
./flat-forms input.pdf output.pdf
In this new series, we are going to explore useful penetration testing utilities from Kali Linux. The main tool (or set of tools) any pen-tester or ethical hacker should know is Metasploit Framework.
Quickemu is a great QEMU-based program to create and run optimised Linux, Windows and macOS virtual machines.
Learn how to install Virtual Machine Manager on your Arch device following a few simple steps.
Jitsi Meet is an open-source video conferencing platform you can install on your server.
A comprehensive list of Linux-related websites sorted by categories.