Create a PDF document from HTML output, a header and a footer
$100-500 USD
Paid on delivery
A program is needed to create a PDF file from the following inputs:
1) A set of sections
1. Most sections are HTML files (Text with formatting, potentially images inline (not implemented yet))
2. There is a special section type that is a page break
2) Cover page header (header to be used for page 1 only) ??" text/simple html
3) Cover page footer (footer used for page 1 only) ??" text/simple html
4) Page header (header for pages 2+) ??" text/simple html
5) Page footer (footer for pages 2+) ??" text/simple html
The data is to be retrieved from a MySQL database.
The current site is implemented in PHP. This module can be implemented in either PHP or Java. It has to run on both Windows and Linux systems. It may only use free / open source libraries in generating the PDF. A couple of potential tools to use: HTMLDOC, JasperReports, Apache FOP (others okay ??" please confirm which one you’ll be using in the bid).
## Deliverables
A PDF file should be created from the following inputs:
1) A set of sections
1. Most sections are HTML files (Text with formatting, potentially images inline (not implemented yet))
2. There is a special section type that is a page break
2) Cover page header (header to be used for page 1 only) ??" text/simple html
3) Cover page footer (footer used for page 1 only) ??" text/simple html
4) Page header (header for pages 2+) ??" text/simple html
5) Page footer (footer for pages 2+) ??" text/simple html
The data is to be retrieved from a MySQL database.
The current site is implemented in PHP. This module can be implemented in either PHP or Java. It has to run on both Windows and Linux systems. It may only use free / open source libraries in generating the PDF. A couple of potential tools to use: HTMLDOC, JasperReports, Apache FOP (others okay ??" please confirm which one you’ll be using in the bid).
This is to be called from a PHP action in the symfony framework. It will be provided a report_id and a desired output file path (should be passed in as parameters). For non-PHP implementations, it can be called via a system call. For example, it could call ‘exec(“generatePDFReport 123 [url removed, login to view]?)’ will run the program you create, called generatePDFReport for report_id 123 and it will create file [url removed, login to view] as output.
To get the contents of the report, the queries you will need when plugging into the database (coming in with a report_id ??" passed in):
1) Get the list of section definitions and content in order:
“SELECT DISTINCT [url removed, login to view], [url removed, login to view] FROM report_section_definition def, report_section section, report report, report_definition_report_section_definition rs WHERE [url removed, login to view] = ? AND report.report_definition_id = rs.report_definition_id AND rs.report_section_definition_id = [url removed, login to view] AND section.report_section_definition_id = rs.report_section_definition_id AND section.report_id = [url removed, login to view] ORDER BY rs.display_order?? binding the ? to 123
This will provide the following values (in display order ??" the sections should flow one after another in the PDF document):
* type ??" 0 for HTML section, 1 for page break
* content ??" the HTML to use for the section content (text with formatting / style information; may have local image references that need to be included)
2) Get the page headers and footers:
“SELECT [url removed, login to view], [url removed, login to view] FROM report_header header, report report WHERE [url removed, login to view] = ? AND report.report_definition_id = header.report_definition_id AND report.tenant_id = report_header.tenant_id??
This will provide the following values:
type-
* 1 = Header for every page
* 2 = Header for first page only
* 3 = Header for pages 2+
* 11 = Footer for every page
* 12 = Footer for first page only
* 13 = Footer for pages 2+
content ??" the HTML to use for the footer/header (pure text with formatting / style information)
Project ID: #3293569