PDF manipulation C/C++ API needed
Hi guys, is there anything free and preferably cross-platform on the subject?
I found an API on pdfonline [dot] com but it's 30 days trial, if somebody know a good PDF API, please, let me know.
P.S. I need to split the input pdf file into several, in such a way that each of newly created pdf files are actually the pages of the source file.
Many thanks in advance.
Re: PDF manipulation C/C++ API needed
Quote:
Originally Posted by AvDav
Hi guys, is there anything free and preferably cross-platform on the subject?
I found an API on pdfonline [dot] com but it's 30 days trial, if somebody know a good PDF API, please, let me know.
See if there is a C++ port of the Java-based itext system. Otherwise, prepare to pay big money.
Regards,
Paul McKenzie
Re: PDF manipulation C/C++ API needed
Thanks Paul, however it is strange why there are lots of free pdf libs in Java, but there isn't any in C++. Well, perhaps I'll have to code in Java, since even Adobe's pdf-dev facility is just an ActiveX control for only viewing and data extraction, for everything else one should buy their SDK.
Re: PDF manipulation C/C++ API needed
Re: PDF manipulation C/C++ API needed
Thanks, JohnyDog, but they require VC++ 7.x, I have no opportunity to setup anything higher 6.0, besides .dsp/.dsw/.sln files are missing to build the lib, as mentioned in their readme file.
Re: PDF manipulation C/C++ API needed
Have you considered digging through the source of any application that supports saving to PDF?
Also, I did a quick search on sourceforge and found libharu free PDF library. The examples look pretty reasonable to me.
You'll have to let me know if you use it, and if so, what you think of it! (I've always been tempted by this sort of thing.) -- Paul
Re: PDF manipulation C/C++ API needed
Well, thank you very much, I'll tell my opinion if you are interested in and if I'll use it, but as its API reference documentation shows - looks a bit ugly and have complicated design, perhaps not usual for me coz it's passed a long time when I was using pure C API.
Re: PDF manipulation C/C++ API needed
This portion of the code can tell something about optimization skills of the coder who developed this lib :)
Code:
for (j = 0; j <= strlen (samp_text) / 2; j++) {
HPDF_Page_MoveTo (page, x_pos, p.y - 10);
HPDF_Page_LineTo (page, x_pos, p.y - 12);
HPDF_Page_Stroke (page);
x_pos = x_pos + 30;
}
Re: PDF manipulation C/C++ API needed
Quote:
Originally Posted by AvDav
but as its API reference documentation shows - looks a bit ugly and have complicated design
That is because PDF can get complicated. It is difficult to wrap a multiple hundred page PDF spec into a library with just a few calls.
Quote:
perhaps not usual for me coz it's passed a long time when I was using pure C API.
Most API's are 'C' based, since the goal is to get the library to work with as many languages as possible (the C++ name-mangling gets in the way of other programming languages utilizing the library). What you can do is develop a C++ wrapper class for the functions. This is what a lot of C++ programmers using a 'C' API end up doing in the long run.
Regards,
Paul McKenzie
Re: PDF manipulation C/C++ API needed
Quote:
Originally Posted by AvDav
This portion of the code can tell something about optimization skills of the coder who developed this lib :)
Code:
for (j = 0; j <= strlen (samp_text) / 2; j++) {
HPDF_Page_MoveTo (page, x_pos, p.y - 10);
HPDF_Page_LineTo (page, x_pos, p.y - 12);
HPDF_Page_Stroke (page);
x_pos = x_pos + 30;
}
Not to defend the programmer, that was one of the samples, right? It wasn't the actual library code, was it?
Anyway, PDF is not an easy spec to write a library for. I would commend the person who is maintaining this library. However my hats go off to the two guys that maintain iText. Now those two are some dedicated fellows.
Regards,
Paul McKenzie
Re: PDF manipulation C/C++ API needed
Yeah, Paul, you are right ... as usual :)
Re: PDF manipulation C/C++ API needed
pdf manipulation c# codes can be found here. there a a few samples and tutorials you can have a look. i think it is the library you are looking for. it is simple.