Re: PDF via Perl?
by perlmonkey (Hermit) on May 23, 2000 at 05:40 UTC
|
Once again, thanks for all the input.
Unfortunatley I found the PDF package and the
Text::PDF package
fairly useless. They seem to be strong in reading a pdf
file, but very weak or useless for actually creating a pdf file.
I also did look into the ps2pdf which is not a bad solution
if you want to install ghostscript.
The "PDF file creator written in perl" seemed promising
but it is licensed ... how lame. Also the txt2pdf is licensed
so screw them. I was getting really depressed as it seems
that everyone that touched pdf files was out to make
a crapload of money (adobe of course being the worst offender).
Anyway to wrap up my tale ... PDF::Create (duh!)
It is not part of the PDF package apparently (different authors),
but after another
extensive search (eventually from freshmeat.net) I stumbled on
a message that refered to it. BTW it is not in search.cpan.org.
So I tried:perl -MCPAN -e "install 'PDF::Create'"
and wah-lah! It worked, (and beautifully). Although it is
simple, and not fully implemented yet it works beyond my needs.
Here is a full program the creates a PDF file:
use PDF::Create;
use strict;
my $pdf = new PDF::Create('filename' => 'test.pdf',
'Version' => 1.2,
'Author' => 'Perl Monger',
'Title' => 'Test Test');
my $page = $pdf->new_page;
my $f1 = $pdf->font('Subtype' => 'Type1',
'Encoding' => 'WinAnsiEncoding',
'BaseFont' => 'Helvetica-Oblique');
$page->string($f1, 40, 30, 600, "Hello from pdf Hell!" );
$pdf->close;
I hope others find this helpful.
Update: PDF::Create Version 0.01 is now in search.cpan.org | [reply] [d/l] [select] |
|
How can I output the Simplified Chinese Code with Correct 'Encoding'?
When I use 'gb2312' or 'utf-8', there has the wrong output.
Thanks!
| [reply] |
RE: PDF via Perl?
by neshura (Chaplain) on May 22, 2000 at 22:44 UTC
|
| [reply] |
RE: PDF via Perl?
by Russ (Deacon) on May 23, 2000 at 01:50 UTC
|
I've done PDF via Perl where I work.
We needed to spit out a number of forms on demand, so we
made a blank form in PostScript and converted it to PDF.
We would then print that as an object, followed by data
objects (the actual text in the form), one per page. It
made a very tight download (100's of printed pages would
fit in just a few K), because we reused the PDF form object.
There is nothing simple about PDF, but it can be done.
Feel free to email me (Russ) if you need more information.
I'll help you however I can.
Russ | [reply] |
Re: PDF via Perl?
by lhoward (Vicar) on May 22, 2000 at 22:43 UTC
|
I've never used either of these, but a quick search
turned up these on CPAN.
| [reply] |
Re: PDF via Perl?
by KM (Priest) on May 22, 2000 at 22:50 UTC
|
| [reply] |
Re: PDF via Perl?
by perlmonkey (Hermit) on May 22, 2000 at 23:33 UTC
|
Thanks everyone for your posts. Apparently my search
was not that productive. I never think about
search.cpan.org but or course I will next
time. Somewhat in my defense I went to:
http://www.cpan.org/modules/by-module/ as I
always do, and the PDF module is not listed there.
But the Text::PDF, which I didnt think to look for, is there.
Hopefully at least
one of the modules will be functional. | [reply] |
|
If you ever get a chance, you should check out the CPAN.pm module. I personally hate it but I still use it to search for modules every now and then. It even lets you do regex searches for modules ;) but it never seems to install the modules correctly so I still do it by hand.
72656B636148206C72655020726568746F6E41207473754A
| [reply] |
|
I live by CPAN.pm, it is awesome. I just didn't try
perl -MCPAN -e "install 'PDF'"
But now that I am looking at the modules they dont look to useful.
They seem to be total alpha modules basically for reading
pdf files. I dont see yet how to create one from scratch,
although Text::PDF claims to be able to. And
I dont see any examples yet. I am going to keep hacking. | [reply] [d/l] |
Re: PDF via Perl?
by Anonymous Monk on May 23, 2000 at 09:39 UTC
|
I realize this is a bit late, and I've not read through the article thoroughly, but I thought it might be worth mentioning just to provide another way to approach the problem. This method does not require a module, but does require Adobe Acrobat (not just Reader). It does seem a bit convoluted, but is well documented, and includes examples and resources (with even more options).
http://www-4.ibm.com/software/developer/library/pdfs/ | [reply] |
RE: PDF via Perl?
by Tibetan_Monk (Initiate) on May 22, 2000 at 23:58 UTC
|
When all else fails 'search'. I have spent alot of time manually searching through cpan and never finding what I need. But when I do a search woola .. there it is. So you are not alone witht the cpan ignorance :} | [reply] |
Re: PDF via Perl?
by btrott (Parson) on May 22, 2000 at 22:44 UTC
|
Did you see Text::PDF?
I must admit, I've no experience with it, but it may suit
your needs. | [reply] |
Re: PDF via Perl?
by Anonymous Monk on May 23, 2000 at 01:38 UTC
|
I might suggest that you create the document in ps then
just run it through ps2pdf which comes with every
ghostscript install, i believe. So it should be on your
IRIX box.
Not exactly a great or fast solution but with some
banging it could be made to work. If you know what your
doing ghostscript itself can write pdf files ...
pdfwrite is one of the standard 'output devices'. | [reply] |