[poppler] qt4/src qt5/src
qt4/src/poppler-link.cc | 32 +--- qt5/src/poppler-link.cc | 28 +++- 2 files changed, 32 insertions(+), 28 deletions(-) New commits: commit a80a036269eb18daf0ec69c23a8bc71fb4852acb Author: Albert Astals CidDate: Thu Mar 3 00:44:27 2016 +0100 Qt: Only check the link page for local links diff --git a/qt4/src/poppler-link.cc b/qt4/src/poppler-link.cc index 199e2db..b810c55 100644 --- a/qt4/src/poppler-link.cc +++ b/qt4/src/poppler-link.cc @@ -1,5 +1,5 @@ /* poppler-link.cc: qt interface to poppler - * Copyright (C) 2006-2007, Albert Astals Cid + * Copyright (C) 2006-2007, 2016, Albert Astals Cid * Copyright (C) 2007-2008, Pino Toscano * Copyright (C) 2010 Hib Eris * Copyright (C) 2012, Tobias Koenig @@ -289,21 +289,23 @@ class LinkMoviePrivate : public LinkPrivate d->changeZoom = ld->getChangeZoom(); int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0; - - ::Page *page; - if (d->pageNum > 0 && - d->pageNum <= data.doc->doc->getNumPages() && - (page = data.doc->doc->getPage( d->pageNum ))) - { - cvtUserToDev( page, left, top, , ); - cvtUserToDev( page, right, bottom, , ); - - d->left = leftAux / (double)page->getCropWidth(); - d->top = topAux / (double)page->getCropHeight(); - d->right = rightAux/ (double)page->getCropWidth(); - d->bottom = bottomAux / (double)page->getCropHeight(); + + if (!data.externalDest) { + ::Page *page; + if (d->pageNum > 0 && + d->pageNum <= data.doc->doc->getNumPages() && + (page = data.doc->doc->getPage( d->pageNum ))) + { + cvtUserToDev( page, left, top, , ); + cvtUserToDev( page, right, bottom, , ); + + d->left = leftAux / (double)page->getCropWidth(); + d->top = topAux / (double)page->getCropHeight(); + d->right = rightAux/ (double)page->getCropWidth(); + d->bottom = bottomAux / (double)page->getCropHeight(); + } + else d->pageNum = 0; } - else d->pageNum = 0; if (deleteDest) delete ld; } diff --git a/qt5/src/poppler-link.cc b/qt5/src/poppler-link.cc index ca6e6eb..2da5aee 100644 --- a/qt5/src/poppler-link.cc +++ b/qt5/src/poppler-link.cc @@ -290,20 +290,22 @@ class LinkMoviePrivate : public LinkPrivate int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0; - ::Page *page; - if (d->pageNum > 0 && - d->pageNum <= data.doc->doc->getNumPages() && - (page = data.doc->doc->getPage( d->pageNum ))) - { - cvtUserToDev( page, left, top, , ); - cvtUserToDev( page, right, bottom, , ); - - d->left = leftAux / (double)page->getCropWidth(); - d->top = topAux / (double)page->getCropHeight(); - d->right = rightAux/ (double)page->getCropWidth(); - d->bottom = bottomAux / (double)page->getCropHeight(); + if (!data.externalDest) { + ::Page *page; + if (d->pageNum > 0 && + d->pageNum <= data.doc->doc->getNumPages() && + (page = data.doc->doc->getPage( d->pageNum ))) + { + cvtUserToDev( page, left, top, , ); + cvtUserToDev( page, right, bottom, , ); + + d->left = leftAux / (double)page->getCropWidth(); + d->top = topAux / (double)page->getCropHeight(); + d->right = rightAux/ (double)page->getCropWidth(); + d->bottom = bottomAux / (double)page->getCropHeight(); + } + else d->pageNum = 0; } - else d->pageNum = 0; if (deleteDest) delete ld; } ___ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler
[poppler] utils/pdfinfo.1
utils/pdfinfo.1 |9 + 1 file changed, 9 insertions(+) New commits: commit a3c7f6184d1be3f2737086cf650f4012075515f8 Author: Adrián Pérez de CastroDate: Wed Mar 2 11:58:24 2016 +0200 Tagged-PDF: Document new pdfinfo flags in its manual page https://bugs.freedesktop.org/show_bug.cgi?id=64816 diff --git a/utils/pdfinfo.1 b/utils/pdfinfo.1 index 78e6f39..35bf6d5 100644 --- a/utils/pdfinfo.1 +++ b/utils/pdfinfo.1 @@ -96,6 +96,15 @@ the PDF file's Catalog object.) .B \-js Prints all JavaScript in the PDF. .TP +.B \-struct +Prints the logical document structure of a Tagged-PDF file. +.TP +.B \-struct-text +Print the textual content along with the document structure of a Tagged-PDF +file. Note that extracting text this way might be slow for big PDF files. +(Implies +.BR \-struct .) +.TP .B \-rawdates Prints the raw (undecoded) date strings, directly from the PDF file. .TP ___ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler
[poppler] poppler/SignatureHandler.cc poppler/SignatureHandler.h
poppler/SignatureHandler.cc |2 +- poppler/SignatureHandler.h | 22 +- 2 files changed, 10 insertions(+), 14 deletions(-) New commits: commit 7cf52e56677e11b15d610017bccd0cc3f74badaf Author: Emmanuele BassiDate: Wed Mar 2 04:38:52 2016 + Use correct includes for NSPR/NSS headers The header files provided by NSS3 are inside versioned directories, `$includedir/nss3` and `$includedir/nspr4`, which are provided by the nss3 pkg-config file as include directives for the compiler. We can also use nspr.h as a single entry point, to avoid cherry picking specific headers. https://bugzilla.freedesktop.org/show_bug.cgi?id=94360 diff --git a/poppler/SignatureHandler.cc b/poppler/SignatureHandler.cc index 01496e3..21d9c4d 100644 --- a/poppler/SignatureHandler.cc +++ b/poppler/SignatureHandler.cc @@ -15,7 +15,7 @@ #include "SignatureHandler.h" #include "goo/gmem.h" -#include +#include #include #include diff --git a/poppler/SignatureHandler.h b/poppler/SignatureHandler.h index e6ace24..8e2a4da 100644 --- a/poppler/SignatureHandler.h +++ b/poppler/SignatureHandler.h @@ -17,21 +17,17 @@ #include "SignatureInfo.h" /* NSPR Headers */ -#include -#include -#include -#include -#include +#include /* NSS headers */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include class SignatureHandler { ___ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler
Re: [poppler] Malformed/random output for raw_order_layout with c++ interface
El Wednesday 02 March 2016, a les 11:24:09, Jeroen Ooms va escriure: > I am trying to get the same (or similar) text output from the c++ interface > as when using the 'pdftotext' utility without the -layout option. > However raw_order_layout gives malformed output (no text at all for most > pages): > > ustring str = p->text(p->page_rect(), page::raw_order_layout); > > An example: > > - source: http://arxiv.org/pdf/1403.2805.pdf > - pdftotext default output: http://pastebin.com/raw/A93xPT4j > - cpp with page::physical_layout: http://pastebin.com/raw/MZFpTRbD > - cpp with page::raw_order_layout http://pastebin.com/raw/n8dcsqkZ > > The last output is obviously malformed. It misses most text, has no spaces, > etc. Also each time I run it, I get different results so it looks like > there is a memory bug. > > The source code of my bindings is on github: > https://github.com/ropensci/pdftools/blob/master/src/bindings.cpp Maybe you can have a look? The code of pdftotext is pretty small so looking at the cpp frontend and looking what's wrong should not be very hard. Cheers, Albert ___ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler
[poppler] poppler.pc missing Requires.private / Libs.private
The pkgconfig file for poppler does not contain the configured dependencies required for static linking: > pkg-config --libs --static poppler-cpp -L/usr/local/Cellar/poppler/0.41.0/lib -lpoppler-cpp -lpoppler This is certainly incomplete. Correct output (in my case) would be something along the lines of: -L/usr/local/Cellar/poppler/0.41.0/lib -L/usr/local/Cellar/cairo/1.14.6_1/lib -L/usr/local/Cellar/glib/2.46.2/lib -L/usr/local/Cellar/libffi/3.0.13/lib -L/usr/local/Cellar/glib/2.46.2/lib -L/usr/local/opt/gettext/lib -L/usr/local/Cellar/pixman/0.34.0/lib -L/usr/local/Cellar/fontconfig/2.11.1_2/lib -L/usr/local/Cellar/freetype/2.6.3/lib -L/usr/local/Cellar/libpng/1.6.21/lib -L/usr/local/Cellar/little-cms2/2.7/lib -L/usr/local/Cellar/openjpeg/1.5.2_1/lib -L/usr/local/Cellar/libtiff/4.0.6/lib -lpoppler-cpp -lpoppler -lcairo -lz -lgobject-2.0 -lffi -lglib-2.0 -lintl -liconv -Wl,-framework,Carbon -Wl,-framework,Foundation -lpixman-1 -lfontconfig -lexpat -lfreetype -lz -lbz2 -lpng16 -lz -lpng16 -lz -llcms2 -lm -lopenjpeg -ltiff -ljpeg -lz I am not an expert but I think the configure script should record dependencies in the poppler.pc fields Requires.private or Libs.private. Libraries such as libcurl or cairo provide good examples. ___ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler
[poppler] Malformed/random output for raw_order_layout with c++ interface
I am trying to get the same (or similar) text output from the c++ interface as when using the 'pdftotext' utility without the -layout option. However raw_order_layout gives malformed output (no text at all for most pages): ustring str = p->text(p->page_rect(), page::raw_order_layout); An example: - source: http://arxiv.org/pdf/1403.2805.pdf - pdftotext default output: http://pastebin.com/raw/A93xPT4j - cpp with page::physical_layout: http://pastebin.com/raw/MZFpTRbD - cpp with page::raw_order_layout http://pastebin.com/raw/n8dcsqkZ The last output is obviously malformed. It misses most text, has no spaces, etc. Also each time I run it, I get different results so it looks like there is a memory bug. The source code of my bindings is on github: https://github.com/ropensci/pdftools/blob/master/src/bindings.cpp ___ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler
Re: [poppler] utils/pdfinfo.cc
Quoting Adrián Pérez de Castro (2016-03-01 22:53:08) > Quoting Albert Astals Cid (2016-03-01 20:29:55) > > This commit forgot to update the man page. > > Good point, I'll see to post a follow-up patch with the changes for the man > page tomorrow -- today is already a bit late for me, sorry. Done, bug with patch here: https://bugs.freedesktop.org/show_bug.cgi?id=94363 :-) -- ⌨ Adrian signature.asc Description: signature ___ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler
[poppler] 2 commits - poppler/Gfx.cc poppler/GfxState.cc poppler/GfxState.h poppler/SplashOutputDev.cc poppler/SplashOutputDev.h
poppler/Gfx.cc | 33 -- poppler/GfxState.cc|7 ++- poppler/GfxState.h |7 +++ poppler/SplashOutputDev.cc | 80 - poppler/SplashOutputDev.h |3 + 5 files changed, 122 insertions(+), 8 deletions(-) New commits: commit 1f7cb78f8b771bae8bfd96a7a7ca3afbaf89c749 Author: Albert Astals CidDate: Wed Mar 2 09:51:46 2016 +0100 Fix memory leak in Matte parsing Also remove unneeded comment diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index 4c10155..471bea6 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -14,7 +14,7 @@ // under GPL version 2 or later // // Copyright (C) 2005 Jonathan Blandford -// Copyright (C) 2005-2013, 2015 Albert Astals Cid +// Copyright (C) 2005-2013, 2015, 2016 Albert Astals Cid // Copyright (C) 2006 Thorkild Stray // Copyright (C) 2006 Kristian Høgsberg // Copyright (C) 2006-2011 Carlos Garcia Campos @@ -4570,7 +4570,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { } // handle the Matte entry maskDict->lookup("Matte", ); - if (obj1.isArray()) { // && maskStr->getKind() != strDCT) { + if (obj1.isArray()) { if (obj1.getArray()->getLength() != colorSpace->getNComps()) { error(errSyntaxError, -1, "Matte entry should have {0:d} components but has {1:d}", colorSpace->getNComps(), obj1.getArray()->getLength()); @@ -4595,6 +4595,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { } } } + obj1.free(); haveSoftMask = gTrue; } else if (maskObj.isArray()) { // color key mask commit 36c276f1af7e0f1d8a207f6cdcaa80a24e95e044 Author: Thomas Freitag Date: Wed Mar 2 09:50:01 2016 +0100 Splash: Implementation of matte entries in softmasks of softmasked images Bug #22473 diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index bb5f9b1..4c10155 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -28,7 +28,7 @@ // Copyright (C) 2008 Michael Vrable // Copyright (C) 2008 Hib Eris // Copyright (C) 2009 M Joonas Pihlaja -// Copyright (C) 2009-2015 Thomas Freitag +// Copyright (C) 2009-2016 Thomas Freitag // Copyright (C) 2009 William Bader // Copyright (C) 2009, 2010 David Benjamin // Copyright (C) 2010 Nils Höglund @@ -4568,7 +4568,33 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { delete maskColorMap; goto err1; } - //~ handle the Matte entry + // handle the Matte entry + maskDict->lookup("Matte", ); + if (obj1.isArray()) { // && maskStr->getKind() != strDCT) { +if (obj1.getArray()->getLength() != colorSpace->getNComps()) { + error(errSyntaxError, -1, "Matte entry should have {0:d} components but has {1:d}", +colorSpace->getNComps(), obj1.getArray()->getLength()); +} else if (maskWidth != width || maskHeight != height) { + error(errSyntaxError, -1, "Softmask with matte entry {0:d} x {1:d} must have same geometry as the image {2:d} x {3:d}", +maskWidth, maskHeight, width, height); +} else { + GfxColor matteColor; + for (i = 0; i < colorSpace->getNComps(); i++) { +obj1.getArray()->get(i, ); +if (!obj2.isNum()) { + obj2.free(); + error(errSyntaxError, -1, "Matte entry {0:d} should be a number but it's of type {1:d}", i, obj2.getType()); + + break; +} +matteColor.c[i] = dblToCol(obj2.getNum()); +obj2.free(); + } + if (i == colorSpace->getNComps()) { +maskColorMap->setMatteColor(); + } +} + } haveSoftMask = gTrue; } else if (maskObj.isArray()) { // color key mask diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index bd3b42d..603bf5b 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -18,7 +18,7 @@ // Copyright (C) 2006, 2010 Carlos Garcia Campos // Copyright (C) 2006-2015 Albert Astals Cid // Copyright (C) 2009, 2012 Koji Otani -// Copyright (C) 2009, 2011-2015 Thomas Freitag +// Copyright (C) 2009, 2011-2016 Thomas Freitag // Copyright (C) 2009 Christian Persch // Copyright (C) 2010 PaweŠWiejacha // Copyright (C) 2010 Christian Feuersänger @@ -5821,6 +5821,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, GBool useByteLookup; ok = gTrue; + useMatte =