Help - Search - Member List - Calendar
Full Version: PDF::API2
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
Dermot Paikkos
Hi perlers,

This is a rather specialised query about the module PDF::API2.

I am trying to create PDFs on the fly. The first attempt worked fine
and I was delighted with the results. Then I was asked to make
something similar with landscape orientation. It started well but I
have hit a problem and I can't see what is going wrong.

To make the page landscape I have used the 'rotate' method. Similarly
I used the rotate method on the graphics handle, otherwise the images
appears in portrait while the page is in landscape. It is this rotate
that is causing the problem.

Normally I maintain the spacing of the images by incrementing the Y
axis value ($y) by the width of the last image, for test purposes I
am simply incrementing $y by 162 pixels. Once the graphics is rotated
all hell breaks loose with the lay-out and I can not see where the
image is laid on the page. I have tried a number of values (fixed and
incrementing) yet I can not see how I can rotate the image and
maintain control over $y.

I have attached a skeleton of script I am working on. The image file
can be anything. If it is run unmodified you should see 4 jpegs along
the top and 4 along the bottom, unrotated. Once line 99 is
uncommented:
# $photo->rotate($rotation);

the images start to disappear, presumably off the page.

$x is pretty constant either 18 or 270.

I know this is a bit specialised but if anyone has any ideas they'd
be much appreciated. Thanx.
Dermot.

Zentara
On Tue, 21 Jun 2005 16:09:32 +0100, [Email Removed] (Dermot
Paikkos) wrote:

QUOTE
This is a rather specialised query about the module PDF::API2.

And this is just a WAG (Wild A*s Guess) :-)

QUOTE
To make the page landscape I have used the 'rotate' method. Similarly
I used the rotate method on the graphics handle, otherwise the images
appears in portrait while the page is in landscape. It is this rotate
that is causing the problem.

Normally I maintain the spacing of the images by incrementing the Y
axis value ($y) by the width of the last image, for test purposes I
am simply incrementing $y by 162 pixels. Once the graphics is rotated
all hell breaks loose with the lay-out and I can not see where the
image is laid on the page. I have tried a number of values (fixed and
incrementing) yet I can not see how I can rotate the image and
maintain control over $y.

I know this is a bit specialised but if anyone has any ideas they'd
be much appreciated. Thanx.
Dermot.


Remember WAG...:-)
The first thing I thought of, when I saw "a rotation caused the object
to go out of view", was that the "origin of rotation" is probably not
what you think it is. For instance, what if, by default, the "origin"
and center of rotation is 0,0 which is usually the upper left corner?

You may be thinking the image is to be rotated around it's center
automatically?

So you image maybe is being "swung on the end of a long segment which
starts at the upper left corner, and carries it right off of the page.

As a test, try to rotate it by a value of 1 degree ( not 1 radian !! )
and see what happens. Remember 2 pi radians = 360 degrees.

Hope it helps.



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.