creating a pdf version of a complicated form, populated with data from a database

Karl Hammar karl at angelit.lcl.aspodata.se
Wed Apr 3 19:45:04 CEST 2024


Chris:
> I dream of using R, Rmarkdown, knittr, and pdflatex to pull individual
> records from a database and generate a form like page 1 here:
> 
> https://www.cigna.com/static/www-cigna-com/docs/form-cms1500.pdf

The first page of that is an image. You can extract it with:

 pdfimages -l 1 form-cms1500.pdf a

That will give you a file a-0000.ppm.

To make latex place things at some position, you could use
  \usepackage[absolute]{textpos}
...
  
  \begin{textblock*}{\bredd}(\vmarg,\oevre)
     some text
  \end{textblock*}

 You are using page size letter:
$ pdfinfo form-cms1500.pdf | grep "Page size"
Page size:      612 x 792 pts (letter) (rotated 0 degrees)

 So:
\usepackage[absolute]{textpos}
\usepackage{graphicx}

\includegraphics[...]{<filename>}}

and use textblock to place your text.

///

Or you could conv. the ppm to eps, make a ps file including that eps and 
then place your text with (after you have set up your font):
 moveto x y (text) show

Regards,
/Karl Hammar




More information about the texhax mailing list.