Re: [poppler] How to normalize MathematicalPi text?

2019-03-13 Thread Jason Crain
On Wed, Mar 13, 2019 at 01:54:26PM +0100, Jeroen Ooms wrote:
> I think what would be needed is to construct a table that maps the
> Mathematical-Pi characters into their proper unicode values.

The PDF creator should be providing that table, called the ToUnicode
map, in the font's data structures. Since this font doesn't provide one,
poppler has to guess what the Unicode value could be and it guesses
wrong.

If you were to provide a map that says, for this font, character code
"^A" maps to "β", that should work.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Re: [poppler] Static build

2018-12-04 Thread Jason Crain
On 2018-12-04, Ranjan Ghosh  wrote:
> [ 71%] Linking CXX executable pdftocairo
> /usr/bin/ld: /usr/local/lib/libcairo.a(cairo-image-surface.o): in function
> `_cairo_image_surface_finish':
> /usr/src/cairo/src/cairo-image-surface.c:846: undefined reference to
> `pixman_image_unref'
> /usr/bin/ld: /usr/local/lib/libcairo.a(cairo-image-surface.o): in function
> `_cairo_image_surface_init':
> /usr/src/cairo/src/cairo-image-surface.c:164: undefined reference to
> `pixman_image_get_data'
> /usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:169: undefined
> reference to `pixman_image_get_width'
> /usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:170: undefined
> reference to `pixman_image_get_height'
> /usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:171: undefined
> reference to `pixman_image_get_stride'
> /usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:172: undefined
> reference to `pixman_image_get_depth'
> /usr/bin/ld: /usr/local/lib/libcairo.a(cairo-image-surface.o): in function
> `_pixman_format_from_masks':
> 
> Any help on how to overcome this problem would be much appreciated.

Did you link to pixman? It's a dependency of cairo.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] building 0.68 and 0.69

2018-09-24 Thread Jason Crain
On 2018-09-25, Valerio Messina  wrote:
> Building 0.67 work, so something changed in 0.68 generate this trouble.

Poppler switched from using its own cmake module to find OpenJPEG to
using the one that ships with cmake.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] building 0.68 and 0.69

2018-09-24 Thread Jason Crain
On 2018-09-24, Valerio Messina  wrote:
> -- The imported target "openjpip_server" references the file
>"/usr/lib/x86_64-linux-gnu/libopenjpip_server.a"
> but this file does not exist.  Possible reasons include:
> * The file was deleted, renamed, or moved to another location.
> * An install or uninstall procedure did not complete successfully.
> * The installation package was faulty and contained
>"/usr/lib/x86_64-linux-gnu/openjpeg-1.5/OpenJPEGTargets.cmake"
> but not all the files it references.

The issue could be that poppler requires openjpeg > 2, while for some
reason cmake is using the openjpeg-1.5 files.

> In the mean time, how to switch to "internal unmaintained JPX decoder"
> or to disable support for Jpeg2000/Jpip at all?

Use -DENABLE_LIBOPENJPEG=none or -DENABLE_LIBOPENJPEG=unmaintained.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Issues while running pdfimages from Poppler

2018-05-15 Thread Jason Crain
On Tue, May 15, 2018 at 04:59:51PM +0530, Manthan Jamdagni wrote:
> I am building Poppler on an EC2 hosts and I am facing few problems and wanted 
> few clarifications regarding the same. I build poppler as suggested to get 
> the utilities, the binaries are created successfully and build is successful 
> but they fail to run with a couple of errors which are as follows - 
> 
> 1. error while loading shared libraries: libcurl.so.3: cannot open shared 
> object file: No such file or directory
> I had libcurl.so.4 installed on my system so I copied it and renamed it 
> to libcurl.so.3 which fixed this error.
> 2. error while loading shared libraries: libjpeg.so.62: cannot open shared 
> object file: No such file or directory, now for this I have libjpeg.so.8 in 
> my Ec2 host, 
> I can again rename the shared library to make it work, but this is very 
> hackish and I wanted some better solution.
> Is there a way to make poppler run with these new shared libs?

How did you manage to build poppler if you don't have those libraries
installed?

> I also had another query, so I encountered the above mentioned errors while 
> running pdfimages, so I was wondering why is curl required for pdfimages to 
> extract images out of pdf. Can someone also explain this to me?
> I am very new to this domain so pardon my lack of knowledge,

It's an optional feature. If built with libcurl, the poppler utils can
load a document over the internet.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] How to install poppler utils

2017-12-05 Thread Jason Crain
On Tue, Dec 05, 2017 at 04:27:50PM +0100, Michael Schöller wrote:
> I am trying to install the poppler utils, however I do not really understand 
> where to begin.

Generally people install it though their distro if using Linux or BSD.
Through msys2 or cygwin for people using Windows. Through Homebrew or
MacPorts for Mac. You can also compile from source, which is the .tar.xz
file.

> Will the installation take place on my local computer or on the server?

It will be installed on whichever computer you run the installer on, I
assume. That's out of scope of the poppler project since we don't
provide an end-user installer, we just provide the source code.

> How do I use the utils once installed?

They are command line tools so you run a terminal and type the command.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] How to set custom 'share' directory

2017-11-01 Thread Jason Crain
On Wed, Nov 01, 2017 at 03:34:36PM +0100, Jeroen Ooms wrote:
> On Wed, Nov 1, 2017 at 3:20 PM, Jason Crain <ja...@inspiresomeone.us> wrote:
> 
> > On Mac and Linux the path is hardcoded at compilation time.  It's
> > generally in /usr/share/poppler on Linux.  Not sure what the standard is
> > on Mac.  On Windows it looks in \share\poppler relative to the
> > installation directory.
> 
> OK that is unfortunate. Would it be possible to introduce an option to
> set this path dynamically at runtime; e.g via an environment variable
> or via an api call?
> 
> In our case we statically link libpoppler with the R bindings on
> MacOS/Windows. This works very well for users, but there isn't a fixed
> installation directory; it depends on where the user installs the R
> package. So it would be really nice if there is a way to point
> libpoppler to the correct path when the R package gets loaded, rather
> than hardcoding this at build-time.
> 

I don't know how you use poppler in your project, but you may also have
the option of passing in the path when you construct the GlobalParams
object.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] How to set custom 'share' directory

2017-11-01 Thread Jason Crain
On Wed, Nov 01, 2017 at 02:19:36PM +0100, Jeroen Ooms wrote:
> I maintain the poppler bindings for R which work on Windows, MacOS and
> Linux. However Chineese users on Windows/Mac have reported that
> poppler doesn't find the share data files:
> 
>   error: Missing language pack for 'Adobe-CNS1' mapping
> 
> Where exactly does poppler look for the 'share' directory? Is there an
> environment variable or libpoppler API that I can use to specify this
> location?

The encoding files are in the poppler-data package, not the poppler
package.  Likely your users need to install poppler-data.

On Mac and Linux the path is hardcoded at compilation time.  It's
generally in /usr/share/poppler on Linux.  Not sure what the standard is
on Mac.  On Windows it looks in \share\poppler relative to the
installation directory.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] extract links form pdf using poppler-cpp api

2017-08-31 Thread Jason Crain
On Thu, Aug 31, 2017 at 11:03:04AM +0200, Jeroen Ooms wrote:
> Some users of the R bindings have requested a way to extract
> hyperlinks from a pdf file. However it seems that currently this
> functionality is only available in the qt api, but not in the cpp api?

It appears not. The CPP API is not as complete as the other APIs.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Question about setting PPI when generating image from pdftoppm

2017-07-21 Thread Jason Crain
On Fri, Jul 21, 2017 at 01:52:16PM -0700, Min Su wrote:
> I'm trying to set PPI when generating image from pdftoppm,but it seems like
> we only have parameters to set DPI "-r". I think the "r" here means
> resolution and the value should be a DPI. Since DPI is different from PPI,
> what if I want to set resolution by using PPI? Is there a way to translate
> them or there's another parameter which can take PPI?

Probably the manpage and --help text are inaccurate and should say PPI
instead of DPI, since pdftoppm is outputting to an image and not a
printer.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Question regarding font selection

2017-07-05 Thread Jason Crain
On Wed, Jul 05, 2017 at 10:45:07AM -0400, Pierre-Luc Samuel wrote:
> On 17-07-04 06:43 PM, Albert Astals Cid wrote:
> > El dimarts, 4 de juliol de 2017, a les 17:06:07 CEST, Pierre-Luc Samuel va
> > escriure:
> > > I am experiencing weird font substitution with pdftocairo and was
> > > wondering what was the algorithm to match fonts when converting from
> > > PDF.  The Courier font (regular) is being substituted "Nimbus Mono L
> > > Bold", even if fc-match return the non-bold version.
> > > 
> > > $ fc-match "Courier"
> > > n022003l.pfb: "Nimbus Mono L" "Regular"
> > > 
> > > $ fc-match "Courier:style=bold"
> > > n022004l.pfb: "Nimbus Mono L" "Bold"
> > > 
> > > What could be the reason behind this?
> > The pdf font can be asking for bold even if the name doesn't contain bold.
> > 
> Thanks for your answer Albert.  I have attached a sample PDF and resulting
> SVG with the problem I'm encountering.  I do not understand why the bold
> font is selected for the first "Courier".
> 
> pdftocairo version 0.56.0

It works for me:

$ pdffonts ~/courier.pdf  -subst
name object ID substitute font  
substitute font file
 - 
 
Courier   7  0 Nimbus Mono L
/usr/share/fonts/type1/gsfonts/n022003l.pfb
Courier-Bold  8  0 Nimbus Mono L Bold   
/usr/share/fonts/type1/gsfonts/n022004l.pfb
Courier-Oblique   9  0 Nimbus Mono L Regular Oblique
/usr/share/fonts/type1/gsfonts/n022023l.pfb
Courier-BoldOblique  10  0 Nimbus Mono L Bold Oblique   
/usr/share/fonts/type1/gsfonts/n022024l.pfb

With versions 0.48.0 and from git master.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Branch 'better_object' - poppler/SplashOutputDev.cc

2017-05-12 Thread Jason Crain
On Fri, May 12, 2017 at 03:39:27PM -0500, Joan Ronck wrote:
> REMOVE MY NAME FROM THIS MAILING LIST!!!

Please stop sending this to the mailing list.  It's not going to help.
Use the link in the email footer to unsubscribe yourself.

> https://lists.freedesktop.org/mailman/listinfo/poppler
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] PLEASE INSUBSCRIBE ME!!!!!!!!

2017-04-21 Thread Jason Crain
On Fri, Apr 21, 2017 at 11:24:30AM -0500, Joan Ronck wrote:
> 
> 
> Sent from my iPhone
> ___
> poppler mailing list
> poppler@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/poppler

Use the form at this link: https://lists.freedesktop.org/mailman/options/poppler
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] evince does not show chinese bold or italic

2017-04-21 Thread Jason Crain
On Thu, Apr 20, 2017 at 05:28:08PM +0200, Thomas Johnsson wrote:
> I suspect (but I'm not sure) that acroread synthesizes bold and italic from
> the regular font, and that evince fails to do so.
> Or could it be that additional fonts need to be installed?
> Or might this have been fixed in a later version of evince?

For the benefit of the discussion, I'll repeat and expand on what I said
on the evince mailing list.

This document does not embed fonts, which means that poppler uses
fontconfig to locate appropriate substitute fonts.  If fontconfig can't
find the right combination of bold and italic, it will select some other
non-italic or non-bold variant.  My system, and apparently also William
Bader's system, at least show the bold font but not the italic font
because we have a bold CJK font installed.  I don't think that poppler
tries to synthesize font styles.

The pdf reference does mention that font styles can be synthesized, and
this might be what acroread is doing, so it would be nice if poppler
could synthesize bold or italic font styles.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] R: Hello

2017-04-21 Thread Jason Crain
On Fri, Apr 21, 2017 at 03:34:12PM +0200, Amila Fernando wrote:
> Thank you very much for answering,
> 
> I still have to reveal the code even if I'm based on the poppler code but
> not completely but modifying it? And if I add new code to it, I can keep
> them hidden?

Please keep the mailing list in cc.

Any code that is considered a derivative work has to be shared under a
GPL license.  This includes modifications and additions.

There are far better summaries of the GPL on the internet than I can
provide so please read those and read the GPL license itself if you need
more specific information.

https://en.wikipedia.org/wiki/GNU_General_Public_License
https://www.gnu.org/licenses/gpl-faq.html

And the licenses:
https://cgit.freedesktop.org/poppler/poppler/tree/COPYING
or
https://cgit.freedesktop.org/poppler/poppler/tree/COPYING3
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Hello

2017-04-21 Thread Jason Crain
On Fri, Apr 21, 2017 at 10:31:57AM +0200, Amila Fernando wrote:
> I want to know if poppler is just a pdf viewer or it's also an interpreter
> that I can use for the rip? If it's an interpreter I can use it? It's free
> or there is a commercial license to buy for it's use?

There is no commercial licensing.  Poppler is licensed under GPL
versions 2 or 3.  You are free to use it as long as you comply with the
GPL, which in short means that if you distribute the poppler software or
some product that includes the poppler software, you also have to share
the poppler source code, the source code of any modifications you make,
and the source code of any programs which use poppler, also licensed
under the GPL.  Read the GPL for more information.

I don't know what is needed for a RIP so I can't say whether it is
suitable for that purpose, but the poppler maintainer will consider any
patches you provide.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Moving out of the freedesktop umbrella?

2017-04-11 Thread Jason Crain
On Sat, Apr 08, 2017 at 11:58:00PM +0200, Albert Astals Cid wrote:
> https://www.freedesktop.org/wiki/CodeOfConduct/ has appeared from thin air 
> from no public discussion that I can see.
> 
> I don't disagree with having a code of conduct, but having one forced down 
> our 
> throats seems kind of a violation of the code of conduct itself.
> 
> How would the community feel about moving the project somewhere else? 
> Suggestions welcome.

I do think that this should have been publicly discussed before it was
adopted.  According to Daniel Stone's recent email¹ on the xdg list,
this was discussed privately by the fd.o admins, but I believe there
should also have been a public discussion period.

However, I think having a CoC is good and I don't see anything I
disagree with in the CoC.  I would prefer that it be more explicit,
especially regarding how enforcement and complaints are handled, but
overall I agree with it and I don't think that poppler should leave fd.o
because of this.

¹ https://lists.freedesktop.org/archives/xdg/2017-April/013882.html
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] hyperlinks not clickable

2017-02-23 Thread Jason Crain
On Fri, Feb 24, 2017 at 12:19:44AM +0100, Petr Vanek wrote:
> On Thu, Feb 23, 2017 at 7:33 PM, jose.ali...@gmail.com
>  wrote:
> > Please submit a bug in GNOME's bugzilla product:evince. Although I think
> > it's very unlikely to be implemented (not enough devs working on evince
> > atm)
>
> actually i did before and I will try again but debian bugtracker
> didn't like me today, see below or perhaps something went wrong on my
> side, Anyways, will retry :)

GNOME's bugzilla is at https://bugzilla.gnome.org.  For feature requests
like this I recommend submitting it to GNOME instead of Debian because
it's not something that can just be fixed in the Debian packaging.

And yes, Debian's bug tracker is tricky.  It's what happens when you
base a bug tracker completely on email.

> > from: Albert Astals Cid
> > What do you mean it doesn't allow you to enter any bug?
>
> I made an account today but there wasn't poppler category on
> bugs.freedesktop.org (there were other categories), i tried to
> force-feed it via
> https://bugs.documentfoundation.org/enter_bug.cgi?product=poppler but
> it said "Sorry, either the product poppler does not exist or you
> aren't authorized to enter a bug into it. "

https://bugs.documentfoundation.org/ is for LibreOffice.  There is a
poppler product listed on https://bugs.freedesktop.org/.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Build fail on Ubuntu 14.04

2016-09-28 Thread Jason Crain
On Wed, Sep 28, 2016 at 08:36:01PM +0200, Albert Astals Cid wrote:
> El dimarts, 27 de setembre de 2016, a les 18:20:43 CEST, Jason Crain va 
> escriure:
> > On Tue, Sep 27, 2016 at 10:31:21PM +0200, Albert Astals Cid wrote:
> > > El dijous, 15 de setembre de 2016, a les 15:30:08 CEST, Jason Crain va
> > > 
> > > escriure:
> > > > On 2016-09-15, Alex Korobkin <korobkin...@gmail.com> wrote:
> > > > > poppler-document.cc:1521:25: error: invalid conversion from 'int' to
> > > > > 'GParamFlags' [-fpermissive]
> > > > > 
> > > > > G_PARAM_READWRITE));
> > > > 
> > > > ...
> > > > 
> > > > > Does it need a newer version of glib-2.0 since 0.47 release? Or am I
> > > > > missing something other library or reference?
> > > > 
> > > > It needs a newer version of glib.  See
> > > > https://bugs.freedesktop.org/97432.
> > > > Old glib has G_PARAM_READWRITE as a #define and C++ doesn't like that.
> > > 
> > > Anyone knows what's that newer glib version so we can update the checks?
> > 
> > It's changed in commit 6c395244, in glib version 2.41.0.
> 
> 6c395244 is our commit hash or glib's?

It's glib's hash: https://git.gnome.org/browse/glib/commit/?id=6c395244
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Build fail on Ubuntu 14.04

2016-09-27 Thread Jason Crain
On Tue, Sep 27, 2016 at 10:31:21PM +0200, Albert Astals Cid wrote:
> El dijous, 15 de setembre de 2016, a les 15:30:08 CEST, Jason Crain va 
> escriure:
> > On 2016-09-15, Alex Korobkin <korobkin...@gmail.com> wrote:
> > > poppler-document.cc:1521:25: error: invalid conversion from 'int' to
> > > 'GParamFlags' [-fpermissive]
> > > 
> > > G_PARAM_READWRITE));
> > 
> > ...
> > 
> > > Does it need a newer version of glib-2.0 since 0.47 release? Or am I
> > > missing something other library or reference?
> > 
> > It needs a newer version of glib.  See https://bugs.freedesktop.org/97432.
> > Old glib has G_PARAM_READWRITE as a #define and C++ doesn't like that.
> 
> Anyone knows what's that newer glib version so we can update the checks?

It's changed in commit 6c395244, in glib version 2.41.0.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Build fail on Ubuntu 14.04

2016-09-15 Thread Jason Crain
On 2016-09-15, Alex Korobkin  wrote:
> poppler-document.cc:1521:25: error: invalid conversion from 'int' to
> 'GParamFlags' [-fpermissive]
> G_PARAM_READWRITE));
...
> Does it need a newer version of glib-2.0 since 0.47 release? Or am I
> missing something other library or reference?

It needs a newer version of glib.  See https://bugs.freedesktop.org/97432.
Old glib has G_PARAM_READWRITE as a #define and C++ doesn't like that.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Alternate path for utils/.libs?

2016-06-22 Thread Jason Crain
On 2016-06-22, Bill Hollingsworth  wrote:
> I am using a system where I must install poppler in a subdirectory tree of 
> /var.  I am using the --prefix=DIR option of ./configure to compile it.
> 
> I need to use some of the poppler utilities (e.g., pdftotext). pdftotext (in 
> /var/task/poppler/utils) wants to write a temporary file in 
> /var/task/poppler/utils/.libs at each run.
> 
> On the system I am using, pdftotext does not have permission to write to 
> /var/task/poppler/utils/.libs and I am not able to give it that permission. I 
> copied pdftotext to /tmp and pdftotext successfully created the subdirectory 
> /tmp/.libs but does not have permission to write to it.
> 
> Those are the confines of the system I am using. Is it possible to compile 
> poppler to use /tmp for the temporary files rather than creating a .libs 
> subdirectory?

Have you actually installed poppler?  The behaviour you mention sounds
like the way libtool scripts set up the environment so that the correct
libraries are used by a not installed application.  But that's really
only meant to be used in a development environment.

I expect that if you have actually installed poppler, by using "make
install", that the binaries would instead be placed in somewhere like
/var/task/poppler/bin, they would be real binaries instead of libtool
scripts, and they wouldn't be trying to write to a .libs directory.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Error: Couldn't find a font for 'Helvetica'

2016-05-19 Thread Jason Crain
On Thu, May 19, 2016 at 07:12:53AM +, LOPEZ OLIVIER wrote:
> I'm using poppler in my application for reading pdf.
> I've taking a libpoppler-qt4.dll that I found in internet, however when I 
> using it and read pdf with Helvetica I've this message error :
> "Error: Couldn't find a font for 'Helevtica '"
> I use qt4 in my application.
> I did not succed to compil the source of poppler for having my own 
> libpoppler-qt4.dll.
> I ask you  if you have a recent libpoppler-qt4.dll with implementation of 
> helevetica.

Poppler has worked with Helvetica for a very long time.  On Windows, it
should be mapped to the arial fonts.  I don't know why it's failing in
your case, but you could compile the source yourself and step through
the code to find why it's not working.  I would start with
SplashOutputDev::doUpdateFont in the file poppler/SplashOutputDev.cc
since I think that's where that error message comes from.

And no, we don't distribute binaries ourselves, only the source.  I
don't have much experience compiling things on Windows so I probably
won't be able to help with any compilation errors.  I understand cmake
is involved and lots of fiddling with dependencies, but not much else.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Poppler provided printf() functions on Windows not language compliant

2016-03-04 Thread Jason Crain
On Fri, Mar 04, 2016 at 06:06:49PM -0800, mathog wrote:
> Since this is at least a problem in the libpoppler version in devlibs, a bug
> has been filed here.
> 
>   https://bugs.launchpad.net/inkscape-devlibs/+bug/1552913
> 
> At this point I don't know if the issue is how this particular one was
> built, or some problem poppler has in general on Windows.  (It doesn't seem
> to have this issue on Linux.)
> 
> Regards,
> 
> David Mathog
> mat...@caltech.edu
> Manager, Sequence Analysis Facility, Biology Division, Caltech

From what I can tell looking at dissambly, linking with libpoppler will cause a
mingw printf function to be used, otherwise a printf from msvcrt is used.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Poppler provided printf() functions on Windows not language compliant

2016-03-04 Thread Jason Crain
On Fri, Mar 04, 2016 at 01:58:54PM -0800, mathog wrote:
> On 04-Mar-2016 13:49, mathog wrote:
> >In tracking down a bug in Inkscape here:
> >
> >  https://bugs.launchpad.net/inkscape/+bug/1538361
> >
> >it was discovered that the version of Poppler in devlibs61 appears to
> >provide its own printf() functions, which replace the usual ones
> 
> Hmm, or not.  Downloaded and unpacked poppler-0.41.0 and found that
> 
> grep -R sprintf .
> 
> did not turn up any code that defines a new function.  So now I'm really
> mystified.
> How would linking in a static libpoppler break an applications' use of a
> printf() function if it doesn't define a new one?
> 
> Thanks,
> 
> David Mathog
> mat...@caltech.edu
> Manager, Sequence Analysis Facility, Biology Division, Caltech

I'm not familiar with compiling for mingw or devlibs, but I'd be curious to see
if you run that test program in a debugger and step into the printf function or
try the command "info symbol printf" from gdb, to see where the printf function
actually goes.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Commercial Licensing of Poppler

2016-02-22 Thread Jason Crain
On Mon, Feb 22, 2016 at 09:29:00PM +0530, Hari Pravin wrote:
> Hi There,
> 
> We are considering Poppler Utils "pdftocairo" and "pdftoppm" to be used as
> part of a SAAS solution that is under development. As the licensing of our
> solution is not compatible with GPL, I am not sure if Poppler can be used
> along with it without acquiring a commercial license. If there is a need
> for a commercial license what is the cost of it and whom should I contact
> on this regard.
> 
> Looking forward for someone who can guide me on this regard. Thanks!
> 
> Regards,
> Hari Pravin

You can't get a commercial license of poppler.  The copyright is owned by
dozens of people and you would need to contact each of them individually to
work out an agreement.  Poppler is a fork of xpdf though, and you might be able
to get a license for xpdf.  I think you can contact them at
www.glyphandcog.com.  You would of course lose any modifications or
improvements that have been made in poppler.
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Radio buttons and NoToggleToOff

2016-01-14 Thread Jason Crain
On 2016-01-14, Albert Astals Cid  wrote:
> Hi guys, I was having a look at the radio buttons spec/implementation and 
> found the NoToggleToOff flag.
> 
> Spec says " If set, exactly one radio button shall be selected at
> all times; selecting the currently selected button has no effect. If clear,
> clicking the selected button deselects it, leaving no button selected."
> 
> Which i understand that if the bit is not set means that you can end up 
> having 
> a group of radio buttons with none selected when clicking on the selected one.
> 
> I modified the attached file so that the vertical radio (Alta/modifcacion/
> baja) does not have the NoToggleToOff flag set i.e. /Ff 32768
> 
> When loading the file into Adobe Reader it seems it doesn't let me uncheck 
> the 
> radio.
> 
> Am I reading the spec wrong? Or maybe this this is a bug in Adobe Reader?
> 
> Anything else i may have missed?

I don't think you've missed anything.  According to the spec, it looks like you
should be able to uncheck the boxes.  I've also found various forum and mailing
list posts complaining about that feature not working in Adobe Reader, or only
working in certain versions.  It looks like the only way to get that behavour
is to remove the radio flag, so they're check boxes instead.
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] [PATCH] Catalog::getNumPages(): validate page count

2015-09-17 Thread Jason Crain

On 2015-09-17 08:57, Leonard Rosenthol wrote:

While it is unclear in ISO 32000-1 whether such a PDF is invalid, we
made it clear in 32000-2 that you can only have one copy of each page
in the Pages tree.  So personally, I wouldn’t waste much time on this
particular file.

Leonard


OK, if it's not allowed by the spec, I have no real objection to the 
object count check.



On 9/17/15, 1:04 AM, "poppler on behalf of Jason Crain"
<poppler-boun...@lists.freedesktop.org on behalf of
ja...@aquaticape.us> wrote:


On Wed, Sep 16, 2015 at 09:05:58PM -0400, William Bader wrote:

> > I don't know of a good way to validate the page count. Even
> > going through the page tree might be hard to do right without
> > leading to an infinite loop, in addition to being slow.
>
> Catalog::cachePageTree goes over the tree, but i agree doing that
> to calculate the num of pages can be meh.

If the number of pages is huge, the PDF might be intentionally
corrupted to provoke a bug in a particular PDF viewer, and other
data structures could be subtly corrupted as well. Any scan would
have to proceed very cautiously.

If there is a minimum number of objects required for a page, and if
the total number of objects is easy to find, could poppler
immediately reject files with (total num objects) / (min objects per
page) < page count?


The document at
https://drive.google.com/open?id=0ByTyiZeyQ4p9cTVBUllNRmI3bmM is what
I'm thinking of.  It has 5 objects and a single page that is listed in
the /Kids array 10 times.  Duplicating the page just means adding it
to the array again and incrementing /Count.  If we want this document
to work then there's really no minimum number of objects required for
a page.  Otherwise, each page would require at least a /Page object.

FWIW Adobe Reader shows an error on the document after the first
duplicated page.  Other viewers show it just fine.

___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] [PATCH] Catalog::getNumPages(): validate page count

2015-09-16 Thread Jason Crain
On Wed, Sep 16, 2015 at 09:05:58PM -0400, William Bader wrote:
> > > I don't know of a good way to validate the page count. Even
> > > going through the page tree might be hard to do right without
> > > leading to an infinite loop, in addition to being slow.
> >
> > Catalog::cachePageTree goes over the tree, but i agree doing that
> > to calculate the num of pages can be meh.
> 
> If the number of pages is huge, the PDF might be intentionally
> corrupted to provoke a bug in a particular PDF viewer, and other
> data structures could be subtly corrupted as well. Any scan would
> have to proceed very cautiously.
> 
> If there is a minimum number of objects required for a page, and if
> the total number of objects is easy to find, could poppler
> immediately reject files with (total num objects) / (min objects per
> page) < page count?

The document at
https://drive.google.com/open?id=0ByTyiZeyQ4p9cTVBUllNRmI3bmM is what
I'm thinking of.  It has 5 objects and a single page that is listed in
the /Kids array 10 times.  Duplicating the page just means adding it
to the array again and incrementing /Count.  If we want this document
to work then there's really no minimum number of objects required for
a page.  Otherwise, each page would require at least a /Page object.

FWIW Adobe Reader shows an error on the document after the first
duplicated page.  Other viewers show it just fine.
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Working with Asian languages

2015-09-14 Thread Jason Crain

On 2015-09-13 20:06, Rob Hawkins wrote:

Greetings all,

Can pdftohtml produce output for Burmese, Khmer, Indonesian, Thai and
Vietnamese?  I didn't see a language pack for any except Thai, and
that one doesn't produce properly formatted characters for my source
files.  They're missing the vowel marks.  The other languages fail
completely on my setup.  I've tried on OS X and Ubuntu 12.

My source files are here:
https://github.com/robhawkins/drive-taiwan/tree/master/input/pdf

Chinese seems to work fine.

I found out that PDF.js will produce good output, though I already
have code based on pdftohtml output and would rather not switch if not
necessary.  I wonder if there is something wrong with my setup.

Thanks for any help even if it's just a "nope, that's not possible"
kind of reply =)

Rob


pdftohtml can work with those languages but it depends the ability to
extract the plain text from the document.  From the couple of PDFs I've
looked at, they have problems with text extraction.  Possibly poppler
could do a better job, but as several application I tried have problems
extracting text from those documents, it's probably just a problem with
those documents.

I assume that PDF.js just works in a different way and doesn't require
the extracted text to be correct.
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] [PATCH] Catalog::getNumPages(): validate page count

2015-09-11 Thread Jason Crain

On 2015-09-11 06:59, Even Rouault wrote:

Hi,

here's a V2 implementing suggested changes.

Best regards,

Even


From 0001-Catalog-getNumPages-validate-page-count.patch:

@@ -856,6 +856,18 @@ int Catalog::getNumPages()
   }
 } else {
   numPages = (int)obj.getNum();
+  if (numPages <= 0 ) {
+error(errSyntaxError, -1,
+  "Invalid page count {0:d}", numPages);
+numPages = 0;
+  }
+  else if (numPages > xref->getNumObjects()) {
+error(errSyntaxError, -1,
+  "Page count ({0:d}) larger than number of objects 
({1:d})",

+  numPages, xref->getNumObjects());
+numPages = 0;
+  }
+
 }

 catDict.free();


I know I said I liked the idea of comparing the number of pages to the 
number
of objects, but on second thought, I think I could make a PDF that was 
just
many copies of the same page so it would be a completely valid PDF that 
has
more pages than objects.  I don't know of a good way to validate the 
page
count.  Even going through the page tree might be hard to do right 
without

leading to an infinite loop, in addition to being slow.
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] [PATCH] Catalog::getNumPages(): validate page count

2015-09-08 Thread Jason Crain

On 2015-09-08 07:43, Adrian Johnson wrote:

On 08/09/15 21:06, Even Rouault wrote:

Hi,

A too huge number may cause the gmallocn() in Catalog::cachePageTree()
to crash even if we call it with a low page number.

Even




+  // to avoid too huge memory allocations layer and avoid crashes
+  // This is the maximum number of indirect objects as per
ISO-32000:2008 (Table C-1)


Table C-1 is a list of minimum limits for 32-bit readers.



+  // We could probably decrease that number again. PDFium for
example uses 1 Mi
+  else if (numPages > 8 * 1024 * 1024) {
+error(errSyntaxWarning, -1,
+  "Page count ({0:d}) too big. Limiting number of
reported pages to 8 Mi",
+  numPages);


Instead of imposing an arbitrary limit we should just add a check for
gmallocn() returning NULL and print an error.

For broken PDFs that report an invalid size (see bug 85140) we could
check if the page count exceeds the number of objects in the XRef.


By the way, bug 91353 is also about an invalid (fuzzed) PDF claiming 
millions of pages.  I thought about maybe walking the page tree to count 
pages if the count seems unreasonable but it didn't seem worth the 
effort.  I like your idea better.

___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] poppler-qt5 Ubuntu 13.10 failed to load .pdf files...

2014-02-19 Thread Jason Crain

On 2014-02-19 05:52, JIA Pei wrote:

And, I just want to open an .pdf file with the following line:

Poppler::Document* m_pDocument = Poppler::Document::load();

this-m_qtFileName is of value 
\home\jiapei\Documents\CloudStorage.pdf


the value of m_pDocument is always NULL, namely 0x0.

Did anybody successfully load a .pdf file under ubuntu 13.10 with
poppler-qt5 ?
Please give me a hand... 


Try using a forward slash '/' instead of a backslash in the file path.  
You should probably call it like:


Poppler::Document* m_pDocument = 
Poppler::Document::load(/home/jiapei/Documents/CloudStorage.pdf)


and see if there are any errors printed to the console.
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Linking Poppler to Code::Blocks

2013-04-30 Thread Jason Crain
On Thu, Apr 25, 2013 at 01:21:13PM +0200, Christopher Icely wrote:
 Hi Jason,
 
 That makes a bucket load of sense, I've been just linking to a generic
 libpoppler.dll.a file as opposed to the file you described -
 lipoppler-cpp.ddl.a.
 
 However the problem is, is that when I built codeblocks poppler project, it
 only created the libpoppler.dll.a and libpoppler-qt4.dll.a files. And
 while there is a cpp folder in the build directory it is only populated
 with folders that have to do with Cmake (CMakeFiles, cmake_install,
 CTestTestfile etc...).
 
 Do you have any idea why this might be the case? Is it for example that the
 C++ front end needs particular dependencies and if Cmake doesn't find them
 it doesn't build the C++ front end? If so do you know what the dependencies
 are for the C++ front end?
 
 Thank you for any help you can provide me.
 
 Kind regards
 Chris

Sorry for the delay.  I have been without internet access for a few
days.  Also, please send your replies to the mailing list.

I don't know why it didn't build libpoppler-cpp.dll for you.  I just
tried with CMake and CodeBlocks on Windows and it built the library.

Yes, if the dependencies are not available, or if ENABLE_CPP is
disabled, it will not build the CPP frontend.  The only dependency I
am aware of is Iconv.  CMake should state whether the 'cpp wrapper' is
being built when you configure it.


 On Mon, Apr 22, 2013 at 4:46 AM, Jason Crain ja...@aquaticape.us wrote:
 
  On Sat, Apr 20, 2013 at 08:20:42PM +0200, Christopher Icely wrote:
   Good Day All,
  
   Firstly, I do apologize if this is the incorrect forum in which to ask my
   questions however, I'm really at my wit's end with this problem and I was
   hoping one of you could perhaps help me.
  
   Basically I wish to write code that will allow me to extract annotations
   from PDFs. However, I'm yet to write any code as I've spent an inordinate
   amount of time in just getting Poppler built. These are the steps I've
   followed so far:
  
   {System specs: Windows 7, MinGW, CodeBlocks}
  
   1) I have a folder structure like so:
   C:\Users\Chris\Documents\Poppler\build\
   -poppler-0.22.2
   -poppler-0.22.2_Build
  
   The file poppler-0.22.2 is the unzipped source files while the
   poppler-0.22.2_Build file was made by the Cmake GUI with Cairo, JPEG,
  QT4
   and TIFF included. Furthermore, Cmake was instructed to generate a
   CodeBlocks - MinGW Makefiles.
  
   2) After the CodeBlocks project was generated by Cmake, the project was
   built in CodeBlocks and I was left with the following:
  
   C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\
   --CMakeFiles
   --cpp
   --poppler
   --qt4
   --test
   --utils
   --cmake_install.cmake
   --CMakeCache
   --config.h
   --CTestfile.cmake
   --libpoppler.dll
   --libpoppler.dll.a
   --Makefile
   --poppler.cbp
   --poppler.layout
  
   3) Now i need to link the poppler library to my project. Therefore in
   CodeBlocks I did the following:
  
   a)Settings-Compiler-Linker settings: Link libraries
   and I set the path to:
  
  C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a
  
   b)Then in  Settings-Compiler-Search directories-Linker
   I set the path to:
   C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\
  
   c)Then I set up the linking for my project:
   Project-Build Options-Linker settings
   and set the path to
  
  C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a
  
   d)And finally:
   Project-Build Options-Search directories-Linker
   and add the path:
   C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\
  
   4) I have now written the following code in my main.cpp just to see if
   everything works:
  
   1 : #include iostream
   2 : #include
  
  C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-global.h
   3 : #include
  
  C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-document.h
   4 :
   5 : using namespace std;
   6 :
   7 : int main()
   8 : {
   9 :
   10:
   11:   const string dir =
   C:\\Users\\Chris\\Documents\\WorkForDad\\2013\\Pdf Automation\\Anotation
   Extraction\\Remuneration Report.pdf;
   12:
   13:poppler::document *doc = poppler::document::load_from_file(dir);
   14:
   15:return 0;
   16: }
  
   However, I get the following error in myBuild messages when I build the
   code:
  
  
   C:\Users\Chris\Documents\WorkForDad\2013\Pdf
   Automation\Test\Clean

Re: [poppler] Linking Poppler to Code::Blocks

2013-04-21 Thread Jason Crain
On Sat, Apr 20, 2013 at 08:20:42PM +0200, Christopher Icely wrote:
 Good Day All,
 
 Firstly, I do apologize if this is the incorrect forum in which to ask my
 questions however, I'm really at my wit's end with this problem and I was
 hoping one of you could perhaps help me.
 
 Basically I wish to write code that will allow me to extract annotations
 from PDFs. However, I'm yet to write any code as I've spent an inordinate
 amount of time in just getting Poppler built. These are the steps I've
 followed so far:
 
 {System specs: Windows 7, MinGW, CodeBlocks}
 
 1) I have a folder structure like so:
 C:\Users\Chris\Documents\Poppler\build\
 -poppler-0.22.2
 -poppler-0.22.2_Build
 
 The file poppler-0.22.2 is the unzipped source files while the
 poppler-0.22.2_Build file was made by the Cmake GUI with Cairo, JPEG, QT4
 and TIFF included. Furthermore, Cmake was instructed to generate a
 CodeBlocks - MinGW Makefiles.
 
 2) After the CodeBlocks project was generated by Cmake, the project was
 built in CodeBlocks and I was left with the following:
 
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\
 --CMakeFiles
 --cpp
 --poppler
 --qt4
 --test
 --utils
 --cmake_install.cmake
 --CMakeCache
 --config.h
 --CTestfile.cmake
 --libpoppler.dll
 --libpoppler.dll.a
 --Makefile
 --poppler.cbp
 --poppler.layout
 
 3) Now i need to link the poppler library to my project. Therefore in
 CodeBlocks I did the following:
 
 a)Settings-Compiler-Linker settings: Link libraries
 and I set the path to:
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a
 
 b)Then in  Settings-Compiler-Search directories-Linker
 I set the path to:
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\
 
 c)Then I set up the linking for my project:
 Project-Build Options-Linker settings
 and set the path to
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a
 
 d)And finally:
 Project-Build Options-Search directories-Linker
 and add the path:
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\
 
 4) I have now written the following code in my main.cpp just to see if
 everything works:
 
 1 : #include iostream
 2 : #include
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-global.h
 3 : #include
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-document.h
 4 :
 5 : using namespace std;
 6 :
 7 : int main()
 8 : {
 9 :
 10:
 11:   const string dir =
 C:\\Users\\Chris\\Documents\\WorkForDad\\2013\\Pdf Automation\\Anotation
 Extraction\\Remuneration Report.pdf;
 12:
 13:poppler::document *doc = poppler::document::load_from_file(dir);
 14:
 15:return 0;
 16: }
 
 However, I get the following error in myBuild messages when I build the
 code:
 
 
 C:\Users\Chris\Documents\WorkForDad\2013\Pdf
 Automation\Test\Clean\main.cpp||In function 'int main()':|
 C:\Users\Chris\Documents\WorkForDad\2013\Pdf
 Automation\Test\Clean\main.cpp|13|warning: unused variable 'doc'
 [-Wunused-variable]|
 obj\Debug\main.o||In function `main':|
 C:\Users\Chris\Documents\WorkForDad\2013\Pdf
 Automation\Test\Clean\main.cpp|13|undefined reference to
 `_imp___ZN7poppler8document14load_from_fileERKSsS2_S2_'|
 ||=== Build finished: 1 errors, 1 warnings (0 minutes, 1 seconds) ===|
 
 
 ###
 
 
 And in the Build log I get the following:
 
 
 -- Clean: Debug in Clean (compiler: GNU GCC
 Compiler)---
 
 Cleaned Clean - Debug
 
 -- Build: Debug in Clean (compiler: GNU GCC
 Compiler)---
 
 mingw32-g++.exe -Wall -fexceptions  -g  -g-c
 C:\Users\Chris\Documents\WorkForDad\2013\Pdf
 Automation\Test\Clean\main.cpp -o obj\Debug\main.o
 C:\Users\Chris\Documents\WorkForDad\2013\Pdf
 Automation\Test\Clean\main.cpp: In function 'int main()':
 C:\Users\Chris\Documents\WorkForDad\2013\Pdf
 Automation\Test\Clean\main.cpp:13:24: warning: unused variable 'doc'
 [-Wunused-variable]
 mingw32-g++.exe -L..\..\..\..\..\Poppler\build\poppler-0.22.2_Build
 -LC:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build  -o
 bin\Debug\Clean.exe obj\Debug\main.o
 ..\..\..\..\..\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a
 C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a
 
 obj\Debug\main.o: In function `main':
 C:/Users/Chris/Documents/WorkForDad/2013/Pdf
 Automation/Test/Clean/main.cpp:13: *undefined reference to
 `_imp___ZN7poppler8document14load_from_fileERKSsS2_S2_'*
 collect2.exe: error: ld returned 1 exit