PHP Classes

Convert HTML to PDF PHP Library: Convert HTML to PDF using pdflayer API

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 75%Total: 3,881 All time: 820 This week: 89Up
Version License PHP version Categories
pdflayer 1.0GNU General Publi...5HTML, PHP 5, Files and Folders, Web s...
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
PHP Programming Innovation award nominee
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
Picture of Dave Smith
  Performance   Level  
Name: Dave Smith is available for providing paid consulting. Contact Dave Smith .
Classes: 51 packages by
Country: United States United States
Age: 59
All time rank: 608 in United States United States
Week rank: 170 Down21 in United States United States Down
Innovation award
Innovation award
Nominee: 32x

Winner: 7x

Recommendations

What is the best PHP pdf creation class?
CREATE PDF

What is the best PHP pdf to html class?
Converting PDF files to a HTML file

What is the best PHP convert html to pdf class?
I need to convert html content with tables to pdf

What is the best PHP arabic pdf class?
Generate PDF in Arabic

What is the best PHP html to pdf class?
Print HTML as PDF

Convert HTML form to PDF
I need to convert HTML application form to PDF file

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

  Files folder image Files (10)  
File Role Description
Files folder imageexample (6 files)
Plain text file html2pdf.class.php Class Main Class
Accessible without login Plain text file license.txt Lic. License
Accessible without login Plain text file readme.txt Doc. Installation
Accessible without login Plain text file reference.txt Doc. Parameter Reference

  Files folder image Files (10)  /  example  
File Role Description
  Accessible without login Plain text file basic.php Example Example Usage
  Accessible without login Plain text file download.php Example Example Usage
  Accessible without login Plain text file headertext.php Example Example Usage
  Accessible without login Plain text file markup.php Example Example Usage
  Accessible without login Plain text file redirect.php Example Example Usage
  Accessible without login HTML file test.html Data Example Markup

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:3,881
This week:0
All time:820
This week:89Up
User Ratings User Comments (1)
 All time
Utility:96%StarStarStarStarStar
Consistency:92%StarStarStarStarStar
Documentation:92%StarStarStarStarStar
Examples:89%StarStarStarStarStar
Tests:-
Videos:-
Overall:75%StarStarStarStar
Rank:69
 
Congratulations, thats a very very good class ;-)
8 years ago (José Filipe Lopes Santos)
80%StarStarStarStarStar