Fwd: First time using Perl & PDF::API2



2008/5/28 Daniel Kasak <dkasak@xxxxxxxxxxxxxxxxxxxx>:
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.
.



Relevant Pages

  • Re: Msoft wireless keyboards - need help please
    ... > Here is where the documentation was supposed to be: ... > Ron Shaw wrote: ... >> actually look at microsuxs wireless keyboards ... i dont see where msux gives any dimensions ...
    (microsoft.public.windowsxp.hardware)
  • Re: Im looking for a metadata cube/dimension dependency report
    ... I have documentation that would help rebuild ... Even though I told it to ignore 1/2 dozen cubes, ... There is no mapping of what dimensions are used in what cubes -- only ... -- Hope to fix that bug. ...
    (microsoft.public.sqlserver.olap)
  • Looking for detailed programming reference for AMO for SQL Server 2005
    ... builds dimensions & cubes to SQL Server 2005 and AMO. ... MS documentation of the object model and class library pretty weak. ...
    (microsoft.public.sqlserver.olap)
  • Re: Slow access to MDSCHEMA_CUBES Problem
    ... Is there a section in Books Online (or other documentation) that would ... can combine dimensions and still maintain the right level of granularity. ... The real problem is access to schema rowsets. ... Windows or SSAS setting)? ...
    (microsoft.public.sqlserver.olap)
  • Re: bug tracking software
    ... > sending me or the new feature requests? ... Good documentation. ... Great support. ... single user. ...
    (borland.public.delphi.thirdpartytools.general)