Fwd: First time using Perl & PDF::API2

[email protected] (Dermot)
Newsgroups perl.beginners
Message-ID <[email protected]>
2008/5/28 Daniel Kasak <[email protected]>:
> On Tue, 2008-05-27 at 07:10 -0700, ChrisC wrote:
>
>> Hi!,
>>
>> Not sure if using PDF::API2 is  a good choice or not.  Little to no
>> doc.
>
> Yeah it's very powerful, and *very* poorly documented. What's worse, one
> of the best tutorials ( http://rick.measham.id.au/pdf-api2/ ) has a big
> photo of John f'n Howard in it. There's no need to immortalise that war
> criminal.
>
>> In the "sub paging " I create the next page, but the
>> script does not print in the next page.  Do I have to tell it to print
>> on page 2?  If so how?
>
> For each page, you have to set up page dimensions, create new text and
> graphics objects, eg:
>
> # Set page dimensions
> $page->mediabox( $self->{page_width}, $self->{page_height} );
>
> # Create a new txt object for the page
> $self->{txt} = $page->text;
>
> # Set y to the top of the page
> $self->{y} = $self->{page_height} - $self->{upper_margin};
>
> # Create a new gfx object for our lines
> $self->{line} = $page->gfx;
>
>> How do I add an image, jpg etc.
>
> $gfx->image(
>    $image,                     # The image
>    $img_x_pos,                 # X
>    $img_y_pos,                 # Y
>    $imgdata->{scale_ratio}     # scale
> );
>
> You might want to look at my project, PDF::ReportWriter. It uses
> PDF::API2 to produce reports. It simplifies things considerably, does
> page breaking for you, grouping, etc. You can also use it just to render
> text ( keep calling $report->render_data with new text ). I use it for
> everything from Access-like reports to producing mail-merge letters ( it
> does alignment, justification, etc as well ).
>
> I would point you to my webpage, but I accidentally lost everything
> during a server upgrade, so you'll have to get it from CPAN. You can
> either use it directly, or view the source to see how to use PDF::API2.
>
> Let me know if you have any other questions, feature requests, etc.
>
> Dan
>
> --
> Daniel Kasak
> IT Developer
> NUS Consulting Group
> Level 5, 77 Pacific Highway
> North Sydney, NSW, Australia 2060

I have to agree. I really like PDF::API2 but the documentation is a
little poor. I think the guy how created it (Alfred Reibenschuh) moved
on before he had time to write the documentation up. It would be
really cool if someone could come up with a new tutorial. I also
wonder if there is some more features that could be added to the API
now. No one has done any work on it since 2005.
Just a though,
Dp.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.