What is the best way in PHP to determine if a PDF is filled out correctly? The source PDF is a faxed form that contains handwritten data. Is an image comparison an option? If the form is filled out on a computer, I know I can use pdftotext to verify that the fields are completed or not. I just don't know how to verify handwritten data.
-
Filled out is perhaps possible, but filled out *correctly*? – Waleed Khan Jul 18 '12 at 19:05
1 Answers
For hand-written data an image comparison may definitely be an option. See for example the following answer for a basic idea how to start tackling this task:
However, the job may be much more difficult when faxed images come into play. (We all know how bad a quality you can get from faxes. Also, they frequently are skewed by a small degree. And they may be slightly scaled, compared to the original. Not to forget that their resolution is 204x196dpi, which adds a bit of a distortion. And lastly -- how do you get the faxed form back into PHP? This might involve another step of scanning in the paper, which again will not necessarily add quality to the result.
Still, ImageMagick may be able to handle all this: it can -deskew
images, it can reduce or completly remove -noise
, and it can -distort
, -scale
and -repage
images and much more...

- 1
- 1

- 86,724
- 23
- 248
- 345