Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

PDF Writers?

Cliff posted more than 10 years ago | from the reports-are-a-PHBs-best-friend dept.

Printer 94

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?"

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered


Jpedal (1)

etedronai (35656) | more than 10 years ago | (#7305784)

You should try jpedal: http://sourceforge.net/projects/jpedal/

Basically this is a open source library for reading and writing pdfs.

PDFCreator (1)

Oopsz (127422) | more than 9 years ago | (#7310426)

Or you could use the open source PDFCreator [sourceforge.net] .

It installs as a printer driver. From any windows app, just hit file:print.

Re:PDFCreator (1)

bhtooefr (649901) | more than 10 years ago | (#7323654)

Or you could RTFA:

I found one, here [sourceforge.net] .

BTW, this is the one I use when I'm not using SO7, and I need a PDF.

PDF Writer (1, Funny)

Anonymous Coward | more than 10 years ago | (#7305787)

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 (4, Informative)

benjamindees (441808) | more than 10 years ago | (#7305795)

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

Re:CUPS (1)

i.r.id10t (595143) | more than 10 years ago | (#7306169)

You can also setup a fake printer under samba. Send it postscript information, and it will write out to a ps file then use ps2pdf on it. Works great. Use any PS printer driver (color of course if you want color pdfs) and install it. When you print, it can output the resulting file into a share somewhere the user can access. Really creative scripting can get it to be either emailed to the user who printed it...

Re:CUPS (1)

saden1 (581102) | more than 10 years ago | (#7306669)

Nice solution but is it elegant? Is it efficient? I can tell you for experience that going through Postscript to get to PDF will sooner or later turn into a nightmare.

It is truly time to kill postscript and standardize on PDF (good luck to Microsoft with their InfoPath).

Re:CUPS (1)

raju1kabir (251972) | more than 9 years ago | (#7308988)

Nice solution but is it elegant? Is it efficient? I can tell you for experience that going through Postscript to get to PDF will sooner or later turn into a nightmare.

When? Why? It's worked great for me for a decade, including documents of substantial size and complexity.

Re:CUPS (1)

saden1 (581102) | more than 10 years ago | (#7311336)

See we develop large maintenance manuals and our current processes produces PS files the size of 10 gigs. We have to take those files and convert them into PDF files. Once they are converted to PDF files, we can't delete the PS until we have verified that the conversion precesses didn't introduce glitches (which it tends to sometimes).

Plus PS files are much bigger than PDF files. If you ever encounter a PS file bigger than 2048MB you are in deep dodo. Can't produce PDF files from it without having to split the PS file first then generate PDF files from it, then merge those PDF files. As you can see there lots of processing involved.

Our next system will generate PDF files from the onset. No middle man PS files. We will cut our production time from 6 days to 2 days.

Re:CUPS (1)

raju1kabir (251972) | more than 10 years ago | (#7312487)

Plus PS files are much bigger than PDF files.

Small ones are, but not necessarily large ones - depends on what you're doing.

Sounds like the work you do is a lot of B&W where the bulk of data is text positioning.

My experience comes from the glossy magazine world (managed transfer to all-digital production at a magazine on almost every newsstand in the USA). Worked with documents of similar size to yours, but fewer pages I'm sure. Most of the data was color images, which don't necessarily get much smaller in PDF unless you're throwing away quality (which we couldn't, and if we did, it was done in Photoshop long before any PostScript was generated). Also some processes don't generate compressed PS, but there's no good reason not to.

Anyway, the nightmare never came. We used PDFs for proofing and rarely if ever encountered problems.

Re:CUPS (0)

Anonymous Coward | more than 10 years ago | (#7313353)

You're not using LaTeX. I routinely go from latex source to pdfs using pdflatex.

Re:CUPS (1)

mirabilos (219607) | more than 9 years ago | (#7307608)

For Unix/BSD lpd system, you can actually use
ghostscript as printer filter (if=) in printcap(5),
and use that printer to print from samba.
No need to manually throw it to ps2pdf for that.
I just can't find the posting now where I first
read about it.

fpdf.org (4, Informative)

Bonewalker (631203) | more than 10 years ago | (#7305837)

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.


PHP (1)

Paul d'Aoust (679461) | more than 10 years ago | (#7306001)

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.

Re:PHP (1)

raju1kabir (251972) | more than 9 years ago | (#7309022)

PHP has built-in functions for creating PDFs out of raw elements (curves, text blocks, etc)

Keep in mind that PDFlib is non-free except for personal use.

Re:fpdf.org (1)

stonebeat.org (562495) | more than 10 years ago | (#7306337)

i think this maybe exactly what i was looking for. Thanks for the URL.
It supports links and page breaks. those were 2 of my major requirements.

Re:fpdf.org (1)

exhilaration (587191) | more than 10 years ago | (#7306678)

I'd like to second that. I'm pulling data from Oracle and dynamically generating letters using FPDF, backing them up, and then sending them to a printer. FPDF gave me the pixel-level precision required to copy the customer's layout. It also handles graphics very well - I'm placing the client's logo on each page.

OpenOffice (3, Informative)

Drakon (414580) | more than 10 years ago | (#7305839)

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?

Re:OpenOffice (1)

sysadmn (29788) | more than 10 years ago | (#7313561)

You're missing something. He said "fat client", not "obscenely bloated obese application shoehorned into a fat client".

OpenOffice doesn't keep links! (1)

mabhatter654 (561290) | more than 10 years ago | (#7316393)

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?

PDF Converters (4, Informative)

RedPhoenix (124662) | more than 10 years ago | (#7305841)

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!


Re:PDF Converters (2, Informative)

saden1 (581102) | more than 10 years ago | (#7306706)

Add iText [lowagie.com] 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?

Re:PDF Converters (1)

addaon (41825) | more than 10 years ago | (#7306987)

Beware gcj native code generation for exceptions. Be very very ware... it's about 100,000 times slower than java, for reasons that are totally beyond my comprehension. Milliseconds to handle a single thrown exception.

GNU a2ps rocks! (1)

leonbrooks (8043) | more than 9 years ago | (#7307562)

http://www.infres.enst.fr/~demaille/a2ps/ [infres.enst.fr]

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".

None of them do what I want (1)

Black Perl (12686) | more than 10 years ago | (#7322946)

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.

XO? FO? (2, Informative)

cookiepus (154655) | more than 10 years ago | (#7305846)

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. ;-)

Re:XO? FO? (1)

cookiepus (154655) | more than 10 years ago | (#7306248)

The name is FOP. I remember now. Of course a higher-rated comment by Mulligan tells you the same now.

ps2pdf (3, Informative)

GiMP (10923) | more than 10 years ago | (#7305926)

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.

Re:ps2pdf (1)

stonebeat.org (562495) | more than 10 years ago | (#7306179)

one problem with this solution is that, I will lose the ability to have hyperlinks in the document. (i think). correct me if i m wrong.

Re:ps2pdf (1)

exhilaration (587191) | more than 10 years ago | (#7306685)

You're correct, ps2pdf uses the Ghostscript engine, which does not yet support links (AFAIK).

Actually, PostScript doesn't support links anyway, so you'll lose them as soon as you printed to PS.

Re:ps2pdf (1)

rmull (26174) | more than 9 years ago | (#7307011)

You *may* be wrong. I've been able to run a toolchain of doxygen|latex|ps2pdf and end up with a hyperlinked pdf with a bookmared index. But I have no comprehension of how this works. I don't know why I didn't use pdflatex, but I very clearly remember this working.

ps2pdf (1)

qeloi (313191) | more than 10 years ago | (#7305947)

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 [wisc.edu] (either on its own or as part of Cygwin [cygwin.com] ) 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 [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!

Re:ps2pdf (1)

Paul d'Aoust (679461) | more than 10 years ago | (#7306029)

PDF995 [pdf995.com] is a (non-open-source, ad-supported) application that sits between your Windows printer driver and ps2pdf, and streamlines the process. I love it... it's made out of open-source parts, but it's not open-source itself though. sorry. ^_^

Actually, PDF995 sounds a lot like PDFCreator; I'm gonna check PDFCreator out.

I guess the problem with a solution like PDF995, ps2pdf, and PDFCreator is that they're not complete tools that would bridge your gap between SQL queries and finished PDF... probably the best bet is to install PHP for Windows, along with the LDF libraries.

Re:ps2pdf (1)

Anml4ixoye (264762) | more than 10 years ago | (#7306134)

Will second this. We just deployed it out to over 5000 users for use as their primary PDF program. Works like a charm, and was much cheaper than Acrobat.

Of course, doesn't allow for editing of the document, but all we needed was just a way for users to create PDFs.

Proprietary software is hard to learn from. (1)

jbn-o (555068) | more than 10 years ago | (#7306217)

The questioner asked 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?"

Your reply discussed "[...] a (non-open-source, ad-supported) application [...]". I don't understand how this answers the question asked.

Re:Proprietary software is hard to learn from. (1)

Paul d'Aoust (679461) | more than 10 years ago | (#7306425)

Whoops. didn't see the part where the questioner asked about being able to see the source code. I guess I just wanted to mention PDF995 to the world-at-large... actually, I knew that my answer wasn't gonna answer the guy's question... that's why I said "sorry" to him in my post.

Mod me OT if you like, but I was aware I was slightly OT in the first place.

Windows Apps? (1)

L33tMafia187 (718926) | more than 10 years ago | (#7305957)

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?

Re:Windows Apps? (1)

rikennedy (150056) | more than 10 years ago | (#7306578)

Searching Google for "PDF printer" yields a few promising results. One is Expert PDF 2 [visagesoft.com] . The standard edition appears to include the integrated-font and graphic-compression features you want. I've never heard of it before.

On Windows 2000, I use RedMon [wisc.edu] in conjunction with Ghostscript [wisc.edu] . RedMon is a generic port redirector, but it includes instructions on piping Postscript output from any Windows program into Ghostscript, which can export PDFs.

I don't know what RedMon's support system is like, but on the other hand, I haven't really needed it since it worked right away -- at least the first time, anyway.

I believe that if your printer driveris configured to include the fonts in its output, then Ghostscript will include them. It can compress graphics, and line art does not get pixelated.

Setting up Ghostscript for this purpose is simple; just accept the installer's defaults. RedMon is a little trickier since you need to set up the redirected port, the PDF script, and the printer driver yourself. It's not rocket science, but it's hardly the pinnacle of convenience, either.

When you print something on the indicated printer, a file-selection dialog box appears to prompt for the PDF destination file. Enter a file name (with the extension -- there are no defaults), and you're finished.

As I mentioned above, everything worked fine for me on Windows 2000. Windows XP is another story. RedMon seems to have problems with fast user switching. I think the file-selection dialog always appears on the first desktop, which isn't necessarily the desktop of the currently active user. The source appears to contain code to account for multiple desktops, but it's commented out, and I really haven't felt like tinkering with to investigate further.

RedMon and Ghostscript have all the functionality, but the system lacks the polish of a professional product. On the other hand, you can't beat the price, and it's not Acrobat.

Re:Windows Apps? (1)

jilles (20976) | more than 9 years ago | (#7307616)

I use redmon + ghostscript under XP. It's a workable solution but far from perfect. When redmon pops up a save dialog for the pdf it is always below the application from which you print. Sometimes it does not appear at all. If this happens it means you have to reboot (or at least log out) to be able to print your document to it (or anything else). Probably there's a better solution but this is the easiest way to solve the problem. If it works you get a nice pdf but without features such as a table of contents etc.

Re:Windows Apps? (1)

exhilaration (587191) | more than 10 years ago | (#7306683)

Take a look at CutePDF [acrosoftware.com] - they stuffed GhostScript into a Windows print driver. It's worked well with the things I've thrown at it. It's also free and GPL.

Re:Windows Apps? (1)

bhtooefr (649901) | more than 10 years ago | (#7323866)

Hmm, let's try a Word doc in both CutePDF and PDFCreator (the two best free apps, and both based in GhostScript, bar none - I expect the only differences to be in UI, seeing as they ARE both GS based):

CutePDF Install Process: Fail VERY quickly (can't get through WZSE (Error 0 running SETUP.EXE)
Hand unzipped (nobody would think of this) into C:\cuteprintertemp.
Installer crashed my print spooler.

PDFCreator Install Process: I think it worked right, but I forget...

CutePDF: Ease of use (according to help file is braindead level (click print, save file).
However, I uninstalled it ASAP, so no testing.

PDFCreator: HORRIBLE UI, but it works rather nicely. (no test results - I'm not rebooting yet)

Re:Windows Apps? (1)

Oopsz (127422) | more than 9 years ago | (#7310410)


Open source, windows pdf writer driver. Just select print, PDFCreator, save.

PHP only versions (1)

Internet Ninja (20767) | more than 10 years ago | (#7305992)

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 [ros.co.nz] .

Another I found was an HTML to PDF convertor from here [rustyparts.com] .

I've not used either of those so YMMV.

Some of the PHP code sites have a few [phpclasses.org] as well.

XML - FO - PDF (3, Interesting)

Mulligan (29951) | more than 10 years ago | (#7306005)

My current favorite for PDF generation is to build an XML [w3.org] document programatically. This document has no layout information, so I use Saxon [sourceforge.net] and an XSLT [w3.org] stylesheet to translate it to XSL Formatting Objects [w3.org] . From there, I use FOP [apache.org] 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.

Re:XML - FO - PDF (2, Insightful)

pi_rules (123171) | more than 10 years ago | (#7306508)

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.

Re:XML - FO - PDF (1)

Betcour (50623) | more than 9 years ago | (#7307298)

It looks like a nice solution in theory. Byt XML-FO is a whole language by itself and add to this the complexity of the XSLT language, and you are looking at two new XML linguo to learn just to generate PDF... ugh !

Type of output (1)

Samus (1382) | more than 10 years ago | (#7306034)

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.

Any OS/X app which can print can write PDFs. (1)

Mordant (138460) | more than 10 years ago | (#7306043)

It's built into the OS/X printing subsystem.

Re:Any OS/X app which can print can write PDFs. (1)

IM6100 (692796) | more than 10 years ago | (#7306435)

Are there any suggestions for MacOS 9.2.1?

I run that on my aging beige G3 and miss the functionality that I have on W2K with Adobe Acrobat. My Acrobat is way out of date, too, now, at 4.0 but I refuse to throw more money at them.

Re:Any OS/X app which can print can write PDFs. (1)

L33tMafia187 (718926) | more than 10 years ago | (#7306446)

you mean you actually got Acrobat installed on a Mac? In less than 20 minutes?!?

FOP (1)

jefu (53450) | more than 10 years ago | (#7306056)

The apache fop [apache.org] is an XMLFO to pdf converter. Quite nice actually.

There's also a TeX to PDF converter called pdftex [tug.org] .

And, of course, pdf is really just a wrapper around Postscript so its pretty easy to convert Postscript to PDF.

Use Mozilla convert HTML to PDF (1)

DeadSea (69598) | more than 10 years ago | (#7306058)

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.

Ghostscript (1)

Linux_ho (205887) | more than 10 years ago | (#7306088)

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.

iText and/or JFreeReport (1)

jwells (305970) | more than 10 years ago | (#7306118)

iText [lowagie.com] is an open-source Java PDF library that works pretty well and is fairly simple to use.

Also, JFreeReport [jfree.org] is an open-source Java reporting library that makes it easy to generate reports in various formats - PDF, HTML, CSV, Excel, plain text.

Re:iText and/or JFreeReport (1)

filenabber (628550) | more than 10 years ago | (#7318188)

iText is great - I just started using it myself about a week ago in one of my projects (see link in sig) and it took me no time at all to output some nice PDFs.


Sure (1)

Webmonger (24302) | more than 10 years ago | (#7306138)

PDFLib lite [pdflib.com]
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 [panoramicfeedback.com] .

Panda [stillhq.com]
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 (1)

Tr0mBoNe- (708581) | more than 10 years ago | (#7306163)

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

Re:Laytex (0)

Anonymous Coward | more than 10 years ago | (#7313550)

I installed teTeX on my LFS system. It works great. It totally replaced the pitifulness that is MS-Office, and it's a hundred times easier to input technical symbols via a keyboard shortcut than with a series of mouse clicks.

Ruby PDF Writing (1)

aziegler (201013) | more than 10 years ago | (#7306172)

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).


Use it as a 'form' and embed replacement strings (1)

T-Ranger (10520) | more than 10 years ago | (#7306211)

Your outputting some kind of report that needs exact formating right?
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....

There are so many solutions... (2, Insightful)

Karora (214807) | more than 10 years ago | (#7306359)

In PHP I use pdf-php [sourceforge.net] , 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.

Not sure if this helps (1)

Kris_J (10111) | more than 10 years ago | (#7306662)

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 OS X... (1)

Randy Wang (700248) | more than 10 years ago | (#7306708)

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!

Re:If you have access to OS X... (0)

Anonymous Coward | more than 10 years ago | (#7313560)

Voila, the cheapest way to save to PDF, because its free!

\footnotesize{OSX is included in a non seperable package with overpriced, underpowered hardware suitable for an art school display or old women who need to use email.}

Re:If you have access to OS X... (1)

Randy Wang (700248) | more than 10 years ago | (#7336258)

I didn't say to pay for it specifically to create PDFs.

More to the point, its pretty depressing when people are willing to have raging rows over another's product choice.

iText (0)

Anonymous Coward | more than 10 years ago | (#7306717)

iText [lowagie.com] does the trick.

TeX! (2, Troll)

larry bagina (561269) | more than 10 years ago | (#7306884)

if you want pdfs that don't look like goatse's [goatse.cx] 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.

This is so-o-o simple.... (1)

Sam Lowry (254040) | more than 9 years ago | (#7307121)

Print to a file using a PostScript printer driver and convert the resulting PostScript file into PDF with GhostScript.

Anything.. (1)

noselasd (594905) | more than 9 years ago | (#7307314)

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.
And you can ofcourse write Docbook documents, or TeX documents and
easily transform them to pdf.

ps2pdf? (1)

Unominous Coward (651680) | more than 9 years ago | (#7307503)

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.

PDF995 (1)

Tephyrnex (232906) | more than 9 years ago | (#7307518)

On windows, there is a very excellent add supported/cheap converter called PDF995 [pdf995.com] . 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.

Re:PDF995 is based on ghostscript! (0)

Anonymous Coward | more than 10 years ago | (#7330092)

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.

cl-pdf (0)

Anonymous Coward | more than 9 years ago | (#7307556)

There's a neat package called cl-pdf: http://www.fractalconcept.com/asp/html/cl-pdf.html

PDF::API2 (1)

barries (15577) | more than 9 years ago | (#7307701)

There's a good Perl package PDF::API2, you can scan the source at:

http://search.cpan.org/~areibens/PDF-API2-0.3r77/M ANIFEST [cpan.org]

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

Reportlab (1)

Phronesis (175966) | more than 9 years ago | (#7309222)

It may not be what you're looking for because it's an API more than a PDF-writing application, but Reportlab [sourceforge.net] is a great high-level pdf-writing API for python. It's quite easy to write scripts to query DBs and generate good reports. It's also great for charting/graphics. It includes great documentation and lots of example code.

Plus, being open source, it's easy to read the code.

The format... (1)

Tom7 (102298) | more than 9 years ago | (#7310720)

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

Use Scribus' PDF engine (1)

whitmer (142924) | more than 10 years ago | (#7312998)

Open Source DTP application Scribus [planetmirror.com] 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.

Mac OS X (1)

hwestiii (11787) | more than 10 years ago | (#7313272)

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.

ReportLab is Perfect For This (1)

KagatoLNX (141673) | more than 10 years ago | (#7314907)

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.

JAVA based solution! (1)

perf_monkey (719198) | more than 10 years ago | (#7317467)

I'm sure someone has already mentioned this but pdfbox is a great api. I've used this java package in one my projects already.


PDFCreator (1)

wimvds (615170) | more than 10 years ago | (#7326649)

On Windows you could also try the following (haven't seen it mentioned here before) : http://sourceforge.net/projects/pdfcreator/ (Open Source, GPL)

Use apple color ps in windows (1)

chrisatslashdot (221127) | more than 10 years ago | (#7418044)

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.

Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account