Question
· Dec 27, 2016

Annotating PDF files

I've been asked to annotate a PDF file (in Intersystems Cache).  That is, take in an existing PDF (printable form with areas for people to write in) and use Cache to update it (automatically fill the fields in).

Does Zen have the ability to set a starting/initial PDF?  I see the ability to define an XML format to write in, but that's not exactly what I need, because that will generate my "answers".

I'd like to overlay my "answers" on top of an original PDF.  Do you know how to do that?

 

 

Addendum:
After many hours of research, I came across the FOP.  I could try to set up a custom FOP to point to my 'template' (see possible syntax below).   That seems extremely awkward, but if this is the best offering that Zen has, I'd appreciate any insight/feedback on how to make this process easy.
<fo:external-graphic src="file:///tmp/pdf-image/overlay.pdf"/>

Discussion (1)0
Log in or sign up to continue

Hi Jonathan,

unfortunately there is no easy way to do this from within Caché. The PDF format is a rather complex binary format and Caché doesn't have a library to access it.  There are a couple of tools that allow the annotation of PDF documents, but none of them would allow you to easily integrate with the engine. 

PDF is in itself a rather complex format, so to directly edit it, say via opening it as %BinaryStream, would require you to implement your own PDF rendering engine. (Have a look at [this post](https://blog.idrsolutions.com/2013/01/understanding-the-pdf-file-format-...) to get a glimpse of the problems you'd be facing)

The solution to use a PDF as background for the rendering of a new report via FOP might be a way out. But you'd need to know the layout of the incoming PDF and be sure it doesn't change. Only then you could get the ZEN report to print into specific fields. 

-Fab