tips:fdf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tips:fdf [2021/02/24 16:53] – created scipiotips:fdf [2021/02/26 19:28] (current) scipio
Line 1: Line 1:
 ====== FDF ====== ====== FDF ======
  
-Dato un modello pdf e un file in formato FDF con i dati si crea il documento pdf+Dato un modello pdf e un file in formato FDF viene creato il documento pdf utilizzando pdftk
  
 <file txt dati.fdf> <file txt dati.fdf>
Line 32: Line 32:
 </file> </file>
  
 +{{ :tips:modello.pdf }}
  
 <code> <code>
-{{ :tips:modello.pdf |pdftk modello.pdf fill_form dati.fdf output output.pdf}} +pdftk modello.pdf fill_form dati.fdf output output.pdf 
-</code>>+</code> 
 + 
 + 
 +Per aggiungere immagini come loghi o qrcode in determinate posizioni si può usare pdftk multistamp 
 + 
 + 
 +esempio 
 +<code bash> 
 +#!/bin/sh 
 + 
 +# valore del qr code 
 +QR1='PAGOPA|002|123456789012345678|12345678901|1234567801' 
 + 
 +# il modello non contiene i campi qr 
 +MODEL=modello.pdf 
 +FDF=dati.fdf 
 + 
 +# generiamo il pdf solo con i campi testo 
 +pdftk $MODEL fill_form $FDF output bg.pdf 
 + 
 +# generiamo il qr come immagine 
 +qrencode -s3 -o qrcode.png $QR1 
 + 
 +# generiamo una pagina trasparente A4 e posizionamo il qr nella posizione 200 da sinistra e 500 dal basso 
 +convert qrcode.png -transparent white -page a4+200+500 -quality 100 fg.pdf 
 + 
 +# uniamo background e foreground in final.pdf 
 +pdftk bg.pdf multistamp fg.pdf output final.pdf 
 +</code> 
 + 
  • tips/fdf.1614182038.txt.gz
  • Last modified: 2021/02/24 16:53
  • by scipio