Ratings | | Unique User Downloads | | Download Rankings |
75% | | Total: 3,881 | | All time: 820 This week: 89 |
|
Description | | Author |
This class can convert HTML to PDF using pdflayer API.
It can send HTTP requests to the pdflayer API Web server to convert a given HTML document to PDF. The HTML may be passed literally or as the URL of a given page to convert.
The class retrieves the converted HTML document and displays the PDF document as the current request output or serve it for download.
The class can pass conversion options like:
- Standard and custom page sizes and orientation
- Viewport page sizing and zooming
- Customized page headers and footers
- Margins
- Stamps and watermarks
- Encryption
- Owner and user password protection
- PDF file permissions to save, print, etc..
- PDF Meta data Innovation Award
February 2016
Number 7 |
PDF is a format often used to generate documents that were meant to be printed in paper.
Many Web applications need to generate PDF to address their users printing needs. However, what most Web applications do is to generate HTML.
This class can minimize the development effort by allowing to convert HTML generated by Web applications to PDF documents using a Web service.
It provides some unique features that help developers to customize better their application needs like setting page headers, footers and margins, adjusting the printed document viewport size and zoom level, add stamps and watermarks to the PDF document, encrypt the document, as well add owner and user passwords to it.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 32x
Winner: 7x |
|
Recommendations
Example
<?php
/*
Basic instantiation and usage
*/
include('../html2pdf.class.php');
$h2pdf = new html2pdf();
//set the url to convert
$h2pdf->setParam('document_url','https://www.google.com/');
//start the conversion
$h2pdf->convertHTML();
//display the pdf file
$h2pdf->displayCapture();
?>
|
Details
Class: html2pdf
Version: 1.0 2/8/2016
Copyright 2016 Wagon Trader, All Rights Reserved
Description:
Convert HTML to PDF using the pdfLayer API from
https://pdflayer.com/.
Files:
html2pdf.class.php - main class
reference.txt - parameter reference
/example - usage examples
Installation:
Upload files to a web accessible location on your server (eg. public_html)
Configuration:
You can change the following settings in the class to meet your specific needs...
apiKey = Your personal API Key, get a free key at https://pdflayer.com/product
endpoint = The API endpoint, you will only need to change this if the API
changes location.
secretKey = If you have defined and activated the secret keyword feature from you
pdfLayer dashboard, add your secret keyword here.
Usage:
refer to examples in example for class instantiation and usage.
refer to html2pdf.class.php for instructions on using methods.
refer to reference.txt file for available parameters and their usage.
Changelog:
1.0
Initial Release
|
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.