2017 © Pedro Peláez
 

library pdflib

PDFlib made usable.

image

robgridley/pdflib

PDFlib made usable.

  • Tuesday, June 19, 2018
  • by robgridley
  • Repository
  • 2 Watchers
  • 3 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

PDFlib Wrapper

I use this PDFlib wrapper in my own projects. It is feature incomplete and provided as-is. Updates are irregular and they may break the API. Great sales pitch, eh?, (*1)

Example

This example creates a new PDF, places a page from an existing PDF, uses PDFlib PPS to fill a text block, and draws a red circle., (*2)

use Pdf\Color\CmykColor;
use Pdf\Drawing;
use Pdf\PdfBuilder;

$pdf = new PdfBuilder;

$document = $pdf->import(file_get_contents('test.pdf'));
$page = $document->page(1, ['cloneBoxes']);

$pdf->addPage();
$pdf->placePage($page, 0, 0, ['cloneBoxes']);

$page->block('address')->fill('123 Fake St., Toronto, ON  M1A 1A1');

$pdf->draw(function (Drawing $drawing) {
    $drawing->stroke(new CmykColor(0, 100, 100, 0), 0.25)->circle(100, 100, 50)->paintStroke();
});

echo $pdf->render();

The Versions

19/06 2018

dev-master

9999999-dev

PDFlib made usable.

  Sources   Download

MIT

The Requires

  • php >=5.6.0
  • ext-pdflib *

 

The Development Requires

by Rob Gridley