SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Aug 6, 2005, 06:47 #1
- Join Date
- Dec 2004
- Location
- USA
- Posts
- 1,407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
where can I find some good documentation and examples on PEAR's File_PDF?
I've tried several other packages (non-pear) and have had trouble - I hope this one, despite not being in stable form, is useful. It got great raves in two
notable presentations but can not find much documentation at all. The code itself has not sample or examples.
Any links are appreciated!
-
Aug 6, 2005, 07:06 #2
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
File_PDF docs and examples
Quote from pear.php.net
"No end-user documentation is available for this package."
The package contains a "test" folder with "factory.phpt" in it. You could try that one. (maybe lose that end "t")Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Aug 6, 2005, 10:24 #3
- Join Date
- Dec 2004
- Location
- USA
- Posts
- 1,407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I read there was no documentation at pear package. However, it was mentioned as a really good package in a presentation so I thought someone might have used it and perhaps posted how they got started.
The test file makes no sense at all - does not compile/serve up- yes, I changed the extension.
Thanks.
-
Aug 6, 2005, 12:16 #4
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
PEAR PDF test file
I uploaded the PDF package and it worked fine. The test file output this:
--TEST-- File_PDF: factory() test --FILE-- string(1) "L" int(1) float(841.89) float(1190.55) string(1) "L" int(1) float(595.28) float(841.89) string(1) "L" int(1) float(841.89) float(1190.55) string(1) "P" float(2.8346456692913) float(595.28) float(841.89) string(5) "mypdf" string(1) "P" float(2.8346456692913) float(595.28) float(841.89) --EXPECT-- string(1) "L" int(1) float(841.89) float(1190.55) string(1) "L" int(1) float(595.28) float(841.89) string(1) "L" int(1) float(841.89) float(1190.55) string(1) "P" float(2.8346456692913) float(595.28) float(841.89) string(5) "mypdf" string(1) "P" float(2.8346456692913) float(595.28) float(841.89)
You're right, it doesn't make much sense. It certainlly isn't a PDF file.
I went to PEAR and followed the link to "External Package Homepage"
It went to Horde, not much help. A google search for - horde pdf php - gave results including http://pear.php.net/pepr/pepr-proposal-show.php?id=63
which had this Sample code:
PHP Code:<?php
require_once 'PDF.php';
$pdf = &PDF::factory('P', 'mm', 'a4');
$pdf->open();
$pdf->addPage();
$pdf->setFont('Arial', 'B', 20);
$pdf->setFillColor('rgb', 0, 0.8, 0.2);
$pdf->text(100, 110, 'Hello');
$pdf->setFillColor('rgb', 0.8, 0.5, 0.5);
$pdf->setFont('Courier', '', 40);
$pdf->text(110, 120, 'World');
$pdf->output('mypdf.pdf', true);
that page has links to 7 tutorials.
Of course all this isn't much help unless you upload the package into the correct directory structure. I upload "manually" with the CPanel file manager.
My structure is
domainName/PublicHtml/pear/File/Pdf.php
domainName/PublicHtml/pear/File/tests/factory.php
domainName/PublicHtml/pear/File/PDF/fonts/all11ofThemInHere
if you don't put the test file in the test folder you have to change it's require path to point to the PDF.php file eg.
require_once 'File/PDF.php';
assuming your htaccess's include path has
/home/domainName/public_html/pear/ in it
Also note the package's dependencies
Dependencies:
* PHP Version: PHP 4.2.0 or newerBig Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Aug 6, 2005, 13:50 #5
- Join Date
- Dec 2004
- Location
- USA
- Posts
- 1,407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I too had found http://www.fpdf.org/ but thought it was really a different animal despite being the inspiration for File_PDF.
I sincerely appreciate you searching, finding and posting this.
Surely, there is a way to work with the PEAR. I have had such good experience with PEAR that I'd like to stay with it.
If I don't find something soon, I'll revert to http://www.fpdf.org/.
Many thanks again.
-
Aug 6, 2005, 13:52 #6
- Join Date
- Dec 2004
- Location
- USA
- Posts
- 1,407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I also found this at horde.org that might be helpful but it gives no examples:
http://dev.horde.org/api/framework/F.../File_PDF.html
Bookmarks