5 ms·
My particular needs for PDF creation are somewhat unusual, so I'm not surprised that Acrobat Pro seems to be the only thing that suits my needs. If anyone knows
by tasty_freeze 7y ago
My particular needs for PDF creation are somewhat unusual, so I'm not surprised that Acrobat Pro seems to be the only thing that suits my needs. If anyone knows of a PDF creation library that has good support for the various image compression schemes supported by PDF, I'd love to know about it.
Currently I'm using a 10 year old paid version of Acrobat Pro because I'm unwilling to spend another $500 to get a modern copy simply to compress images. I use it for scanning and archiving old computer manuals. In many cases jbig on 1bpp images is good enough; other times I want to use one of the more sophisticated hybrid schemes so I can have B&W or color images interspersed on the page with 1bpp text. Acrobat does a pretty good job of auto-deskewing images and doing analysis to figure out which compression type to use in different sections of the same page.
- kxyvr 7y agoThis doesn't completely fix your issue, but since you mentioned deskewing, I clean up my scanned documents using ScanTailor Advanced: https://github.com/4lex4/scantailor-advanced https://github.com/4lex4/scantailor-advanced I find the autodeskewing algorithm to work well, but it allows hand adjustment as well, which I like. As I've gotten better as using it, I've been able to get the size of my scanned documents down considerably by cleaning up the scans. This includes some old manuals. As far as the pdf encoding itself, I use both mutool, from mupdf, and qpdf. I just checked and it looks like while they both compress their streams, it may not have the same flexibility with Acrobat Pro. For me, I'll decompress, edit, and recompress streams on the files and that's been fine for my use. That said, if someone knows of a better tool for compressing streams in a PDF, I'd be interested to hear about it as well.
- dunham 7y agoI'd be interested if anything open source exists that can do jbig/jpeg2k pdfs (separation + compression) like DjVU. I think archive.org ships PDFs like this, but don't know what they're using to do it (possibly something commercial?).
- bArray 7y agoIt sounds like you are using Windows, but if you happen to be using Linux [1]: ps2pdf LARGE.pdf SMALL.pdf I believe it compresses all of the images independently, instead of converting the entire thing to an image as I believe Imagick does (I could be wrong though). This tool doesn't appear to have any intelligent auto-deskewing though. (On a slightly different note, it's questionable whether you want to do this for archiving as it'll undoubtedly be a lossy operation.) The reason I use this: Many websites for conferences have upload limits at around 10MB, a size you can easily reach with a handful of images from a modern device in your paper. [1] https://www.shellhacks.com/linux-compress-pdf-reduce-pdf-size/ https://www.shellhacks.com/linux-compress-pdf-reduce-pdf-siz...
- mkl 7y agoI think this won't be useful for scanned documents, as the entire page will be one image. ps2pdf does work on Windows though (or maybe it's pstopdf?), and the Linux version works directly in WSL.
- bArray 7y agoI believe `ps2pdf` is just a front end script for Ghostscript. Even for `ps2pdf` there are a bunch of options settable, most notably are the DPI settings [1]. The point is that I believe it works for images and/or scalar graphics. As the PS format was designed for printing [2], my guess is that it selects a DPI value suitable for printing. I can't seem to find the source code to back this up though. (Ghostscript has the simple web front-end that doesn't lend itself very well for viewing code in browser [3].) [1] https://www.biu.ac.il/os_site/documentation/gs/Ps2pdf.htm https://www.biu.ac.il/os_site/documentation/gs/Ps2pdf.htm [2] https://en.wikipedia.org/wiki/PostScript https://en.wikipedia.org/wiki/PostScript [3] http://git.ghostscript.com/?p=ghostpdl.git;a=summary http://git.ghostscript.com/?p=ghostpdl.git;a=summary
- mkl 7y agoIt will work for images embedded in PostScript, and resample them to different DPI if you ask (I think probably more for on-screen viewing and file size reasons than printing). I would be kind of surprised if it does anything as sophisticated as "B&W or color images interspersed on the page with 1bpp text" though (i.e. analysing full page images, locating and separating text and figure regions, and choosing different encodings for each). DjVu does do some things along those lines, but it's not widely supported like PDF.
- cogburnd02 7y agoUse hugin for deskewing? http://hugin.sourceforge.net/tutorials/perspective/en.shtml http://hugin.sourceforge.net/tutorials/perspective/en.shtml
- IfOnlyYouKnew 7y agoLook into what OpenLibrary is using. I don't remember it off the top of my head, but there is a special image format for efficiently compressing scanned pages of text. Their files are vastly smaller than jpeg at the same quality.
- tasty_freeze 7y agoI downloaded one PDF and looked at its properties. It says it was created with LuraDocument PDF v2.28. Googling, it is a product of LuraTech Imaging GmbH. Following that search leads to a link that redirected to Foxit. They have an enterprise PDF compression toolkit which clearly supports all the advanced compression schemes of PDF, but it is too rich for me: prices are not given, just a button to ask for a quote. There is a personal PDF tool for $129 but they don't make clear if it also supports their top quality PDF compression.
- ravedave5 7y agoTry BFO pdf . It's paid but they are agood company. I also I love that BFO stands for "Big Faceless Organization" and the CEO answered support emails until like last year.
- tasty_freeze 7y agoStarting at $850. Ouch; I'd just buy Acrobat Pro then, because the latter is cheaper. My needs are just for a hobby project (scanning and posting old computer manuals).