SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    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!

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,035
    Mentioned
    187 Post(s)
    Tagged
    2 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")

  3. #3
    SitePoint Wizard
    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.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,035
    Mentioned
    187 Post(s)
    Tagged
    2 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'00.80.2);
    $pdf->text(100110'Hello');
    $pdf->setFillColor('rgb'0.80.50.5);
    $pdf->setFont('Courier'''40);
    $pdf->text(110120'World');
    $pdf->output('mypdf.pdf'true);
    and mentions that it is based on FPDF http://www.fpdf.org/
    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 newer

  5. #5
    SitePoint Wizard
    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.

  6. #6
    SitePoint Wizard
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •