Re: [Podofo-users] Podofo rendering

2019-08-14 Thread zyx
On Wed, 2019-08-14 at 13:24 +0200, Matthew Brincke wrote:
> What do you think about calling such a package
> a "hidden optional dependency"?

Hi,
I agree it's kind of hidden, having it mentioned in the README isn't
enough to make it better visible (as proved here).

Would the terminology change anything? I doubt it.

Pietro was able to find an example for his needs, but he didn't notice
how to make it compile. That's all. There's no need to invent new names
which will be forgotten sooner or later.

I didn't mean my initial reply as an insult against you, it only
surprised me that PoDoFo (or any project) would include sources, which
it never builds. It happens, yes, though quite rarely, I believe (like
some parts can be compiled only during "make test/check" or such, thus
they are still buildable). As it surprised me I tried to search for it.

Rather than inventing new terminology, and especially when the Boost is
optional, what about get rid of the WANT_BOOST and let it always try to
find & build with Boost, or even better add WITHOUT_BOOST (or similar
name), to give a chance to people to disable boost usage if needed,
even when required development files for boost would be available. That
would make Boost a real optional dependency.

By the way, PoDoFo's README covers many interesting things, from my
point of view. Good job of its author.
Bye,
zyx



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


Re: [Podofo-users] Podofo rendering

2019-08-14 Thread Matthew Brincke
Hello zyx, hello all,
> On 14 August 2019 at 08:59 zyx  wrote:
> 
> 
> On Tue, 2019-08-13 at 14:11 +0200, Matthew Brincke wrote:
> > but Boost isn't searched for when configuring the podofo build (with
> > cmake) because it wasn't added as even an optional dependency to the
> > project.
> 
>   Hi,
> are you sure of that? See:
> 
> https://sourceforge.net/p/podofo/code/HEAD/tree/podofo/trunk/cmake/modules/FindBoost.cmake
> https://sourceforge.net/p/podofo/code/HEAD/tree/podofo/trunk/CMakeLists.txt#l461
> 
> and
> 
> https://sourceforge.net/p/podofo/code/HEAD/tree/podofo/trunk/README.html#l188
> 

I'm so sorry, I see my false description now, when I wrote what you quote I was 
so sure
of "optional dependencies" (by definition) only including packages checked for 
by default
that I only checked the output of my last cmake run for any mention of Boost 
before writing
that and sending it off. After checking CMakeLists.txt and README.html directly 
after I saw
your reply I now understand I was mistaken.
Please let me just make a suggestion: What do you think about calling such a 
package
a "hidden optional dependency"?

>   Bye,
>   zyx
> 

Best regards, mabri


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


Re: [Podofo-users] Podofo rendering

2019-08-14 Thread Pietro Paolini

Hi Matthew,

I resorted to the shared-library solution as it worked well for me, at 
least it builds. I haven't tried to run anything as yet.


For the sake of my personal understanding

On 13/08/2019 13:40, Matthew Brincke wrote:

Then podofo was automatically configured with JPEG support and you'll need
to link to the libjpeg it found in your project too (when using a static
libpodofo build). When using a shared library build and not doing make install,
using LD_LIBRARY_PATH (on GNU/Linux) or changing the dynamic linker config
would be required to have your program find the libpodofo shared library. For
podofo-built programs this is required only when moving the library to a
non-standard location, or accessing it through a different non-standard path
(like in a sandbox) because the build process embeds a run-path in them.



This is the CMakeLists.txt for my microscopic project:

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


I thought this would do the work - do I need to manually specify all the 
dependent libraries, something along the line of


TARGET_LINK_LIBRARIES(main /path/to/libjgeg{libtiff..}

it's been a while since I programmed in C/C++ so forgive me some slip 
ups. I am also totally new to CMAKE.


Thanks,
Pietro



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


Re: [Podofo-users] Podofo rendering

2019-08-13 Thread Matthew Brincke
Hello Pietro, hello all,
> On 13 August 2019 at 12:53 Pietro Paolini 
>  wrote:
> 
> 
> Hi Matthew,
> 
> I spoke too early and I have another question if you don't mind me 
> hammering.
> 

I received your first email as second (sorted up in my mail client)
and have already answered it. 

... snip ...
> 
> I get many errors, 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'
>

The mention of libpodofo.a tells me you're using a static build
of libpodofo (yes, I know, it's the default ... ;-( ). The solution
is to either link to all the dependencies of your libpodofo build
(should be mentioned as found in the cmake output when configuring
the build), or to switch to a shared library build with cmake option
-DPODOFO_BUILD_SHARED:BOOL=TRUE and check that "Building shared PoDoFo library"
is in the output of cmake.

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

Then podofo was automatically configured with JPEG support and you'll need
to link to the libjpeg it found in your project too (when using a static
libpodofo build). When using a shared library build and not doing make install,
using LD_LIBRARY_PATH (on GNU/Linux) or changing the dynamic linker config
would be required to have your program find the libpodofo shared library. For
podofo-built programs this is required only when moving the library to a
non-standard location, or accessing it through a different non-standard path
(like in a sandbox) because the build process embeds a run-path in them.

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

Here the TARGET_LINK_LIBRARIES line is missing the dependencies of your
static libpodofo.

I hope this helps, please specify operating system if it isn't a (modern)
GNU/Linux "distro" (distribution).

> 
> 
> Best Regards,
> Pietro.

Best regards, Matthew

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

Re: [Podofo-users] Podofo rendering

2019-08-13 Thread Matthew Brincke
Hello Pietro, hello all,
> On 13 August 2019 at 12: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.

that is because "pdfcontentsgraph" requires Boost, but Boost isn't searched
for when configuring the podofo build (with cmake) because it wasn't added
as even an optional dependency to the project.

> 
> Thanks,
> P.

Best regards, Matthew

> 
> On 12/08/2019 23:36, Matthew Brincke wrote:
> > Hello Pietro, hello all,
> >> On 12 August 2019 at 23:24 Pietro Paolini 
> >>  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


Re: [Podofo-users] Podofo rendering

2019-08-13 Thread Pietro Paolini

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


Re: [Podofo-users] Podofo rendering

2019-08-13 Thread Pietro Paolini

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


Re: [Podofo-users] Podofo rendering

2019-08-12 Thread Matthew Brincke
Hello Pietro, hello all,
> On 12 August 2019 at 23:24 Pietro Paolini 
>  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] Podofo rendering

2019-08-12 Thread Pietro Paolini

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.


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.


Is there an example somewhere for it ?

Thanks,
Pietro.


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