#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    582
    Rep Power
    51

    TCPDF Documentation?


    Hi:

    I was looking for an easy to use PDF document generator that plays nicely with PHP.

    I found TCPDF which seems to work well, once you can figure out the syntax. But... that's a real problem...

    Typically, the documentation looks like this:

    Code:
    // MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
    
    // set some text for example
    $txt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
    
    // Multicell test
    $pdf->MultiCell(55, 5, '[LEFT] '.$txt, 1, 'L', 1, 0, '', '', true);
    $pdf->MultiCell(55, 5, '[RIGHT] '.$txt, 1, 'R', 0, 1, '', '', true);
    $pdf->MultiCell(55, 5, '[CENTER] '.$txt, 1, 'C', 0, 0, '', '', true);
    $pdf->MultiCell(55, 5, '[JUSTIFY] '.$txt."\n", 1, 'J', 1, 2, '' ,'', true);
    $pdf->MultiCell(55, 5, '[DEFAULT] '.$txt, 1, '', 0, 1, '', '', true);
    And your best bet is really just changing values to see what happens... But that's incredibly time consuming, frustrating and confusing.

    Does anyone know if any proper documentation exists for this library? The web site is:
    https://tcpdf.org
    But the docs are terrible and the examples require too much trial and error.

    Otherwise, what PDF libraries have people used that are reasonably intuitive and rely on native PHP?

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,473
    Rep Power
    653
    I don't know if it is any easier but the documentation is better for FPDF.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Backwards Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,914
    Rep Power
    9646
    I've recently worked with dompdf and I was very happy with it. Supports a lot of HTML and CSS features, plus embedded PHP.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    582
    Rep Power
    51
    Thanks!! I'll look into it

IMN logo majestic logo threadwatch logo seochat tools logo