CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Jun 2003
    Location
    Armenia, Yerevan
    Posts
    720

    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.

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    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

  3. #3
    Join Date
    Jun 2003
    Location
    Armenia, Yerevan
    Posts
    720

    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.

  4. #4
    Join Date
    Dec 2005
    Location
    Prague, Czech Republic
    Posts
    208

    Re: PDF manipulation C/C++ API needed


  5. #5
    Join Date
    Jun 2003
    Location
    Armenia, Yerevan
    Posts
    720

    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.

  6. #6
    Join Date
    Jun 2006
    Location
    Dundee, United Kingdom
    Posts
    22

    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
    Paul Macklin
    Lecturer in computational/applied mathematics at the University of Dundee
    Research: Mathematical Cancer Modelling and Simulation

    Developer for EasyBMP (cross-platform C++ BMP library)
    Developer for EasyBMPtoAVI (cross-platform BMP to AVI converter)
    Moderator at the overclockers forums (ocforums.com)

  7. #7
    Join Date
    Jun 2003
    Location
    Armenia, Yerevan
    Posts
    720

    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.

  8. #8
    Join Date
    Jun 2003
    Location
    Armenia, Yerevan
    Posts
    720

    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;
    }

  9. #9
    Join Date
    Apr 1999
    Posts
    27,449

    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.
    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

  10. #10
    Join Date
    Apr 1999
    Posts
    27,449

    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

  11. #11
    Join Date
    Jun 2003
    Location
    Armenia, Yerevan
    Posts
    720

    Re: PDF manipulation C/C++ API needed

    Yeah, Paul, you are right ... as usual

  12. #12
    Join Date
    Jul 2013
    Posts
    1

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured