Creating new pages automatically with PDF::API2
- From: hotkitty <stpra123@xxxxxxxxx>
- Date: Sun, 11 May 2008 00:51:16 -0700 (PDT)
Since no one in the beginners group could answer this I thought I'd
ask it to this group. I am using PDF::API2 to create PDF files from a
bunch of separate text files I have. The issue I am having is that I
am only able to create the first page of each text file and I haven't
been able to figure out how to automatically generate additional pages
if the text document requires it. In the PDF::API2::Simple module,
there is "autoflow", which will generate the additional pages you need
and fill it with the appropriate text. I have the following code and
would appreciate if anyone could guide me to how I can generate multi-
page pdf's (I've omitted some of the code that isn't relevant to
creating the pdf files):
#!/usr/bin/perl
use warnings;
use LWP::Simple;
use HTML::TokeParser;
use PDF::API2;
use Text::Autoformat;
..
..
..
..
..
my $pdffile = '$file';
my $pdf = PDF::API2->new( -file => "$directoryname/$file.pdf");
my $page = $pdf->page;
$page->mediabox('A4');
my $times = $pdf->corefont( 'Times', -encoding => 'latin1');
my $main_text = $page->text;
$main_text->font($times, 14);
$main_text->fillcolor('pearl');
$main_text->lead(16);
$main_text->translate(15, 650);
$main_text->paragraph("@body\n", 575, 144, -align => "justify");
$pdf->save;
$pdf->end;
.
- Follow-Ups:
- Re: Creating new pages automatically with PDF::API2
- From: Bill H
- Re: Creating new pages automatically with PDF::API2
- Prev by Date: FAQ 3.28 I've read perlembed, perlguts, etc., but I can't embed perl in my C program; what am I doing wrong?
- Next by Date: Re: Net::SMTP fails
- Previous by thread: FAQ 3.28 I've read perlembed, perlguts, etc., but I can't embed perl in my C program; what am I doing wrong?
- Next by thread: Re: Creating new pages automatically with PDF::API2
- Index(es):