Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

🔥A command line tool to generate PDF and text files from csv data and Freemarker templates.🔥

Notifications You must be signed in to change notification settings

redking00/csv2pdf

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Go to file

Folders and files

Last commit message Last commit date

Latest commit

History

View all files

Repository files navigation

csv2pdf

🔥A command line tool to generate PDF (using Flyingsaucer) or text files from csv data and Freemarker templates🔥

How it works?

+--------------+ +--------------+ | CSV data | | FTL template | +--------------+ +--------------+ | | | | v v +--------------+ +--------------+ +--------------+ +--------------+ | CsvJDBC |---------->| Freemarker |----/--->| JSoup |--------->| FlyingSaucer | +--------------+ +--------------+ +--------------+ +--------------+ | | / | | | v v +--------------+ +--------------+ | TXT file | | PDF file | +--------------+ +--------------+

Build:

mvn clean package

Usage:

java -jar csv2pdf.jar

Options:

-csv_charset CSV file charset (optional, default 'UTF-8')
-csv_extension CSV file extesion (optional, default '')
-csv_file CSV input file (optional, use instead -csv_query)
-csv_folder CSV folder path (optional, default '.')
-csv_query CSV query command (optional, use instead -csv_file)
-csv_separator CSV separator character (optional, default ';')
-for_eachGenerate one file per data record (optional, see notes below)
-ftl_encoding FTL input file encoding (optional, default 'UTF-8')
-ftl_file FTL input file
-pdf PDF output file (optional, use instead -txt)
-dpi PDF output file dpi (optional, default 96)
-txt TXT output file (optional, use instead -pdf)
-txt_charset TXT output file charset (optional, default 'UTF-8')

NOTES:

Example 1:

java -jar csv2pdf.jar -csv_file data.csv -ftl_file template.ftl -pdf output.pdf

Example 2:

java -jar csv2pdf.jar -csv_file data.csv -ftl_file template2.ftl -for_each -pdf 'output_$.pdf'