SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Coverting HTML w/CSS to PDF and RTF

    Hello All,
    I have a project where I need to figure out the most efficient way of converting an HTML document into both PDF and RTF format.

    The specific HTML document is a resume.

    I was wondering if anybody could recommend a single tool or a set of tools/php libraries that would automatically make the conversion from HTML to PDF and RTF.

    The other alternative is explicitly defining the formatting for each of document formats, but that would take much longer.

    Would rather just define format in HTML and then find some code that can automatically convert that into PDF and RTF.

    Although not a requirement, would be great if it could incorporate formatting in HTML done by CSS, but I know this mght be tricky.

    Thanks.

    Vega

  2. #2
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't know about rtf, rich text format, but if you have adobe acrobat (and i don't mean the free version) you can click file, print and instead sending it to the printer, you can send it to adobe's acrobat to be turned in a pdf.

    as far as rtf, um try to copy the html and paste it into MS word and save it as an rtf or if you have IE click file>edit with ms office word and if you don't have access to the server, save the page on your local drive, open it, then use file>edit with msword and save it as an rtf. or click file>save as and save it as a txt file and convert it into rtf.

  3. #3
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh yeah, if you have photoshop and the resume fits into the port view of your broswer, use print screen, open a new a file in photoshop, paste, edit as needed, and save as pdf.

  4. #4
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks MX, but I should've stressed that this is a server-side solution that I am seeking because this functionality needs to be embedded into a PHP application on a server.

    so, I am looking for some existing PHP libraries that already do that.

  5. #5
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well why not have people insert their resume data into a .txt or .rtf format by writing it to to file on the server, and write it into a .html page at the same time and use pdf functions and library that ship with php to create a pdf from reading the .txt or .rtf?


    form >html
    form> rtf > pdf

  6. #6
    SitePoint Member
    Join Date
    Feb 2005
    Location
    Illinois, USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't suppose you folks tried this? http://www.php.net/pdf

    Heh, heh, heh.

  7. #7
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pdflib costs money, and honestly isn't too great...

    I use R&OS PDF (www.ros.co.nz/pdf/ ) for most of my applications that generate PDF. I have a side project doing something like this with my resume at http://www.james-carr.org/resume/new/resume.xml . The ideal solution is to make the resume in XML, and transform it to various formats from there. I use XSL to transform it to XHTML and plain text, and will be installing FOP (http://xml.apache.org/fop/) to transform it to PDF.

    As for RTF.... I think XSL-FO does rtf too, but I plan on using a java library I found to transform it into an MS WORD document (or if worse comes to worse, Word 2003).

    A word of warning though, if you don't know xsl, you have a steep learning curve... and XSL-FO in itself is hideously tedious).

    James Carr, Software Engineer


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

  8. #8
    SitePoint Enthusiast escape164's Avatar
    Join Date
    Dec 2002
    Location
    Colorado, USA
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally used Open Office to construct my resume. I retyped the entire thing from Microsoft Word into Open Office, paying special attention to spacing and tabs. Then, when I wanted to save it, I would simply save it in all of the different formats and 'voila!', everything was as it was supposed to be.

    Very easy.

  9. #9
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could just as easily create the resume as suggested in XML and have the XSL stylesheet create the formatting for you as well (ie tabs and spaces etc)

    Btw, XSL-T isn't too difficult to grasp, I got the basics in a couple of days of use and that's all you need to get started. Learning XPATH helps a bit as well

  10. #10
    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

  11. #11
    SitePoint Evangelist ldivinag's Avatar
    Join Date
    Jan 2005
    Location
    N37 33* W122 3*
    Posts
    414
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there also:

    http://fpdf.org/

    to make PDFs...
    leo d.

  12. #12
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Netherlands
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Somebody already figured out how to create RTF files on the fly with images in it?


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
  •