Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: How can I print hash content to pdf file ?

by Corion (Patriarch)
on Dec 10, 2017 at 09:28 UTC ( [id://1205243]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How can I print hash content to pdf file ?
in thread How can I print hash content to pdf file ?

If you need to supply coordinates, why don't you supply them when you print in your loop?

Try maybe printing stuff into separate lines?

my $offset = 300; for my $line (@names) { $pdf->text( "Hello PERL", x => 300, y => $offset ); $offset = $offset + 50; # move to "next line" };

I chose 50 by random, maybe you want 12 (points) or 24.

Replies are listed 'Best First'.
Re^4: How can I print hash content to pdf file ?
by vkk05 (Initiate) on Dec 10, 2017 at 11:31 UTC
    Passing offset is a good suggestion. But I need to print hash value instead of 'Hello Perl'. I mean inside $pdf->text what can be written?

      ->text() can write only text.

      You need to convert your data to text before you can write it.

      So, now maybe it's a good time to look at the first program to see whether/how you can atually get text from your data structure.

      Data::Dumper is a good way to inspect data structures.

      Update: Fixed missing markup spotted by Athanasius

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1205243]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found