The Best Free PDF Library

dwe0608
dwe0608 used Ask the Experts™
on
Hi All,

I am looking for some recommendations on PDF Libraries.

What I need to do is manipulate a series of PDF files, combine, split, add a water mark and so forth from within a series of functions within VBA (inside of outlook and excel).

I am looking for a solution, preferably in the form of a control and not a command line library.

I do not have access to Acrobat, so no acrobat solutions are acceptable, unless they're free and easy to distribute within our office :-)

MTIA

DWE
.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Technical Specialist
Awarded 2017
Distinguished Expert 2018
Commented:
I know you said free and there are some good free options.

I do however recommend GemBox.Spreadsheet. It has a limited free option and paid version allows for Royalty-free deployment
https://www.gemboxsoftware.com/spreadsheet
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018
Commented:
> preferably in the form of a control and not a command line library

I can't help you with a control, but for a command line library, I strongly recommend the PDF Toolkit (PDFtk) from PDF Labs. PDFtk comes in both command line and GUI versions. The command line version is called PDFtk Server and may be downloaded here:
http://www.pdflabs.com/tools/pdftk-server/

Don't be misled by "Server" in the name. I don't know why they called it that, but it's just an executable (pdftk.exe, with a supporting DLL, libiconv2.dll) that runs on "standard" Windows — it does not have to run on a "server" Windows.

I've been using it for many years in scripts and programs, although I've never tried it with VBA. But since VBA can run a command line program, it should work fine. Here's an EE thread from a few years ago that discusses it:
https://www.experts-exchange.com/questions/26461874/Excel-VBA-How-to-Run-a-Command-Line-with-VBA.html

PDFtk Server can do all the PDF manipulation that you're looking for, including combining, splitting, and adding a watermark. For example, here's the one line solution using the PDFtk Server command line for combining two files into a third:

pdftk input1.pdf input2.pdf cat output combined.pdf

It also accepts a wildcard, so you may do this to combine all files in a folder:

pdftk *.pdf cat output combined.pdf

The "cat" operation "catenates" (joins/merges/combines) the input files into the output file. If you'd like to see the full syntax for the PDFtk Server command line and some usage examples, here are the links:
http://www.pdflabs.com/docs/pdftk-man-page/
http://www.pdflabs.com/docs/pdftk-cli-examples/

Note that Acrobat is not required and that the software is free, even for commercial use (the only time that PDFtk is not free is for distribution of it with a commercial product).

This is an excellent piece of free software. I've done a ton of PDF processing with it. Regards, Joe

Author

Commented:
Hi Guys thanks for the input - I'll investigate the solutions proposed and will see if someone can point me to a library (OCX, DLL etc) as opposed to a commandline solution (wonder why PDFtk doesnt put a library solution out there) ... I have noted Joe's link to a work around running the commandline solution and I'm willing to give that a go ... pending other input ...
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018
Commented:
For what it is worth, GemBox.Spreadsheet is a DLL
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018
Commented:
If you want to dig into it, there's iText, the granddaddy of PDF libraries:
https://itextpdf.com/

There's also a .NET port of it, called iTextSharp:
https://sourceforge.net/projects/itextsharp/

Here's its GitHub:
http://github.com/itext

It's big and complex...and robust...can do just about anything in the area of PDF manipulation. I haven't used it myself, as PDFtk and the Xpdf utilities (especially, PDFtoText) are able to do everything I have needed so far in PDF manipulation (tools that are easier to use than iText/iTextSharp, imo). Regards, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
This is one of those questions asking "for some recommendations", so there are no right or wrong answers. Everyone is entitled to make recommendations, so I am selecting all the posts where experts made recommendations of PDF libraries or other helpful comments and am splitting the points evenly. There is no "Best" answer, so I am selecting the first post as the Accepted Solution and all others as Assisted Solutions.

Author

Commented:
I am sorry guys I never made it back here ... I came down with a terrible flu and was incapacitated for a week or so ... My apologies to all ...
Thanks for the informative responses ... I am content with the sharing of the points and agree with Joe's comments...
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Thanks for the feedback. Sorry to hear you were so ill. Hope you're feeling better now and on the road to complete recovery. Regards, Joe
Why not choose a PDF tool? Now many PDF solution provide you batch process to  combine, split, add water mark with ease. What's more, more features enable you to improve your productivity at work. Here are some PDF solution for your reference.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial