Skip to content

selyamanis/csv-to-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csvToPdf

csvToPdf is a CSV data (spreadsheet file) to PDF extractor

Firstly, the csvToPdf program uses PHP to extract CSV data into HTML. Lastly, it uses the Dompdf library to convert HTML to PDF.

This program is made with a basic example for the case of an invoice, which can be adapted for any need to extract data from a spreadsheet file into a PDF file.

Requirements

  • PHP version 7.2 or higher
  • Dompdf Library
  • The same requirements of Dompdf version 0.8.2. See the README.md

Installation

Download the latest release of "csvToPdf" program.

Extract the ZIP file on your server. Such as a local server accessible at : http://localhost/.

Run the interface by opening the public folder, to access the Home page.

Usage

Submit the CSV file to extract on the Home page to generate PDF and then download it.

Before that, the CSV file must be customized.

The csvToPdf program uses each field named "nextFile" as a keyword to locate the data to extract into HTML for each PDF file to generate.

The keyword must be assigned at the first column to the field corresponding to the end of the data of each PDF file, then the program goes to the next file.

Rows can be added above the "nextFile" row as needed for the data to be extracted for each PDF file.

Notes

There is a test CSV file : dataType.csv, which can be used as a template. The data to be extracted must be assigned to the same fields in the same way as this file.

Here is an example of the output PDF which can be customized as needed by the HTML code in the main file csvToPdf.php.


Many thanks to the Dompdf team.


GitHub csvToPdf Repository

GitHub @selyamanis

selyamanisalim@gmail.com


About

csvToPdf extractor using PHP and Dompdf

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages