2017 © Pedro PelĂĄez
 

library php-sdk

pdfapi.io enables HTML pages that can contain CSS and JavaScripts to generate beautiful PDF via API

image

pdfapi/php-sdk

pdfapi.io enables HTML pages that can contain CSS and JavaScripts to generate beautiful PDF via API

  • Monday, April 10, 2017
  • by tobre
  • Repository
  • 3 Watchers
  • 0 Stars
  • 937 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Build Status Coverage Status, (*1)

pdfapi.io SDK for PHP

Installation

pdfapi.io PHP SDK can be installed with Composer. Run this command:, (*2)

composer require pdfapi/php-sdk

Usage

Usage of pdfapi.io PHP SDK is very simple. The easyest way to get started is:, (*3)


use PdfApi\PdfApi; $template = <<<HTML <!DOCTYPE html> <html> <body> <h1>pdfapi.io makes PDF generation so easy.</h1> <p>And it can do complicated stuff.</p> </body> </html> HTML; $pdfApi = new PdfApi('YOUR_API_KEY'); $pdfApi->setHtml($template); $rawPdf = $pdfApi->generate();

Full example of the usage: Note: Be aware that header and footer are separate HTML documents (with styles and everything) that are copied to each page., (*4)


use PdfApi\PdfApi; use PdfApi\Parameter\Enum\Orientation; use PdfApi\Parameter\Enum\Size; $template = <<<HTML <!DOCTYPE html> <html> <body> <h1>pdfapi.io makes PDF generation so easy.</h1> <p>And it can do complicated stuff.</p> </body> </html> HTML; $header = <<<HTML <!DOCTYPE html> <html> <body> <p>pdfapi.io</p> </body> </html> HTML; $footer = <<<HTML <!DOCTYPE html> <html> <body> <p>pdfapi.io</p> </body> </html> HTML; $pdfApi = new PdfApi('YOUR_API_KEY'); $pdfApi->setHtml($template); $pdfApi->setHeader($header); $pdfApi->setFooter($footer); $pdfApi->setSize(Size::A4); $pdfApi->setOrientation(Orientation::Landscape); $rawPdf = $pdfApi->generate(); //or optionally you can save PDF directly to file $pdfApi->save('/path/to/file.pdf');

For getting API KEY you need to register account at https://pdfapi.io. Generating API KEY will take you 10 seconds. And it is free. Really., (*5)

The Versions

10/04 2017

dev-master

9999999-dev https://github.com/pdfapi/php-sdk

pdfapi.io enables HTML pages that can contain CSS and JavaScripts to generate beautiful PDF via API

  Sources   Download

MIT

The Requires

 

The Development Requires

by TÔnis Tobre

php sdk pdfapi.io

05/11 2016

v1.0.0

1.0.0.0 https://github.com/pdfapi/php-sdk

pdfapi.io enables HTML pages that can congtain CSS and JavaScripts to generate beautiful PDF via API

  Sources   Download

MIT

The Requires

 

The Development Requires

by TÔnis Tobre

php sdk pdfapi.io