Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Text::PDF documentation???

by k2 (Scribe)
on Oct 13, 2001 at 20:56 UTC ( #118674=perlquestion: print w/ replies, xml ) Need Help??
k2 has asked for the wisdom of the Perl Monks concerning the following question:

Hi!
I'm about to write a script that will produce a PDF-file with about 25 pages of text and a couple of pictures/page.
I have searched previous postings and figured out that Text::PDF is the module to use,
but the man-pages that comes along aren't of much help.
So now I'm asking for your help in finding some good examples or documents describing how to use Text::PDF,
or if you think I'm way off using Text::PDF please give me a hint...

Thanks in advance
k2

Comment on Text::PDF documentation???
Re: Text::PDF documentation???
by andreychek (Parson) on Oct 14, 2001 at 07:47 UTC
    Hello k2,

    You're right, the documentation for Text::PDF is a bit terse. Word has it that it doesn't do as well writing PDF's as it does reading them. If you wanted to try, there were two modules build on top of Text::PDF -- Text::PDF::API and PDF::API2. Unfortunatly, the docs for both of them aren't much better, but one of those might "click" better for you.

    However, after searching through some previous posts on the subject, here is a post by perlmonkey explaining that he had a lot of luck with PDF::Create. While it's version is 0.01, it seemed to work quite well for him. Also, the docs for that module on CPAN seem to be a bit better, they give some decent examples of how you'd write a pdf out.. and if those aren't enough, the post by perlmonkey I linked to above also contains an example of how you'd write a PDF document with PDF::Create.

    Hope that helps!
    -Eric
Re: Text::PDF documentation???
by LostS (Friar) on Oct 14, 2001 at 19:14 UTC
    Umm I just made a PDF... which is about 121 pages longer... Dynamically from a Flat File Database system... You can see my write up here Dynamically Generate PDF's On The Fly. I do use the module PDF::Create but I use 0.06 So.. all the URL's and code is at that node...

    -----------------------
    Billy S.
    Slinar Hardtail - Guildless
    Datal Ephialtes - Guildless
    RallosZek.Net Admin/WebMaster
    Aerynth.Net Admin/WebMaster

    perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'
Re: Text::PDF documentation???
by ronzomckelvey (Acolyte) on Oct 24, 2001 at 08:16 UTC
    HI-
    Lately I've been doing a lot of PDF making, using PostScript::TextBlock

    I use the Postscript module to make a Postscript file, then ps2pdf (ghostcript) to make it into a pdf.

    I even took a form that was created as a EPS file, then created a perl program to fill the form in, and make a pdf.

    I can send you some of my programs if you would like.

    ronzo

Re: Text::PDF documentation???
by k2 (Scribe) on Oct 27, 2001 at 21:03 UTC
    Thank's LostS for giving me a hint of how to do this.
    I tried the 0.06 version with your script (removed parts that I didn't need) just to see if it would include jpg's as expected,
    but no...
    I get the following:
    Not a JPEG file. Can't use string ("1.2") as a HASH ref while "strict refs" in use at D:/Perl/site/lib/PDF/Create/Page.pm

    I'm 100% sure that it's a JPG-picture so I'm a bit confused...

    Second, when I try and open the file after removing the part with the image (just trying to create a PDF-document)
    Acrobat Reader says:
    "This file is damaged and is beeing repaired"
    Anyone got a clue about this???

    Thanks for your posting ronzo. It might be an idea to go through a postscript-file, but I'm trying to avoid it as far as I can...
    This should be posible to do with the PDF::Create even if I can't get it working at the moment ;-)

    /k2
    (I tried to include the code I used but I can't post my message when the code is included...)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2014-07-25 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (174 votes), past polls