SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML in MySQL to PDF

    Hi all,

    I have bits of text in a database. This text is formatted with relatively simple HTML (mostly just stuff like bold, italic, etc, but it also includes super- and subscript); to make matters just a bit more complicated, I also have some "greek letters" (such as α and θ etc). The good news, though, is that I don't have anything really complex like tables, divs, css, etc... :-)

    Now, I'd like to run through the MySQL database with a PHP script, extract the fields of interest (no problem up to this point) and generate a PDF document with two columns per page... And it's this last part that's driving me nuts.

    I've been looking at FPDF and HTML2FPDF, but I'm just not getting things done the way I need (the first can deal with two columns, but doesn't handle HTML as well as I'd like; and I can't seem to coax the latter to generate two-column pages).

    Can anyone help?

    Many thanks in anticipation for your attention.

    Paulo

  2. #2
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd use R&OS PDF class.. it's alot cleaner. Also, it has support for some formatting tags, such as <b>, <u>, and <i>. It's also the easiest to use (imho)

    Also, you should try DOMPDF, which uses R&OS PDF.

    James Carr, Software Engineer


    assertEquals(newXPJob, you.ask(officeOfTheLaw));

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much for the pointer. I'll look into it.
    Paulo

  4. #4
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've had a look at DOMPDF (and sent the author a small note also). Based on the demo window provided, it does not render subscripts and cannot handle HTML entities (&alpha; &beta; etc).

    If anyone has other ideas, I'd greatly appreciate hearing them.

    Many thanks,

    Paulo

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    epsom
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am really getting to grips with php now.

    The only problem that I am having which I cannot find the answer anywhere is with the use of pdf.

    I have a form populate a pdf and have created all the lines with x and y coordinates but what do I do when a field goes over a certain number of characters and the line does not go onto the next one and goes too far across the screen.

    How do I tell it to go onto the next line if there is not enough space?

    Please help!

    Thanks

    Nicholas

  6. #6
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to a more appropriate forum. See Where should I post my thread? for details

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •