in reply to Re^2: Write To PDF File
in thread Write To PDF File
I wrote a quick script based on the documentation from PDF::API2 and it works fine without using an intermediate file:
#!/usr/bin/env perl use strict; use warnings; use PDF::API2; # Create a blank PDF file my $pdf = PDF::API2->new(); # Add a blank page my $page = $pdf->page(); # Set the page size $page->mediabox('Letter'); # Add a built-in font to the PDF my $font = $pdf->corefont('Helvetica-Bold'); # Add some text to the page my $text = $page->text(); $text->font($font, 20); $text->translate(200, 700); $text->text('Hello World!'); # Save the PDF $pdf->saveas('new.pdf');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |