Hi Matthew,

I spoke too early and I have another question if you don't mind me hammering.

I've written a very simple program to check the PdfTokenizer however it fails to compile as some external dependencies seem to be missing.

int main(int argn, char **argv) {
    [...]
    PoDoFo::PdfMemDocument doc (filename.c_str());
    for (int i = 1; doc.GetPageCount(); i++) {
        PoDoFo::EPdfContentsType t;
        const char * text;
        PoDoFo::PdfVariant variant;
        bool readToken;

        PoDoFo::PdfContentsTokenizer tokenizer( doc.GetPage(i));

        while ( ( readToken = tokenizer.ReadNext(t, text, variant) ) ) {
         [..]
        }
}

I get many erros, among them:

[..]/lib/libpodofo.a(PdfFiltersPrivate.cpp.o): In function `PoDoFo::PdfDCTFilter::EndDecodeImpl()': PdfFiltersPrivate.cpp:(.text+0x2146): undefined reference to `jpeg_read_header' PdfFiltersPrivate.cpp:(.text+0x215f): undefined reference to `jpeg_destroy_decompress' PdfFiltersPrivate.cpp:(.text+0x21bd): undefined reference to `jpeg_start_decompress' PdfFiltersPrivate.cpp:(.text+0x22b5): undefined reference to `jpeg_read_scanlines' PdfFiltersPrivate.cpp:(.text+0x24fd): undefined reference to `jpeg_destroy_decompress'

I think they are all coming from the same root problem, I do have the libjpeg-dev (Debian system) installed locally though and I wonder what the problem may be.

This is the CMakeLists.txt for my microscopic project:

ADD_EXECUTABLE(main main.cpp)
TARGET_LINK_LIBRARIES(main ${PODOFO_INSTALL_TOP}/lib/libpodofo.a)
INCLUDE_DIRECTORIES(${PODOFO_INSTALL_TOP}/include)


Best Regards,
Pietro.
On 13/08/2019 11:27, Pietro Paolini wrote:
Hi Matthew,

Thanks a lot for your answer, I am not bothered at all and I amĀ  more than happy to stay on trunk - I just intended to flag this up. I've also found that the example "pdfcontentsgraph" is not built as part of the main build.

Thanks,
P.






On 12/08/2019 23:36, Matthew Brincke wrote:
Hello Pietro, hello all,
On 12 August 2019 at 23:24 Pietro Paolini <pietro.paol...@cognitivecredit.com> wrote:


Hi all,

I've stumbled upon this library only a few days ago and I noticed that
the downloadable version from

http://sourceforge.net/projects/podofo/files/podofo/0.9.6/podofo-0.9.6.tar.gz/download

Does not compile, at least on my system, while what I get right off
trunk does compile.

in the meantime some issues were fixed which could have had made it difficult to compile podofo, a number of security/crash issues were also fixed, so it is definitely recommended to only use current svn trunk anymore. On Tuesday, August 13, in the afternoon, I'll very probably commit (I'm a full committer) a fix for issue #58 (plus some debug code to avoid such issues being so difficult to debug as this was for me). I'd just like to run some further tests with it,
which are likely to pass, could you please hold out until then?

I am exploring the possibility of using the library to inspect PDFs,
making some analysis on them and saving the PDF result of some
processing. A good example could be hidden text.

It seems to be able to parse the input PDF and to "translate" in into an
a "PdfVecObjects" but I have not found - within the time I had available
for it, I should mention - a way to render the PDFs on screen.

PoDoFo is suitable for analyzing PDF documents, modify them (text editing
is still very limited, mostly adding is supported yet), and create them,
but what it doesn't do at all (because it's outside its scope) is rendering.
There are other libraries for that, a popular free (open source) one is
libpoppler (homepage URL https://poppler.freedesktop.org/ ), except for some commenting functionality it does exclusively rendering (AFAIK), so IMHO it's a good complement to PoDoFo which you'd use for the analysis and transformation (sorry, colour space support is still rather limited, I hope that'll change
before 1.0 ;-) ).

Is there an example somewhere for it ?

For rendering, please see the libpoppler homepage, for creation, there are
examples in that directory under podofo trunk, for analysis, please see
the tools directory's sub-directories there (podofopdfinfo could be a good start).

Thanks,
Pietro.


I hope this helps.

Best regards, Matthew


_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users



_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to