Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

create tables with text and images in pdf

by lighterjoul (Initiate)
on Jan 17, 2013 at 09:16 UTC ( #1013734=perlquestion: print w/ replies, xml ) Need Help??
lighterjoul has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone! I wanna to create a pdf with perl, and that pdf will contain a table ( a column with images, other columns with text), can anyone gives me some hints? the data might like this.
@data=[['col text1', 'col text1', image path1 ], ['col text2', 'col text2', image path2 ], ['col text3', 'col text3', image path3 ], .... ];
I searched google, and find the pdf::reportWriter, but I still can not find the related example for this requirement. Best wishes!

Comment on create tables with text and images in pdf
Download Code
Re: create tables with text and images in pdf
by nithins (Sexton) on Jan 17, 2013 at 09:33 UTC

    search for PDF::API2 in www.cpan.org .This might help you

Re: create tables with text and images in pdf
by vinoth.ree (Parson) on Jan 17, 2013 at 10:26 UTC

    I used this module to create PDF files CAM::PDF

    Suppose If you have your data in HTML content, you can use the HTML::HTMLDoc It turns HTML documents into PDF.

Re: create tables with text and images in pdf
by roboticus (Canon) on Jan 17, 2013 at 11:54 UTC

    lighterjoul:

    I'd second ree's suggestion to use a package to do the heavy lifting for you. Laying out documents from scratch can be a bit tedious, especially when items are wont to move around from run to run. I've not tried the suggested module (HTML::HTMLDoc), but a little digging through cpan may help you find a module that you can use with minimal fuss.

    However, if you want to learn how to build PDF documents from scratch, you could find some examples here among the older nodes. The one I started with a year or so ago is Making Sudoku Puzzles Using PDF::API2. It's reasonably short, and shows how you can easily position text and draw simple graphics at different locations on a page.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Thank you roboticus, I will check that. :) I had known how to create the images and text in pdf, but what I want to find is just want to create table dynamically both containing text column and iamge column. I will search in CPAN later..:)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1013734]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-11-28 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls