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 | [reply] [Watch: Dir/Any] |
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";'
| [reply] [Watch: Dir/Any] [d/l] |
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
| [reply] [Watch: Dir/Any] |
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...) | [reply] [Watch: Dir/Any] |