On Tue, 15 Mar 2005 08:46:49 +1100, Daniel Kasak <[EMAIL PROTECTED]> wrote: > Charles K. Clarkson wrote: > > >Daniel Kasak <mailto:[EMAIL PROTECTED]> wrote: > >: Hi all. > >: > >: Despite making some decent progress in other areas, I'm banging my > >: head against a brick wall on something simple: rendering text over a > >: solid rectange. > > > > You didn't provide enough code. Show us everything we need to > >reproduce your error. You do not, for example, explain what 'mm' is > >or where the constants are defined. Is $self part of an object? Is > >this whole code snippet part of a module? Give us more to go on. > > > > > I think I *did* provide all necessary code. Actually I'm 100% certain > that I did, but if you want it all, here you go ... you will now see why > I snipped the code to a resonable size and ommitted everything that > wasn't relevant:
[snip] ============================================================================================ > # Report Header > # > ============================================================================================ > > # Create a gfx object for the report header > #my $blue_box = $page->gfx; > #$blue_box->fillcolor('blue'); > #$blue_box->rect( > # 20 * mm, # left > # A4_y - (100 * mm), # bottom > # A4_x - (40 * mm), # width > # 80 * mm # height > # ); > > #$blue_box->fill; > > # Create a text object for the report header [snip] Daniel, Being snippy isn't likely to get you much help around here. Wanting to see where your constants are declared is perfectly reasonable; many problems on this list arise from imporperly declared vatiables and constants, and undeclared constants being used in place of variables. You can shrink the code to fit if space is really an issue, but make sure that whatever you submit is complete, shows that you've already tried use strict and use warnings for diagnostics, and reproduces the error. My first reaction is that you're calling methods that aren't provided by PDF::API2. The PDF::API2 docs don't mention PDF::API2::Page methods. Might you need to use/require PDF::API2::Page? Or just use PDF::API2::Lite. I thought this was lite code, anyway; I had to go back and look at your require line to make sure we were really talkling about PDF::API2. Try declaring the artbox as well as the mediabox for the page. Also, try calling ->gfx with a positive value, which should cause it to prepend and possibly render first. At the end of the day, though, my best advice is to use PDF::API2::Lite or PDF::Report. Other people have spent a great deal of time writing interfaces for PDF::API2 so that you don't have to. There are good tools out there; use them. HTH, Jay Savage -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>