Slashdot Mirror


Ask Slashdot: Best PDF Handling Library?

New submitter Fotis Georgatos (3006465) writes I recently engaged in a conversation about handling PDF texts for a range of needs, such as creation, manipulation, merging, text extraction and searching, digital signing etc etc. A couple of potential picks popped up (PDFBox, itext), given some Java experience of the other fellows. And then comes the reality of choosing software as a long term knowledge investment! ideally, we would like to combine these features:
  • open source, with a community following ; the kind of stuff Slashdotters would prefer
  • tidy software architecture; simple things should remain simple
  • allow open API allowing usage across many languages (say: Python & Java)
  • clear licensing status, not estranging future commercial use
  • serious multilingual & font support
  • PDF-handling rich features, not limiting usage for invoicing, e-commerce, reports & data mining
  • digital signing should not go against other features

I'd like to poll the collective Slashdot crowd wisdom about if/which PDF related libraries, they have written software with, keeps them happy for *all* the above reasons. And if not happy with that all, what do they thing is the best bet for learning one piece of software in the area, with great reusability across different circumstances and little need for extra hacks? I'd really like to hear the smoked out war stories. It is easy to obtain a list of such libraries, yet tricky to understand whethe people have obtained success with them!

132 comments

  1. Why? by Anonymous Coward · · Score: 0

    open source, with a community following ;

    Why?
    So if you find one that fits every other requirement but this one you will refuse to use it?

    1. Re: Why? by Anonymous Coward · · Score: 2, Insightful

      To be fair the OP does say "ideally."

    2. Re:Why? by Stumbles · · Score: 1

      Because those are hisrequirements and there is nothing wrong with that but it is to you so don't use open source. See your problem is solved.

      --
      My karma is not a Chameleon.
    3. Re:Why? by Anonymous Coward · · Score: 0

      Indeed. I'm curious why is not "closed source, with a strong industry support" an option?

    4. Re:Why? by Anonymous Coward · · Score: 0

      Some people have principles.

    5. Re:Why? by Anonymous Coward · · Score: 1, Insightful

      Yes ... and their principles are; I want somebody else to do a lot of hard work and I want the benefit for free. Oh, and I don't even want to research this myself, I want others to do the work ... for free.

    6. Re:Why? by Anonymous Coward · · Score: 0

      Yes ... and their principles are

      Followed by straw men.

      Their principles are that the source should be available and that people should have certain freedoms so that no one is beholden to a specific company for updates or modifications, and they can release their changes to the code so that everyone else can benefit too.

      Want to try your hand at writing another nonsensical troll post?

    7. Re:Why? by Bill,+Shooter+of+Bul · · Score: 1, Funny

      Well, he's dealing with PDFs, so he doesn't have *strong* principles.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    8. Re:Why? by burne · · Score: 1

      Other people have politicians that require you to use open source if available.

    9. Re:Why? by kelemvor4 · · Score: 2

      open source, with a community following ;

      Why? So if you find one that fits every other requirement but this one you will refuse to use it?

      Derp,

      Probably because if there is no community following it there is not going to be much in the way of development going on.

    10. Re:Why? by Anonymous Coward · · Score: 0

      Some people have principles.

      at least as long as they're getting schooled...

    11. Re:Why? by Wycliffe · · Score: 2

      Indeed. I'm curious why is not "closed source, with a strong industry support" an option?

      Because both "open source" and "strong industry support" when put together like that pretty
      much means that they don't want to get stuck holding the bag if the company goes out of business.
      With "strong industry support" the odds of a company going out of business is minimized and
      with "open source" even if it does go out of business then you can still continue to use the
      software indefinitely while you look for a replacement.

    12. Re:Why? by Animats · · Score: 1

      Probably because if there is no community following it there is not going to be much in the way of development going on.

      Right. With mid-tier open source projects, there's a good chance they're either unfinished or abandonware. (Lower-tier open source projects are both.) There's only so much attention available.

    13. Re:Why? by nine-times · · Score: 1

      PDF isn't so bad, is it? It's an open standard with open source implementations, with open/royalty-free licensing for the patents involved. Or am I missing something?

    14. Re:Why? by Anonymous Coward · · Score: 0

      Which gets used incorrectly most of the time. Specially if you need to extract data from it

    15. Re:Why? by wonkey_monkey · · Score: 1

      Specially if you need to extract data from it

      That's not what it's for, is it? Except by the method of reading, with your eyes.

      --
      systemd is Roko's Basilisk.
    16. Re:Why? by Rob+Y. · · Score: 3, Interesting

      I'm using a non-free, but source-provided library called Clib-PDF. It's a pretty nice library with a pretty easy API, and even has PHP bindings (so it must've been a viable mainstream choice at one point). But somehow the company (or was it just a single guy) disappeared years ago. Luckily, we paid for and got the source, and I've been able to keep using it (and even fixing things in the source) without any ongoing support. So not quite open source, but not quite the disaster of discontinued closed source.

      I suspect that the author of this library sold it to one of the commercial companies who proceeded to shut down a viable competitor. But who knows...

      --
      Posted from my Android phone. Oh, I can change this? There, that's better...
    17. Re:Why? by Chrisq · · Score: 2

      Some people have principles.

      He could be working on an open source project

    18. Re:Why? by znrt · · Score: 0

      Indeed. I'm curious why is not "closed source, with a strong industry support" an option?

      i guess because he knows what kind of crap *that* can be.

      of course his full requirement list is ridiculous, nevertheless as a request to the community on a public forum. anything else? this dude is just looking for someone else wanting to do his fucking job, but he also wants a medal for it (read: a tap on the shoulder). likely he *is* in a "closed source, with a strong industry support" environment, so screw him.

    19. Re:Why? by NJRoadfan · · Score: 2

      Adobe pushes PDF as a method of data collection. People make fancy PDF forms and e-mail them out. Inside of the form is a button that says "when complete, click here to submit form" which attaches the filled out form to an e-mail and sends it back to the publisher. From there, folks somehow extract the fields from the file and dump it into a database, which seems like a messy and complicated process. Honestly a web form would be easier to implement in many cases.

    20. Re:Why? by LesFerg · · Score: 1

      Oh, and I don't even want to research this myself, I want others to do the work ... for free.

      Thats a bit unfair. I had a need to convert some output into PDF a while back and started looking thru the many proprietary and open source options, and there were a lot to choose from. It was awfully hard to determine which were quality and which weren't. Installing and trying to program a working solution against each API would have taken up a huge amount of time. There is nothing at all wrong with asking if others have been thru some of that process and found a favorite. I certainly would have liked to see some comparisons or good product reviews to help me decide.

      Also, one thing I started to suspect; a number of the supposedly proprietary PDF tools and API's that I investigated appeared to just be a GUI and some wrappings around a GPL PDF library, usually Ghostscript, with little or no attribution given. Once again, there is nothing wrong with asking for other peoples experience with these tools and libraries; you don't want to find out you have breached GPL licensing AFTER you have created your solution, do you?

      --
      If I had a DeLorean... I would probably only drive it from time to time.
    21. Re:Why? by Anonymous Coward · · Score: 1

      How open is it really?

      Is it a true open standard like TCP/IP, or more like a rubberstamped "standard" by a single company like OOXML?

      What prevents Adobe from adding incompatible features to Acrobat and Adobe Reader, and thus make the PDF unreadable by software that adheres to the so-called standard? For example, last year, I could connect to the danish tax department from my Linux machine, using standard TCP/IP, only to be told that to view my tax returns I would have to install Adobe Reader.

      Never have I been told "just buy a computer running Berkely Unix" when asking about TCP/IP, but every time I've asked about opening a PDF file, I've been told to just install Adobe Reader, even though I'm convinced that no computer exists powerful enough to actually run (as opposed to crawl) that peace of crap.

    22. Re:Why? by Anonymous Coward · · Score: 0

      Adobe pushes PDF as a method of data collection. People make fancy PDF forms and e-mail them out. Inside of the form is a button that says "when complete, click here to submit form" which attaches the filled out form to an e-mail and sends it back to the publisher. From there, folks somehow extract the fields from the file and dump it into a database, which seems like a messy and complicated process. Honestly a web form would be easier to implement in many cases.

      While this function is available, I've never been under the impression that it's widely used. In real life, the only time I've ever seen PDF form-filling capabilities used is in cases where the expected route of processing the form is to have it go through exactly the same process as hand-filled forms. In many cases, the end user is expected to print and return a hard copy of the form.

    23. Re:Why? by TheRaven64 · · Score: 1

      PDF is a family of standards. There's a core specification and a set of extensions (including, somewhat confusingly, some that remove functionality). In particular, PDF/A removes some of the crazy things (embedded video, audio and JavaScript) and is intended for archiving. Adobe is the driving force behind the standard, and do add non-standard things to their tools (although via a well-defined extension interface), but they're very careful to differentiate PDF/A because a lot of their deep-pocketed customers care a lot about PDF/A as a long-term archive medium. The vested interests of various governments in PDF/A mean that Adobe will have a hard time pushing things through ISO that would be bad for the standard.

      --
      I am TheRaven on Soylent News
    24. Re:Why? by Anonymous Coward · · Score: 0

      open standard or not, the real bitch is going back from PDF to something AND retaining all the formatting IF the document uses anything other than a single column and simple tables, etc.

      The way that I look at PDF is that it's a one way ticket unless you have the original document which was hopefully created in some other format and THEN converted to a PDF...

      This is kind of surprising as isn't PDF just a postscript subset compressed? There are alot of decent postscript manipulation engines, but I guess that they rely on the programmable aspects of postscript, which is part of the stuff that PDF drops from postscript IIRC... been a VERY long time since I looked at this so I might not even be close to accurate about what PDF is, but I still know that no PDF->something works usefully on anything beyond a bog simple PDF document...

    25. Re:Why? by Bill,+Shooter+of+Bul · · Score: 1

      I think that means you haven't seen enough PDFS. Adobe makes heavy use of proprietary add ons that only work with Adobe products. Then there are all the security vulnerabilities they can contain.

      PDFS are great for internal use, if you create them and you consume them. Dealing with those made by random people kind of sucks. Sometimes you get a pdf that's just composed of images for each page. So no text extraction is possible.

      I'm not recommending any libraries for the original poster, because they all suck in their own ways and none of them do everything necessary. Without knowing what the pdfs are he's dealing with, its tough to really recommend anything.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    26. Re:Why? by kefalonia · · Score: 2

      OP here. Somebody is listening ;-) Nope. It's not how you described it. But thanks to your nice language I need not explain you either :-P

    27. Re:Why? by david_thornley · · Score: 1

      Nothing prevents Adobe from adding incompatible features. In fact, nothing stops Adobe from adding compatible features. We have a use case for U3Ds embedded in PDFs (as per the ISO Standard, 13.6), and I haven't found any PDF reader other than Adobe's that displays that.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    28. Re:Why? by david_thornley · · Score: 1

      Text extraction can be a pain even if the text is not images, due to encodings and text placement. Also, it doesn't take proprietary add-ons to lose all open source viewers I'm aware of: I know of none that support the 3D images in the Standard, chapter 13.6.;

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    29. Re:Why? by kefalonia · · Score: 1

      btw. have you ever heard of LRD? Language Restraint Disorder... I've spotted some examples over here: http://slashdot.org/~znrt

    30. Re:Why? by kefalonia · · Score: 1

      OP here. Your concern is very valid and you are not alone, I have the same concerns. However, at the moment we know of no other standard that actually renders alike among zillions of Desktops, smartphones, automated processing agents etc. Can you really replace .pdf format with something of similar functionality AND not ask the majority of users to install X, Y, Z?

    31. Re:Why? by sjames · · Score: 1

      Any number of reasons. A big one is stability. If it's open source, it won't go *POOF* one day. It won't double in price one day. It won't get an ugly redesign with no ability to stick with the version that worked.

      Then there's the ability to work out the finer points where the documentation was unclear, greater ability to debug any problems

      I can't imagine a good reason that open source with a strong community wouldn't at least be a nice to have for any software.

    32. Re:Why? by znrt · · Score: 1

      your nice language

      please note that the ad hominem in my comment was rethoric. It was actually referring to the content of your article and the attitude it implies. I think it should be obvious but maybe it is worth pointing it out now.

      of course many may have learnt something interesting from the ensuing threads. like with any other discussions. that's the cool thing about fora. but I still find that simply dumping the full set of requirements for your assignement on a public forum isn't professional or nice at all. you can ask what you want but one would expect at least some evidence of effort on your part, too. of course this could be subjective and you might view this differenty. this is just my standard, doesn't necessarily apply to you, so no hard feelings.

      and no, I know nothing about "lrd" and googling produces little of relevance, this even has spurred my curiosity a bit about how it relates to you inspecting my posting history. any clarification would be appreciated. peace :)

  2. ReportLab by Anonymous Coward · · Score: 4, Informative

    Python only, but I've used it successfully.

  3. PDFLib by Anonymous Coward · · Score: 2, Insightful

    Well, there's PDFLib, which is hideously expensive and not open source, but if you're after a professional package for serious purposes that just works I can only recommend it.

    1. Re:PDFLib by Anonymous Coward · · Score: 4, Informative

      PDFlib is cheap compared to licensing Adobe's libraries from DataLogics. (speaking as one who switched from the latter to the former).... A full source license for pdflib and tetlib were much less that Adobe/DataLogics non-source license... less than 1 FTE. Then again, your milage may vary.

      PDFLib happens to be the cleanest and best PDF code solution I've ever worked with.

    2. Re:PDFLib by Anonymous Coward · · Score: 0

      Can it tell me if a chunk of text will fit on the current page with the current font (what is the height of "this text" after wrapping it to X width)? It seems like every PDF library I've ever used has failed to be able to do this one simple thing. The best I've been able to do is to get character widths of each character individually, add them up until I reach the right margin, back up to the previous space (hoping that the library won't hyphenate), add one to the line counter, and continue. Close enough for government work but damn it's a HUGE pain.

    3. Re:PDFLib by DJ+Jones · · Score: 2

      TCPDF Open-source PDF-reader built in PHP
      FPDF Combine with TCPDF above to create a PDF-writer using PHP
      SetAssign Not open-source but this company offers both free and paid libraries that combine with the libraries above to allow PDF encryption / decryption using PHP.- The paid versions support more complex ciphers and I swear by them personally


      Not sure if you meant desktop software or...

    4. Re:PDFLib by Skuld-Chan · · Score: 2

      You know whats funny is PDFLib is what Adobe calls the set of core tech libraries to generate PDF files inside their own apps. (source: used to work at Adobe - on Acrobat no less)

    5. Re:PDFLib by Anonymous Coward · · Score: 0

      Yes. There are various examples like this one: http://www.pdflib.com/en/pdflib-cookbook/text-output/starter-textflow/

      If you want to control it yourself it is possible to define and add the textflow (telling it to not error if it overflows), query it for the size, then delete it if it overflows. You can then move elsewhere to try again. Not an expert so there may be some mistakes or simplifications there but it's basically what our system does when it wants to keep text together in a block.

    6. Re:PDFLib by josecanuc · · Score: 1

      I second this. PDFlib is good software for making PDFs. Their TET tool for extracting text can return to you where (coordinates) each letter on a page is, if you desire, or just dump the whole page or each word at a time, etc.

    7. Re:PDFLib by Anonymous Coward · · Score: 0

      I wrote the above comment about PDFLib's cost...

      Adobe also calls their core library pdflib, but it is not the same as PDFLib GmbH -- once Adobe via Datalogics was debugging a core issue of ours, and had to bring source code, and I saw much of it -- and it is definitely NOT the same as the source for the product I'm talking about, it was some of the most hideous, ugly code i had seen... this was a long time ago, tho, PDF 1.4 and 1.5 era. It is possible that since then Adobe has done what you said...

  4. pdf.js by AntiTuX · · Score: 5, Informative

    pdf.js is great for parsing and manipulating pdfs.

    I can't go into great detail as to how I've used it (Still under NDA), but it's rendering and manipulating of pdfs is pretty darn good.

    As for converting office formats to pdf, your best bet is to use office automation. It can be built to scale up, but it needs a lot of work to do so.

    1. Re:pdf.js by PhrostyMcByte · · Score: 2

      Office Automation is problematic -- because it literally opens up a hidden window of your Office app and simulates clicking around the UI to do what you need, if something unexpected happens it can unhide the window to show the user a message. This might be good enough for a desktop app, but if you're running it on a server it'll just freeze up your process with noone there to click it.

      For Office->PDF conversion of word docs, Aspose.Words has a fairly easy API and generally very accurate rendering. I highly recommend it.

    2. Re:pdf.js by Auction_God · · Score: 3, Informative

      No...it does not simulate clicking. It uses the underlying COM representation to perform its functions. That said, it does not work well in a multi-threaded environment, nor where you can't setup user (e.g. restricted web server credentials). So you either have to impersonate or use COM+ configuration to run the office tool under a different user name. So if you're just starting out...do not use Office automation in a server environment unless you're willing to deal with these issues. Try Aspose as suggested instead.

    3. Re:pdf.js by Jaime2 · · Score: 2

      I wouldn't recommend Office Automation on a server if there is any alternative. For beginners, there's too many gotchas and for advanced users, there's plenty of alternatives that will do what you want without too much difficulty. Office with .Net is especially problematic because the COM components run as out-of-process servers and due to .Net's garbage collection and COM interoperability, they are difficult to get to shut down properly.

  5. I've found these tools useful by jab · · Score: 5, Informative

    I've found these tools useful, with an honorable mention to gnupdf. I've never used it personally, but the code looks pretty solid. That said, when I really needed to produce great multilingual PDF I pulled out the PDF spec, gritted my teeth, and generated it directly.

    leptonica - turn images into PDF
    tesseract - turn images into searchable PDF
    qpdf - linearize PDF for random access over HTTP
    jhove - basic validation
    jhove-pdf-a - validation with better compatibility guarantees
    pdftk - command line tool for splicing pages together or apart
    ttx/FontTools - tool for modifying custom fonts
    reportlab - python library, easy to use but works best with Latin scripts

    1. Re:I've found these tools useful by Anonymous Coward · · Score: 0

      I'll 2nd pdftk. It can generate an FDF from a PDF with an embedded form, you can subsequently do form filling. You can also do stamping if you want a watermark or a tag line at the bottom of each page.

      There are some related command line tools that work well with it, like pdfjam (re-sizing to A4 or LETTER) pdfjoin to do merging.

      One thing pdftk CANNOT do is unicode during form filling. So you are stuck with ascii and some control characters there.

    2. Re:I've found these tools useful by Anonymous Coward · · Score: 0

      I've used pdftk, too, but I believe it is using itext as the underlying library. Also using itext would be ColdFusion.

    3. Re:I've found these tools useful by Daniel+Hoffmann · · Score: 1

      You know any that can convert simple HTML with simple CSS into pdfs? Preferably with support for dataURL in image tags?

    4. Re:I've found these tools useful by Anonymous Coward · · Score: 3, Interesting

      sudo apt-get install wkhtmltopdf
      wkhtmltopdf www.google.com google.com.pdf

    5. Re:I've found these tools useful by Qzukk · · Score: 2

      I have no idea if it supports data: URIs but I've used HTMLDOC to turn html tables into PDF (since every PDF library I've ever used is absolutely shit at tables compared to HTML). It supports inline styles and <style type="text/css"> tags. It's not quite dead, but this year's update was the first since 2006.

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    6. Re:I've found these tools useful by Phoenix+Rising · · Score: 1

      Great tool for HTML conversion. Doesn't meet the OP's criteria, but it's the best open source HTML to PDF converter I've found.

      --
      Let us live so that when we come to die, even the undertaker will be sorry -- Mark Twain
    7. Re:I've found these tools useful by kbg · · Score: 3, Interesting

      Yes the Flying Saucer Java library. It is one of the best XHTML to PDF converstion tool.

    8. Re:I've found these tools useful by Daniel+Hoffmann · · Score: 1

      This library uses iText, unfortunately my projects are closed source and the budget for libraries is zero.

    9. Re:I've found these tools useful by jab · · Score: 1

      I forgot to mention PDF rendering engines. Neither support the entire spec, nor do I blame them.

      poppler - widely used
      pdfium - high performance, recently open sourced

    10. Re:I've found these tools useful by Anonymous Coward · · Score: 0

      RTL scripts, like Arabic in PDF? Are we there yet? It's not a niche thing in 2014 to want to use Arabic in a FLOSS application

    11. Re:I've found these tools useful by udittmer · · Score: 1

      FlyingSaucer uses iText 2, which is licensed under the LGPL - that might maybe make it OK (and free) to use?

    12. Re:I've found these tools useful by Daniel+Hoffmann · · Score: 1

      Hm, if I am not mistaken iText 2 is LGPL so I believe it would work for me. Thanks!

  6. IText by Anonymous Coward · · Score: 1

    You might try IText:
    http://en.wikipedia.org/wiki/IText

    pdftk uses it.

    1. Re:IText by mark-t · · Score: 1

      I would have posted to make the same recommendation if someone else hadn't already mentioned it, so I'll just follow up with another recommendation for itext. It's a pretty easy to use library, and it's been around for a while, so it's pretty stable.

    2. Re:IText by kefalonia · · Score: 1
      Hi mark-t, OP here.

      itext appears to miss two-three major targets:
      • software architecture/api may not be too tidy; this is word of others, I cannot verify it since I've never used it
      • unclear licensing scheme, not free of commercial clashes
      • due to the above, community has been fragmented in 3 (?) big fragments :-(
    3. Re:IText by Stalus · · Score: 1

      The problem with iText is that it used to be MPL, but the maintainer got ticked off at commercial users several years ago and changed to license to AGPL. Apparently now they're relaxing the license for a fee, but they've changed their mind before - no guarantees that they won't change it again.

  7. Prince XML by Eponymous+Coward · · Score: 2

    The best PDF software I've ever used is Prince XML.

    For years, we got by with HTMLDoc but finally dumped it because we absolutely needed unicode support.

    After trying many different packages, we settled on Prince. Our main constraints were performance related which you apparently aren't worried about, so maybe it's overkill for what you need.

    1. Re:Prince XML by Elgonn · · Score: 1

      I'll have to second the recommendation for PrinceXml.

      After investigating and trying at least 9 other open source kits I eventually gave up and went with PrinceXml. You can try the 'trial' version easily and it just works easily. Their support is actually good as well. I wish there was a good pdf toolkit that was open source. But they all seem to just do one odd piece of the puzzle poorly.

    2. Re:Prince XML by rolandw · · Score: 1

      PrinceXML is reliable, simple and produces the most beautiful PDFs ever. We've used it to replace InDesign as a tool for high end magazine page generation and have analysed the output of both - PrinceXML is significantly cleaner. However, it does help if you combine it with an image (re)sizing tool otherwise you end up with huge bloat with oversized images embedded in your PDF.

  8. Re:to the free as in "all you can steal" crowd by bluefoxlucid · · Score: 1

    libpoppler works; it just only meets the requirements that libpoppler was designed for. It correctly displays most PDFs, but fails with esoteric features used only in a small subset.

    In that sense, libpoppler is like a swiffer mop: it handles most normal dirt, dust, and general cleaning needs for tile and hardwood; but you will need a mop, or potentially nylon or bristle scrubbers and power tools, to clean some deep-set grime from linoleum or porcelain tile. I've had mops fail to clean traffic grime from kitchen linoleum, at all; stuck a drill brush in a 3000RPM 600W output cordless drill and blasted that shit right off.

  9. "Slashdot Crowd Wisdom" ! by RobotRunAmok · · Score: 5, Funny

    See, now thanks to you I have to clean all this coffee off my monitor...

    1. Re:"Slashdot Crowd Wisdom" ! by gstoddart · · Score: 1

      See, now thanks to you I have to clean all this coffee off my monitor...

      You should post a question to the Ask section, maybe some of us have some tips for cleaning it off? ;-)

      --
      Lost at C:>. Found at C.
    2. Re:"Slashdot Crowd Wisdom" ! by jones_supa · · Score: 3, Funny

      I'm sure one of the requirements would be an open source napkin.

    3. Re:"Slashdot Crowd Wisdom" ! by funwithBSD · · Score: 2

      I suggest librag.

      --
      Never answer an anonymous letter. - Yogi Berra
    4. Re:"Slashdot Crowd Wisdom" ! by PopeRatzo · · Score: 1

      maybe some of us have some tips for cleaning it off? ;-)

      I stick a mop head into a 600W cordless drill. Be sure to weak safety glasses.

      It does a lousy job of cleaning coffee off your monitor, but your co-workers will think you're a total badass.

      And like jones_supa says, make sure it's an open source mop. And post photos, please.

      --
      You are welcome on my lawn.
    5. Re:"Slashdot Crowd Wisdom" ! by Anonymous Coward · · Score: 0

      Well, librag implements a "sanitary napkin" API. While you could use it for absorbing coffee on the monitor, it's actually intended to absorb something very different in a very different area...

      - T

    6. Re:"Slashdot Crowd Wisdom" ! by Anonymous Coward · · Score: 0

      1. Collect underpants.
      2. Clean RobotRunAmok's monitor
      3. Profit!

  10. PDFBox by Anonymous Coward · · Score: 0

    It works.

  11. Alternative to iText by Anonymous Coward · · Score: 0

    It seems iText is it, can anyone vouch for a good alternative

    1. Re:Alternative to iText by Daniel+Hoffmann · · Score: 2

      iText has some problems with licensing for commercial applications and government projects. I am looking for an alternative.

    2. Re:Alternative to iText by Anonymous Coward · · Score: 0

      There are older version of iText.

  12. For serious archiving. by Anonymous Coward · · Score: 1, Interesting

    Make this becomes a requirement: support for making PDF/A.

  13. I'm convinced there is no elegant PDF library by PhrostyMcByte · · Score: 4, Informative

    At least on the C# side of things, the three libraries I've used (iTextSharp, PdfSharp, and Aspose.Pdf) are all a bit of an unintuitive mess with inconsistencies all over the place and very little documentation. In the case of iText, their revenue stream is putting all their documentation into a book for people to buy, so it's not uncommon to get an intentionally vague response when asking for help.

    I cycle between each depending on what I need to do, because they all have their own quirks and supported features. I've even piped from one to another to get certain parts of the process working.

    Good luck.

    1. Re:I'm convinced there is no elegant PDF library by codemachine · · Score: 2

      It could be that iText is just what he needs though. iTextSharp is the C# port of the original iText Java library. At times, it is easier to find code examples for iText than iTextSharp. Since the iTextSharp folks did their best to use C# conventions, the Java call names aren't always the same as the C# ones.

    2. Re:I'm convinced there is no elegant PDF library by Anonymous Coward · · Score: 0

      ActivePDF was pretty good IMO.I just use iTextSharp and haven't ran into any difficulties.

    3. Re:I'm convinced there is no elegant PDF library by TheRaven64 · · Score: 1

      I like the APIs for Apple's PDFKit, but without cross-platform support I wouldn't use it for anything other than toy projects.

      --
      I am TheRaven on Soylent News
  14. Flying Saucer by Anonymous Coward · · Score: 0

    Why deal with hard coding libraries for PDF rendering?
    With Flying Saucer you can make XHTML and CSS 2.1(with some 3 features), and then you don't have to deal with the hard coding of the report.
    Plus you can generate the report on the web right to your client.
    I have using Flying Saucer for over a year, and has real made creating PDF reports a lot easier.
    Before finding Flying Saucer I did research on JasperReport and Birt.
    And Flying Saucer was the only one that gave a 98% rendering of TinyMCE HTML tags.
    http://code.google.com/p/flying-saucer/

    1. Re:Flying Saucer by Anonymous Coward · · Score: 0

      How well does it work over email? Most HTML clients suck at rendering even basic HTML, let alone handle CSS properly, and I see you've thrown an X in there. On the other hand I can just render a document or report to PDF and be confident that the recipient can actually view it in all its intended glory.

  15. try... by Anonymous Coward · · Score: 4, Informative

    sudo apt-get install ghostscript pdftk poppler-utils

    ghostscript: /usr/bin/dvipdf
    ghostscript: /usr/bin/pdf2dsc
    ghostscript: /usr/bin/pdf2ps
    ghostscript: /usr/bin/pdfopt
    ghostscript: /usr/bin/ps2pdf
    pdftk: /usr/bin/pdftk
    poppler-utils: /usr/bin/pdffonts
    poppler-utils: /usr/bin/pdfimages
    poppler-utils: /usr/bin/pdfinfo
    poppler-utils: /usr/bin/pdfseparate
    poppler-utils: /usr/bin/pdftocairo
    poppler-utils: /usr/bin/pdftohtml
    poppler-utils: /usr/bin/pdftoppm
    poppler-utils: /usr/bin/pdftops
    poppler-utils: /usr/bin/pdftotext
    poppler-utils: /usr/bin/pdfunite

    1. Re:try... by Em+Adespoton · · Score: 1

      This. These three are what you need; you can then script a wrapper around them if you need to, but they'll provide you with everything you need as far as actual manipulation and display goes. Poppler keeps it simple, pdftk can handle most manipulation needs, and ghostscript is there to covere any esoteric issues that still fall under postscript/pdf/EPS.

      Might want to also include imagemagick, for import/export/optimization of most image formats you might be bursting/adding in PDF.

    2. Re:try... by kriston · · Score: 1

      Absolutely correct. I can't think of any good reasons not to use Poppler.

      --

      Kriston

  16. Ghostscript,Foxit PDF or other virtual PDF printer by QuickBible · · Score: 0

    My favorite solution to this problem is to leverage a 3rd party solution to do the heavy lifting that creates the actual PDF document and tie into it with printing code. When you setup the printer device and print mode correctly you can render your output in a print document as you would to the screen. The only changes are in calculating DPI because the screen and printer will have different dots per inch. I have done this on Windows using 2 techniques. The first was long ago and that was to use an installed post-script printer driver to "print to a file" and then have ghost script convert PS to PDF. As far as I know this is still a free and open solution. The makers of Ghostscript only clause to freedom of usage is that the software can't be for commercial usage. The second manner is to have your software look for a virtual PDF printer driver and "print to file". When you install Foxit PDF it installs a virtual PDF printer driver that can be used by code.

  17. Buile a xelatex file and then compile ... by Anonymous Coward · · Score: 0

    Buile a xelatex file and then compile ...

    We tested different things here and we ended up generating xelatex files and compiling them as needed (from Java).

    1. Re:Buile a xelatex file and then compile ... by Anonymous Coward · · Score: 0

      Personally I'm still using pdflatex, but yes, bascially this. Any kind of tex to create documents beats whatever else there is.

      Although it doesn't necessarily fulfil the "simple things should be simple" requirement.

  18. WKHTMLTOPDF by Anonymous Coward · · Score: 0

    (Pretty much, with minimal issues) pixel perfect generation of a PDF file from HTML.

  19. Libreoffice or Openoffice by Anonymous Coward · · Score: 0

    IIRC they import and export pdf.

  20. None of them support layers by Anonymous Coward · · Score: 0

    I know this is about as edge case as it gets but non-native PDF handling completely ignores PDF layering.

  21. Re:to the free as in "all you can steal" crowd by PopeRatzo · · Score: 2

    I use a cordless drill and brush bit to make my PDF files, too. It's slow, and it doesn't really scale well, but at least it's not from Adobe.

    --
    You are welcome on my lawn.
  22. ICEpdf by Anonymous Coward · · Score: 0

    Just wanted to mention the Author forgot to evaluate ICEpdf.

    ICEpdf can be used as standalone open source Java PDF viewer, or can be easily embedded in any Java application to seamlessly load or capture PDF documents. Beyond PDF document rendering, ICEpdf is extremely versatile, and can be used in a multitude of innovative ways, including: image conversion, annotation editing tools, text/image extraction, search and printing.

    http://www.icesoft.org/java/projects/ICEpdf/

  23. here is one by roman_mir · · Score: 1

    itext may be one of those. It comes under AGPL and under a commercial license if you buy support from the company.

  24. One word: PDFLib by Qbertino · · Score: 5, Informative

    PDFLib GmbH (german LLC) build exactly one product: PDFLib. And they've been doing that since 1997. AFAIK the company was run by one guy - the initial developer - alone for most of the time. Now it's probably a shop of 5 or so.

    So it's not FOSS - yeah, that's a real shame. But the devs get to eat, you can demand service and response if you run into a bug and you can expect a good product and with PDFLib you're probably going to get it too.

    I haven't come across a single project doing non-trivial PDF stuff that doesn't use PDFLib. I've used it myself a little, and the cookbook that comes with the product was very good, so it comes recommended.

    My 2 cents.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:One word: PDFLib by Anonymous Coward · · Score: 0

      The trouble I can see with PDFLib is the stupid "per machine" licensing. Per machine licensing for a software library is ridiculous - the description of the license on their website pretty much rules out using it in any situation other than some sort of central PDF processing behemoth service.

    2. Re:One word: PDFLib by Anonymous Coward · · Score: 0

      Dead on, their licensing sucks balls.

    3. Re:One word: PDFLib by rsborg · · Score: 1

      The trouble I can see with PDFLib is the stupid "per machine" licensing. Per machine licensing for a software library is ridiculous - the description of the license on their website pretty much rules out using it in any situation other than some sort of central PDF processing behemoth service.

      Clearly you haven't dealt with Oracle's licensing, compared to that, PDFLib is highly liberal stuff. They even give you one machine free (dev box).

      --
      Make sure everyone's vote counts: Verified Voting
  25. I've found these tools useful by Anonymous Coward · · Score: 0

    I'd avoid pdftk. It uses a fork of the iText library that is buggy and old and apparently no longer actively maintained. A secondary issue is that it has terrible error handling; when iText reports an error, pdftk just throws away the information about what the error really is. Qpdf can do everything I used to do with pdftk, and is much better engineered and supported.

  26. I'm convinced there is no elegant PDF library by Anonymous Coward · · Score: 0

    Have you looked at EssentialObjects? We use it for one of our internal applications and its been very easy to work with.

  27. BFO by the_mice · · Score: 2

    Java-only. Commercial. Feature-rich. Great company name.

  28. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  29. Yeah! Why would anyone want it maintained? by Anonymous Coward · · Score: 5, Insightful

    open source, with a community following

    Why?

    Because maybe it's not his first project? Fine, let me ask you: how many times did you get burned by totally unmaintainable third-party dependencies, before you vowed "NEVER AGAIN will I get so utterly fucked over?"

    Was your fifth project the one where you couldn't ever port to a new architecture or OS, or was it the one where the only company who had the source, went into bankruptcy and it took years for the liquidation to happen and you never really figured out where the assets are? No wait, your fifth project was the one where they just withdrew it from the market for "strategic reasons" and you never found out why and there was no replacement. Ah, then there was the race condition that you knew you could find if only you could read through the code, but the sole developer didn't even know what "race condition" means so he ignored your bug report. And the time the DRM server incorectly said the API key had expired so you didn't get any sales that day. Then there was that time you had the source but weren't allowed to change some parts of it: I loved the comment "by reading this you are violating the License Agreement" followed by the base64 string of dynamically interpreted code. Of course you violated the agreement, and decoded it: finding a bug you weren't allowed to fix. And of course let's not forget the time the developer might have actually hypothetically allowed the code to be maintained or might have even done it himself, but he had lost it, the one and only copy in the entire world, which had been used to compile the code that literally tens of thousands of people were depending on. That one's a classic, almost right up there with the vendor who died, taking all his customers' hopes of maintenance with him to the grave.

    Holy crap. I get why the public doesn't know to demand Free Software. Even smart people can be uninformed or lack expertise outside their areas. But developers, really? You have to be LITERALLY STUPID to not see "open source" as at least a major advantage, if not necessarily always the winner. Maybe it's not always a solid requirement, but if you don't always at least start your searches that way and try to get something that at least can be maintained, then yes, you're a moron.

    "Oh no, I'm not a moron," you explain, "I just happen to think that some large projects aren't ever going to need maintenance, because surely it's simple enought that a good programmer will get everything right the first time." You're right: you're not a moron; you're an imbecil. Sorry about the mistake.

    1. Re:Yeah! Why would anyone want it maintained? by Dragon+Bait · · Score: 2

      Because maybe it's not his first project? Fine, let me ask you: how many times did you get burned by totally unmaintainable third-party dependencies, before you vowed "NEVER AGAIN will I get so utterly fucked over?"

      This. Wish I hadn't run out of mod points -- and frankly I'm tired of some bottom of the barrel programmer who's attitude is "we can just rewrite everything every 5 years" get promoted into management and then tie our code to whatever proprietary crap the next cute sales person brings.

      Separate. Isolate. Defend. Treat every piece of third-party code that you don't have source for as an enemy whose only goal is to financially rape you. I don't care if that enemy goes by Oracle, Microsoft, or Joe's Discount Software.

    2. Re:Yeah! Why would anyone want it maintained? by TheRaven64 · · Score: 1

      Separate. Isolate. Defend. Treat every piece of third-party code that you don't have source for as an enemy whose only goal is to financially rape you. I don't care if that enemy goes by Oracle, Microsoft, or Joe's Discount Software.

      Having the source doesn't help you if it's an unmaintainable piece of crap, which is presumably where the OP's requirement for a community came from - if a load of people are hacking on it actively then there's a good chance that, if you end up needing to maintain it in-house, there's a pool of people to hire or send consulting work to.

      --
      I am TheRaven on Soylent News
    3. Re:Yeah! Why would anyone want it maintained? by Dragon+Bait · · Score: 1

      Having the source doesn't help you if it's an unmaintainable piece of crap,

      Agreed. Having the source is necessary, not sufficient.

    4. Re:Yeah! Why would anyone want it maintained? by kefalonia · · Score: 1

      +1. Yeap. You are on track, guys! The whole point is, that even if when we are involved commercially in a project, it's optimal to promote the usage of open source software anyhow, as a matter of enhancing community effort and investing time in a manner that you can benefit from it many times more in the future. Kudos.

  30. BFO by Anonymous Coward · · Score: 0

    Big Faceless Org
    Not open source. Java only.
    Great friendly support

  31. PDF Clown by gabrieltss · · Score: 1

    We used PDFClown (open source - Java) for production applications that were generating PDF's on the fly with hundreds of pages using Java and it performed very well.

    --
    The Truth is a Virus!!!
  32. iText by jbolden · · Score: 1

    iText meets some of your criteria.

    * open source, with a community following ; the kind of stuff Slashdotters would prefer = yep. Including several commercial books
    * tidy software architecture; simple things should remain simple = It's big and complete.
    * allow open API allowing usage across many languages (say: Python & Java) = Native Java. iText# is a port to .NET. Not a good fir for dynamic languages.
    * clear licensing status, not estranging future commercial use = AGPL + commercial license. Clear but not free as in beer for commercial.
    * serious multilingual & font support = yep.
    * PDF-handling rich features, not limiting usage for invoicing, e-commerce, reports & data mining = yep
    * digital signing should not go against other features = has several singing modules. Excellent.

  33. WeasyPrint by t4k1s · · Score: 2

    I started with Reportlab (the open source parts), found it to low level so I considered using the commercial edition because it has a templating language. As I was not very fond of investing time in learning yet another templating language, I reconsidered, and gave HTML with CSS a try for printing. I used wkhtmlpdf for a while but switched to WeasyPrint in the end: it was created for using HTML with CSS for printing, seemed to be more actively developed when compared to wkhtmlpdf.

  34. MuPDF? by HenryPing · · Score: 1

    Does anyone have experience with MuPDF? http://www.mupdf.com/ It's open-source, but requires license for commercial use. It appears to offer the best performance and portability. Its top level application(MuPDF) is highly rated across most platforms: Google Play, Apple Store and Ubuntu.

  35. HMRC's CT600 form - PDF forms by Richard_J_N · · Score: 1

    Is there anything that can handle the gruesome CT600 forms that the UK Tax authority require us to fill in every year? These have lots of embedded scripting and can only be read with Acrobat Reader. However, this year, Adobe have stopped releasing Acrobat for Linux.

    (An added bonus, the internal logic of the CT600 is buggy: for example if a particular tax option does not apply, it is fussy about the distinction of 0 vs empty, and this leads to subsequent validation errors (naturally with confusing messages). It also has about 20 pages of irrelevant data required, in order to reach a single number, which we have already calculated.)

  36. Re:Ghostscript,Foxit PDF or other virtual PDF prin by NJRoadfan · · Score: 1

    I've seen commercial programs actually do this to support PDF report generation. They just leverage the existing code they have for printing reports and redirect it to a virtual printer. I think it was the Amyuni libraries which are clearly closed source. One thing I can say is that a virtual printer that directly generates PDF files from the GDI output (we're talking Windows here) tends to create cleaner output files (smaller size, less rendering errors) than the Postscript printer output to PDF route.

  37. PrinceXML by hertling5780 · · Score: 1

    I needed to layout a novel in a PDF. I've previously worked with iText and prefer not to construct a PDF one element at a time. I wanted an HTML to PDF workflow. I then tried wkhtmltopdf, but it doesn't support most of the hardcore design needs: hyphenation, widow/orphan control, alternating page margins, and page headers and footers based on the section of a document. PrinceXML supports all that. Writing only CSS, and based on html content, you'll be able to replicate anything a designer can do in InDesign. It's incredibly powerful and the time it saves in development effort more than pays for the high cost of the software.

  38. FOP? by sgrover · · Score: 2

    Not sure how current it is, but when I was looking for the same a few years back all that was really available for PHP was HTML->PDF libraries which were not sufficient for anything but the most basic forms. A decent invoice form was hard to get right with these tools. Then I came across FOP. Or more specifically XML-FOP. Combine that with a little XSL and the output was amazing, and could do more than the HTML converters. The only problem is that the FOP tool was a Java based program so PHP would need to execute a shell command to call it. With tight control of what info was passed to that shell command, it seemed an appropriate trade-off for the job at hand. You can still get FOP in the ubuntu repos - apt-get install fop. The learning curve for FOP is a little steep to begin, but no more than any other XML dialect. And being XML, you have a lot of options in building the required FOP file. I opted to put my data into my own XML file, then utilize an XSL file to convert it if/when needed. More details here: http://xmlgraphics.apache.org/...

    1. Re:FOP? by Anonymous Coward · · Score: 0

      I've used Apache FOP in large projects and yes, it's a bit of a steep learning curve. We chose it because:
      1. It's open source, and under the commercial-friendly Apache license (so that in case you run into a bug or missing feature that's critical for you, you have a way to do it yourself for your deadlines)
      2. From a provenance perspective, it's from the Apache Foundation (apache.org), and they have good processes in place to ensure that they have the right to license the code that they license.
      3. A fairly good set of features - https://xmlgraphics.apache.org/fop/compliance.html

  39. DynaPDF? by Anonymous Coward · · Score: 0

    We've used this in our application for several years to generate a huge number of PDFs for digital presses. It can also do extraction and rendering as well as generation.

    https://www.dynaforms.com/

  40. grep by Tough+Love · · Score: 1

    dpkg -l | grep pdf | grep lib | grep ii
    ii libqpdf13:i386 5.1.1-1 i386 runtime library for PDF transformation/inspection software

    --
    When all you have is a hammer, every problem starts to look like a thumb.
  41. PDF::API2 and CAM::PDF by draxil · · Score: 1

    Are both quite good, as they names suggest these are Perl modules though.

    1. Re:PDF::API2 and CAM::PDF by tajribah · · Score: 1

      PDF::API2 is nice, but unfortunately it doesn't handle newer PDFs with compressed xrefs and/or object streams yet. Also, support for writing text in anything different from ASCII and maybe Latin-1 is close to missing.

  42. Haru by phrank · · Score: 1

    libHaru is a free C library (install libhpdf-dev in Debian) which supports generation, annotation, compression, encryption. See http://libharu.org/

    1. Re:Haru by Anonymous Coward · · Score: 0

      libHaru is quite good, but its Unicode support seems awful -- I've tried to use it for generating PDFs in Russian from UTF-8 source, but the resulting files were either searchable/indexable, or readable, but never both at the same time, like ReportLab is able to do. Also, both libHaru and ReportLab lack the ability to compress b/w images with CCITT/Group 4.

  43. MuPDF for rendering by charnov · · Score: 1

    At least on the rendering side, I have found MuPDF to be really good and stable: http://mupdf.com/

    --
    [RIAA] says its concern is artists. That's true, in just the sense that a cattle rancher is concerned about its cattle.
  44. PDFSharp, if you're using .NET or Mono by fluffynuts · · Score: 1

    I'll be honest that I don't have a broad range of experience with libraries. I've used a couple of html-to-pdf implementations and PDFSharp. The licensing for PDFSharp is very permissive, support can be paid for if required and the library is quite fast. As an aside, it has a cousin, MigraDoc, which produces abstract documents which you can finalise to Office formats, if you need that too.

    IMO, there is no perfect tool, but PDFSharp has served me well.

  45. most likely by haiderbd14 · · Score: 1

    I think its a most urgent for lot of it and internet related, we wait for more update information in next

  46. Re:Ghostscript,Foxit PDF or other virtual PDF prin by blackorzar · · Score: 1

    I like to use PDFCreator for this purpose. It is on sourceforge here: http://sourceforge.net/project...