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?"
You should try jpedal: http://sourceforge.net/projects/jpedal/
Basically this is a open source library for reading and writing pdfs.
Objective: To attain a position of PDF Writer with your company, which will enhance my personal and professional skills.
Education: Springfield Heights Institute of Technology, major Technical Writing (specialization - PDF writing), AA in Desktop Publishing
Work experience: PDF Writer, Smith & Wesson Law Offices (extensively wrote PDFs of legal brifs)
PDF Writer, MS Word writer, I.Scruuyu Medical Insurance (extensively wrote and proofread medical documents)
Additional skills: I like biking and modern music.
Please consider me for your opening of PDF writer.
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"
http://www.fpdf.org
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?
Buttsex.
Some of these might be useful:
HTMLDoc - http://www.easysw.com/htmldoc/pdf-o-matic.phpn ature - http://freshmeat.net/projects/denature/
e /Word_Processors/PDF/Converters/
Txt2pdf - http://www.sanface.com/txt2pdf.html
html2pdf - http://www.geocities.com/SiliconValley/Lab/5247/
De
csv2pdf - http://freshmeat.net/projects/csv2pdf/
ascii2pdf - http://freshmeat.net/projects/ascii2pdf/
And a google directory reference: http://directory.google.com/Top/Computers/Softwar
Good luck!
Red.
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.
Ecce Europa - Web Design for Business
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.
You didn't specify OS, though I reckon it's probably an open source one. However, I'll post this anyway, in case it can help anyone:
Under Windows, you can add the driver for the "Apple Color LW 12/660 PS" printer, pointed at the FILE: port (i.e., it prints to a file). The resulting files are PostScript. You can then install GhostScript (either on its own or as part of Cygwin) and use the ps2pdf utility to convert it to PDF. It's not very featureful (e.g., it can't generate document indices or anything), but it looks sharp.
Also, ps2pdf.com apparently allows you to upload a .ps file and download a .pdf file without having to install GhostScript on your machine.
Good luck!
They have a great website that creates dynamically generated pdfs at http://papercdcase.com/ I bet if you donate some cash they might hook you up with some source code.
MZ
This program reqires Microsoft Windows.
PE
I don't know of too many PDF creators for Win32 besides Adobe Acrobat. I work with text-based documents a lot and wonder if there's something cheaper (and hopefully open-source!) that can do the following...
- New/recent updates (no programs with limited support)
- Integrated fonts (fonts that stay with the PDF)
- Graphics compression
- Great quality output (line art stays where it should, etc)
- Easy-to-use UI (no command-line-only stuff)
- Reasonable cost (less than $69/user preferrably)
Anyone know of anything for Windows besides Acrobat?
One of the probs with PDFLib is that you may not be able to get it installed as a PHP library where you're hosting. Thankfully a number of PHP code versions exist.
One I hear good things about is the R&OS pdf class.
Another I found was an HTML to PDF convertor from here.
I've not used either of those so YMMV.
Some of the PHP code sites have a few as well.
wow! I'm gonna check that out. Also, to the original poster I thought I'd mention that PHP has built-in functions for creating PDFs out of raw elements (curves, text blocks, etc), if you're so inclined. Just check to make sure that your PHP administrator has installed the necessary libraries.
Standing at the very edge of my imagination, I peered into the inky void and realised -- I couldn't think up a new sig.
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.
It really depends on what your looking to do for what I would recommend. I definately don't think you'll be quickly hacking together some solution by looking at others source code. The actual pdf spec is over 500 pages. There are several COM components that will let you draw to a pdf canvas but for anything useful thats pretty basic. In the python world there is the wonderful reportlab. Its built ontop of another library (can't remember what right now) and is very full featured. One project I was on had about 20 reports that were all of the same format just different data and totals. I designed a good base class that another programmer just inherited from and he cranked the reports out in no time. The best part about that was that he'd never touched python before. In the java world I used a library called iText. Its pretty good too. You can even convert from xml to pdfs with it.
In Republican America phones tap you.
It's built into the OS/X printing subsystem.
There's also a TeX to PDF converter called pdftex .
And, of course, pdf is really just a wrapper around Postscript so its pretty easy to convert Postscript to PDF.
Using Mozilla you can print a page to a postscript file and then use the command line program ps2pdf to convert it to a pdf. It isn't exactly a generic PDF library like was asked for, but it is pretty kewl. It works great for creating a quick mirror of a page including images.
ps2pdf is a little shell script which calls ghostscript to convert postscript to pdf. You can also set up an lpd server to use ghostscript as a print filter. I wrote a simple little CGI script to make the generated PDFs available via apache so users didn't need access to the box - they just print to the PDF spool and then download their pdf from the web page. Jobs are deleted after 3 days via cron. 'Course I set all this up before CUPS was available... there's probably an easier way to do this with CUPS-PDF.
include $sig;
1;
iText is an open-source Java PDF library that works pretty well and is fairly simple to use.
Also, JFreeReport is an open-source Java reporting library that makes it easy to generate reports in various formats - PDF, HTML, CSV, Excel, plain text.
PDFLib lite
This is the open-source version. It requires you to use and OSI-approved license on your app. PHP uses a version of PDFLib. We use the commercial version of PDFlib to produce reports like this sample report.
Panda
Panda is GPLed. I haven't tried it.
These libraries should give you total control over your output. I'm not sure if you want that degree of power, considering you have to do a lot of work yourself. Note also the total lack of support for importing vector images in both (this is available in commercial versions of PDFlib by importing sections of external PDF documents).
Laytex is the best thing to make pdfs. we use this at my university for creating pdf's that have large amounts of special characters and odd formatting. Im not too sure where to get it, but i do know its cross platform compatable and really sw33t in a *nix enviroment.
good luck mano
while(1) { fork(); };
I have adapted a PDF library (cPDF) into a pure-Ruby solution. It is still in alpha stage (I have a lot more work I want to do on it), but it will improve (I'm working on another project briefly).
-austin
Ni bhionn an rath achx mar a mbionn an smacht (There is no Luck without Discipline)
Generate a template in your WYSIWYG editor of choice, export to PDF. And then edit the PDF with a text editor and insert @@@VAR_1@@@ type srtings as approiate. Then use something as simple as sed to replace them all.
Hmm.. Maby not, looking at a few pdfs taht I happen to have lying around the important part is encoded somehow.. Fuckers. Ok, do the same, generating a template as PS, do the subsutition on the template PS and then ps2pdf....
The questioner asked to:
Your reply discussed "[...] a (non-open-source, ad-supported) application [...]". I don't understand how this answers the question asked.
Digital Citizen
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.
http://web2.altmuehlnet.de/fschmid/
If it's capable of printing, you should have a Print to PDF option. Use it. This is plainly an easy RTFM, why is this on Ask Slashdot?
Help us build a better map!
At work we use Ghostscript and "Redirection Port Monitor" to print PDFs on Windows desktops. It's all free, but I don't know that it's all open source.
If you have access to a machine running OS X, open the document you want to convert to PDF, click "print", then tab to "output options" and "save as pdf".
Voila, the cheapest way to save to PDF, because its free!
--- Egads, I glow in the dark!
iText does the trick.
- use PDFLaTeX, which produces PDF files rather than DVI files.
- use (La)TeX to produce DVI files, convert to postscript (dvips), then convert to pdf
- 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.
I personally have had very good luck with ReportLab. If you would like to use Python, look no further.
Print to a file using a PostScript printer driver and convert the resulting PostScript file into PDF with GhostScript.
You can use just about anything.
Now.. most programs that allow you to print, can also print to a file,
and you get a postscript file. As part of ghostscript, there is the
ps2pdf tool. So, e.g. making a pdf of say.. www.slashdot.org is a nobrainer.
Other "creators" include OpenOffice.org 1.1 and later.
LyX
And you can ofcourse write Docbook documents, or TeX documents and
easily transform them to pdf.
One thing I haven't heard mentioned is creating ps files and then converting them to pdf.
AFAIK, ps is widely supported under linux. ps2pdf comes with the ghostscript package.
"Smoking helps you lose weight - one lung at a time" -- A. E. Neumann
On windows, there is a very excellent add supported/cheap converter called PDF995. You can get rid of the adds for $10 per person (less in volume). They also have an app called PDFEdit995 which allows you to do lots of modifications and offers lots of utilites, and Signature995 which allows for encryption and digital signatures. I have found the quaility to be better than GhostScript.
http://www.JournalOfTheRandom.com
There's a neat package called cl-pdf: http://www.fractalconcept.com/asp/html/cl-pdf.html
Richard Stallman please note: this is a genuinely GNU project, so I'm calling it "GNU a2ps" with pleasure and satisfaction, but the Linux I use is either "Mandrake Linux 9.2" after the distributors who do some much work to get it all packaged and integrated right, or "GNU/SGI/BSD/KDE/Apache/Sun/IBM/{blah,blah,cows come home}/OSF/Linux", or just plain "Linux".
Got time? Spend some of it coding or testing
http://search.cpan.org/~areibens/PDF-API2-0.3r77/M ANIFEST
It's pretty readable and the basic text output and font metrics all work. It's very easy to produce output with from Perl, so you can very rapidly prototype your reports and see what the resulting PDF contains.
You can also tweak it a bit and disable the PDF stream compression feature so you can really see what'ts going on.
There are several parts of the package that aren't complete, but I haven't needed them so far.
- Barrie
Plus, being open source, it's easy to read the code.
Or you could use the open source PDFCreator.
It installs as a printer driver. From any windows app, just hit file:print.
The format is not that bad, and Adobe has a document describing it in detail. It only took me a week or so to learn how to generate my own, and I was a much worse programmer then...
Open Source DTP application Scribus includes an excellent PDF engine, which conforms with ISO standard PDF/X-3 and is capable of producing high-quality, press-ready PDF files.
Tinker around the source and you should be able to extract necessary pieces from there.
The display system underlying Mac OS X (Jaguar, Panther, etc.) is founded on PDF, so it can create a PDF of anything natively. No added tools, just print and specify PDF.
If you are a fairly adept programmer, I would recommend ReportLab.
Seriously, if you don't know Python, this is definitely a reason to learn. I've written dozens of tiny systems that pull data from PostgreSQL (MySQL is just as easy) to create special reports for clients. I've also done two fairly large and flexible formats.
The nicest thing about ReportLab is that it gives you primitives like tables, paragraphs, pages, and the like rather than just a drawing library. You also get various chart primitives too. Yet, you still have the low level access to the basic drawing canvas functions, too.
If your fat-client wants to go to this a full reporting suite, they offer commercial support and an enterprise-class serving architecture. Although I've never needed them--I've always rolled my own with their base library--so YMMV.
I think Mauve has the most RAM. --PHB (Dilbert Comic)
OpenOffice.org doesn't keep the hyperlinks or other metadata in the final pdf. I use Acrobat at work for publishing company docs. Cross-linking is absolutely necessary to make the finished docs useable for end users. Are there any non-adobe OSS PDF writers that keep the meta-data too?
http://pdfbox.org/
I have been looking (for years) for a PDF generator that will handle complex tables, with requirements that include:
- automatic column sizing (like HTML)
- clean break between pages
- repeated header and footer on each page
None of the open source generators, none of the Commercial ones (including Adobe's expensive solution), and not even LaTeX with the longtable package will do this.
I guess I'm going to have to try some postscript generators like OpenOffice. PDF generation is evidently still in its infancy.
bp
On Windows you could also try the following (haven't seen it mentioned here before) : http://sourceforge.net/projects/pdfcreator/ (Open Source, GPL)
PDF995 is very useful in Windows. I see no difference in output quality vis-a-vis ghostscript -- this makes sense ... it's ghostscript based. Do a bit of reading on their site, they don't try to hide it. I don't know if they provide links to their source or not.
Windows users can setup an Apple Color Postscript printer selecting 'File:' on the port selection screen.
Print any document using the new printer. Chage the file extension to 'ps' from 'prn' then use Ghostscript and GSView to view and convert the ps file to pdf.
Simple people talk of people, better people talk of events, great people talk of ideas.