#!/usr/bin/perl -w # # Example 12-1. Hello World use strict; use PDF::API2; my $pdf=PDF::API2->new; my $page=$pdf->page(); # Add a new page $page->mediabox(400, 200); # Set the dimensions my $text=$page->text(); # Add the text object $text->translate(65, 75); # Position the Text object my $font = $pdf->corefont('Helvetica-Bold',1); $text->font($font,48); # Assign a font to the Text object $text->text('Hello World'); # Draw the string print $pdf->stringify(); # Output the document as a PDF $pdf->end; # Destroy the PDF object exit;