interface views_data_export_pdf_renderer in Views Data Export PDF 7
Same name and namespace in other branches
- 7.2 src/views_data_export_pdf_renderer.inc \views_data_export_pdf_renderer
An interface for invoking WK HTML to PDF to render an HTML document to PDF.
Hierarchy
- interface \views_data_export_pdf_renderer
Expanded class hierarchy of views_data_export_pdf_renderer
All classes that implement views_data_export_pdf_renderer
File
- src/
views_data_export_pdf_renderer.inc, line 10 - Contains the interface for PDF rendering.
View source
interface views_data_export_pdf_renderer {
/**
* The MIME type for the final PDF.
*/
const MIME_TYPE_PDF = 'application/pdf';
/**
* The MIME type for the source HTML data.
*/
const MIME_TYPE_HTML = 'text/html';
/**
* Converts the contents of the given HTML file into PDF format.
*
* @param object $source_html_file
* The file entity wrapping the HTML file to convert.
* @param object $target_pdf_file
* The file entity wrapping an (empty) target PDF output file.
* @param array $renderer_options
* The options being provided to the renderer to control display of the PDF.
* Can include:
* - orientation: 'landscape' or 'portrait'.
* - page_width: The width of a single portrait-orientation page, in
* millimeters.
* - page_height: The height of a single portrait-orientation page, in
* millimeters.
* - header_html: HTML markup for the header of each PDF page.
* - footer_html: HTML markup for the footer of each PDF page.
*
* @return bool
* TRUE if conversion of the file was attempted and has completed; FALSE if
* the conversion is still in progress.
*
* @throws views_data_export_pdf_conversion_exception
* If the conversion fails.
*/
public function render_html_file_to_pdf($source_html_file, $target_pdf_file, array $renderer_options);
/**
* Converts the given HTML content into PDF format.
*
* Since the PDF output must be returned by this function, the conversion is
* performed synchronously, and therefore blocks further request processing
* until the conversion is complete.
*
* @param string $source_html
* The HTML content to convert.
* @param array $renderer_options
* The options being provided to the renderer to control display of the PDF.
* Can include:
* - orientation: 'landscape' or 'portrait'.
* - page_width: The width of a single portrait-orientation page, in
* millimeters.
* - page_height: The height of a single portrait-orientation page, in
* millimeters.
* - header_html: HTML markup for the header of each PDF page.
* - footer_html: HTML markup for the footer of each PDF page.
*
* @return string
* The result of the conversion.
*
* @throws views_data_export_pdf_conversion_exception
* If the conversion fails.
*/
public function render_html_to_pdf(string $source_html, array $renderer_options);
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_data_export_pdf_renderer:: |
constant | The MIME type for the source HTML data. | ||
views_data_export_pdf_renderer:: |
constant | The MIME type for the final PDF. | ||
views_data_export_pdf_renderer:: |
public | function | Converts the contents of the given HTML file into PDF format. | 4 |
views_data_export_pdf_renderer:: |
public | function | Converts the given HTML content into PDF format. | 4 |