PDF-API2

From OpenStreetMap Wiki
Jump to: navigation, search

Sample code

use PDF::API2;
$pdf = PDF::API2->new();

$page = $pdf->page;

#$page->mediabox(200,200);
$gfx = $page->gfx;
$gfx->strokecolor("#FF0000");
$gfx->move(0,0);
$gfx->line(100,100);
$gfx->stroke();
$gfx->endpath();

$gfx->strokecolor("#00FF00");
$gfx->move(150,150);
$gfx->line(150,50);
$gfx->stroke();
$gfx->endpath();

$pdf->saveas("test.pdf");

Reference

Examples

See also

Used for PDF atlas and PDF atlas source code

Packages

  • libpdf-api2-perl in Debian/Ubuntu