Solved

Modifying PDF meta data via C++ (specifically on Solaris)

Posted on 2014-10-27
8
129 Views
Last Modified: 2014-11-05
I need a method, via C++, to edit the meta data of existing PDF files (such as title, description, author, etc.).
I am on the Solaris 10 platform so I need a library which will compiled under Solaris.

My first attempt was Adobe's XMP toolkit.
However, though there are clauses in its cmake configuration files that deal with Solaris, the actual files to be included for Solaris are missing.

I went through a lot of other free PDF libraries, but most did not seem to support editing of file meta data.

I am currently trying to get podofo to compile on Solaris, though I'm having some issues.
0
Comment
Question by:bejhan
  • 4
  • 4
8 Comments
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 40407517
I use the PDF Toolkit (PDFtk) to write metadata:
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

It allows you to change Creator, Title, Author, Producer, Subject, ModDate, CreationDate. It comes in both command line and GUI versions, and the command line version (called PDFtk Server) can be called from C++ (or any language that can run a command line executable).

I use it only in Windows, but there's a binary RPM for Red Hat or CentOS, as well as a source code RPM for it:
https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/

I have no idea if you can get it to work on Solaris, but if you do a build of PDFtk Server (the command line version) from the source code without using RPM, perhaps you can get it to work on Solaris. Regards, Joe
0
 
LVL 1

Author Comment

by:bejhan
ID: 40409097
I was more-so looking for a C++ library, rather than a command-line tool.
However, I may have to fall back to that approach if my efforts remain fruitless.
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 40409132
The most comprehensive PDF library that I know of is iText:
http://itextpdf.com/

iTextSharp is the .NET port:
http://sourceforge.net/projects/itextsharp/

I've never done it, but I think you should be able to call it from your C++ code. Here's a thread that discusses it briefly:
http://sourceforge.net/p/itext/mailman/message/12263529/

iText should work fine with the JVM on Solaris, but I've never done that, either. Regards, Joe
0
 
LVL 1

Author Comment

by:bejhan
ID: 40411538
If I have to call from command-line I might as well use a command-line utility, rather than a Java program.
As well, I am looking for a free option.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 40411752
PDFtk Server (the command line tool) is free under the GPL. In fact, it is even free for redistribution as part of your own software, as long as your software is licensed to the public under the GPL or another compatible license. You may read about its licensing here:

https://www.pdflabs.com/docs/pdftk-license/

iText also offers a free version under the Affero General Public License (AGPL). And they have commercial licensing for users who don't qualify for the AGPL. You may read about its licensing here:

http://itextpdf.com/pricing

Regards, Joe
0
 
LVL 1

Accepted Solution

by:
bejhan earned 0 total points
ID: 40416288
I was able to get PoDoFo compiled on Solaris.

I've attached the patch for the src directory.
podofo.diff.txt
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 40416370
You're welcome. I was happy to try to help. And thanks to you for posting what you found. Good luck on the project! Regards, Joe
0
 
LVL 1

Author Closing Comment

by:bejhan
ID: 40423519
No C++ PDF library was provided by experts.
I was able to get an appropriate library compiled.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle Finace 3 66
computer science syllabus 3 69
Microsoft C++ code failing in executable that worked 9 82
bash while loop reading input from data section in script 7 62
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now