Slashdot Mirror


PDF Writers?

Saqib Ali asks: "I am looking for for some OpenSource PDF Writers/Creator. I found one, here. It can basically create PDFs out of common software Like OfficeSuite, Visio, Project or any other Windows Application that uses the Windows Printers. I know OpenOffice can also export to PDF. I am working on a project (fat client) where I need to dynamically create PDF reports from data stored in MySQL DB. I know I can use PHP to create PDFs, and also Apache's Cocoon (you can find an example document, here). Of course, I would like to investigate other OpenSource PDF writers as well. Do you know of any other PDF writers, that I can utilize or learn from by looking at the source-code?"

11 of 94 comments (clear)

  1. CUPS by benjamindees · · Score: 4, Informative

    CUPS has an option for a virtual PDF printer in Linux, called CUPS-PDF.
    I think it's included in RedHat 9.

    --
    "I assumed blithely that there were no elves out there in the darkness"
  2. fpdf.org by Bonewalker · · Score: 4, Informative
    I have found this site useful. The entire class is in one php file. Just move it to your web server, then use some of the tutorials to get the hang of creating pdf's on the fly.

    http://www.fpdf.org

  3. OpenOffice by Drakon · · Score: 3, Informative

    Openoffice can not only write PDFs, it can also read data from a mySQL (or other ODBC/JDBC compliant) databases.
    I don't see any reason not to use it out of the box for such a purpose... or am I missing something?

  4. PDF Converters by RedPhoenix · · Score: 4, Informative

    Some of these might be useful:

    Txt2pdf - http://www.sanface.com/txt2pdf.html
    html2pdf - http://www.geocities.com/SiliconValley/Lab/5247/
    HTMLDoc - http://www.easysw.com/htmldoc/pdf-o-matic.php
    Den ature - http://freshmeat.net/projects/denature/
    csv2pdf - http://freshmeat.net/projects/csv2pdf/
    ascii2pdf - http://freshmeat.net/projects/ascii2pdf/

    And a google directory reference: http://directory.google.com/Top/Computers/Software /Word_Processors/PDF/Converters/

    Good luck!

    Red.

    1. Re:PDF Converters by saden1 · · Score: 2, Informative

      Add iText to the mix. It is a Java library capable of doing almost anything. The only down side is it is slower than native C libraries out there. If speed is a real issue, you could compile your iText Java classes using GCJ and convert them into native code. I'm thinking doing so will seed up your application. I haven't tried converting it to native code, has anyone?

      --

      -----
      One is born into aristocracy, but mediocrity can only be achieved through hard work.
  5. XO? FO? by cookiepus · · Score: 2, Informative

    This is going to be the vaguest useful answer given...

    Back in the day I needed to turn some XML files into HTML files by applying an XSL transformation. I also found out that the same process can be done for making PDF files using something called FO (or was it XO?) from the Apache people (not the Indians)

    I made XSL files with PDF-generating tags and then ran 'em through this Java library. Since out backend was made in Java anyway it was a perfect fit.

    It would be quite exciting if I was a geek and cared about this sort of thing. ;-)

  6. ps2pdf by GiMP · · Score: 3, Informative

    Practically every Unix applications output postscript when issued a print command. If the software doesn't allow you to print to file, then print to the command "cat > file.ps" to save to file.ps.

    Then, run:
    ps2pdf -r600 file.ps file.pdf

    You can change the 600 to whatever resolution you wish.

    If you're grabbing this from a database, you can simply output in text and use ascii2ps to create a pdf file.

  7. XML - FO - PDF by Mulligan · · Score: 3, Interesting

    My current favorite for PDF generation is to build an XML document programatically. This document has no layout information, so I use Saxon and an XSLT stylesheet to translate it to XSL Formatting Objects. From there, I use FOP to translate to PDF.

    The best part is that the XML document contains the content, while the XSLT stylesheet describes how to make a document out of it. If I need a screen version all I have to do is write another stylesheet to translate to HTML.

    1. Re:XML - FO - PDF by pi_rules · · Score: 2, Insightful

      I second the parent's suggestion. Been there, done that, and it rocked, even when FOP was at the 0.17 release. It worked pretty darned well, and you just had to make another XSLT sheet to turn the document into HTML.

      Yes, it's a big task and not the "quick and dirty" method but it works really well and gives you exactly the results that you want if you want to put the time into it. The XML+XSLTT -> processor model is definately the way to for things that you expect to last a while into the future.

  8. There are so many solutions... by Karora · · Score: 2, Insightful


    In PHP I use pdf-php, which is simple and straightforward. I've used this to produce invoices for a non-profit that I voluntarily did a membership system for in PHP.

    If I want to mailmerge a document I would just use OpenOffice 1.1 - it does both parts perfectly well.

    There are heaps of "printer driver" approaches as well, and of course there is Ghostscript, which has been doing this for many years.

    --

    ...heellpppp! I've been captured by little green penguins!
  9. TeX! by larry+bagina · · Score: 2, Troll
    if you want pdfs that don't look like goatse's asshole after being ham-slammed, the only choice is (La)TeX. There are 3 options:
    1. use PDFLaTeX, which produces PDF files rather than DVI files.
    2. use (La)TeX to produce DVI files, convert to postscript (dvips), then convert to pdf
    3. use (La)Tex to produce DVI files, then use dvipdfm to convert to PDF.
    dvipdfm is well documented and FREE, so you should be able to see how to create a PDF file. Of course, the PDF file format is also well documented by Adobe. That's the best source of information on writing pdf files.
    --
    Do you even lift?

    These aren't the 'roids you're looking for.