poppler issueshttps://gitlab.freedesktop.org/poppler/poppler/-/issues2024-02-12T23:28:33Zhttps://gitlab.freedesktop.org/poppler/poppler/-/issues/1449Avoiding symbol clashes2024-02-12T23:28:33ZKai PastorAvoiding symbol clashesAn extended vcpkg CI run with paraview using vtk using gdal using poppler run into linker errors due `Parser::~Parser` being defined both in Paraview and in Poppler. This is just one class name to be concerned about. There is also Array,...An extended vcpkg CI run with paraview using vtk using gdal using poppler run into linker errors due `Parser::~Parser` being defined both in Paraview and in Poppler. This is just one class name to be concerned about. There is also Array, Dict, etc. What is the preferred solution:
- Moving the classes to a namespace, e.g. `Poppler`.
- Adding a prefix similar to `GooString`, i.e. `Goo...`.
- Adjust as needed vs. moving all private classes vs. moving all classes.
This will change ABI, and it won't be entirely source compatible. (It is possible to import the classes into the global namespace using `using ...`, but at least forward declarations must be changed. Macros might provide additional help, a la QT_BEGIN_NAMESPACE.)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1456Render very slow and lag when opening pdf files created by powerpoint2024-02-11T13:19:42ZFirestar-ReimuRender very slow and lag when opening pdf files created by powerpointRender very slow and lag when opening pdf files created by powerpoint.
I find this issue when I open the slides[第17讲_总复习1.pdf](/uploads/8ba65cde102cd5647a6130ef4cce5404/第17讲_总复习1.pdf) written by my teacher which are 50-100 pages pdf fil...Render very slow and lag when opening pdf files created by powerpoint.
I find this issue when I open the slides[第17讲_总复习1.pdf](/uploads/8ba65cde102cd5647a6130ef4cce5404/第17讲_总复习1.pdf) written by my teacher which are 50-100 pages pdf files created by powerpoint.
I use okular and installed poppler-data
It usually needs several seconds to load a page or it will be blank, and it loads just 2-3 pages at one time.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1462libc++-19: implicit instantiation of undefined template 'std::char_traits<uns...2024-02-05T14:35:02ZLinux Userlibc++-19: implicit instantiation of undefined template 'std::char_traits<unsigned short>'OS: Gentoo Linux amd64 musl/clang
```
$ clang --version
clang version 19.0.0git78b4e7c5+libcxx
Target: x86_64-gentoo-linux-musl
Thread model: posix
InstalledDir: /usr/lib/llvm/19/bin
Configuration file: /etc/clang/x86_64-gentoo-linux-mus...OS: Gentoo Linux amd64 musl/clang
```
$ clang --version
clang version 19.0.0git78b4e7c5+libcxx
Target: x86_64-gentoo-linux-musl
Thread model: posix
InstalledDir: /usr/lib/llvm/19/bin
Configuration file: /etc/clang/x86_64-gentoo-linux-musl-clang.cfg
```
Compiling `poppler-9999` fails with the following error:
```bash
[269/283] /usr/lib/ccache/bin/clang++ -Dpoppler_cpp_EXPORTS -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999 -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/fofi -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/goo -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/poppler -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999_build -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999_build/poppler -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999_build/cpp -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O3 -pipe -march=native -mtune=native -D_FORTIFY_SOURCE=3 -flto -stdlib=libc++ -Wnon-virtual-dtor -Woverloaded-virtual -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT cpp/CMakeFiles/poppler-cpp.dir/poppler-destination.cpp.o -MF cpp/CMakeFiles/poppler-cpp.dir/poppler-destination.cpp.o.d -o cpp/CMakeFiles/poppler-cpp.dir/poppler-destination.cpp.o -c /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-destination.cpp
FAILED: cpp/CMakeFiles/poppler-cpp.dir/poppler-destination.cpp.o
/usr/lib/ccache/bin/clang++ -Dpoppler_cpp_EXPORTS -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999 -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/fofi -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/goo -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/poppler -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999_build -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999_build/poppler -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp -I/var/tmp/portage/app-text/poppler-9999/work/poppler-9999_build/cpp -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O3 -pipe -march=native -mtune=native -D_FORTIFY_SOURCE=3 -flto -stdlib=libc++ -Wnon-virtual-dtor -Woverloaded-virtual -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT cpp/CMakeFiles/poppler-cpp.dir/poppler-destination.cpp.o -MF cpp/CMakeFiles/poppler-cpp.dir/poppler-destination.cpp.o.d -o cpp/CMakeFiles/poppler-cpp.dir/poppler-destination.cpp.o -c /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-destination.cpp
In file included from /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-destination.cpp:24:
In file included from /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-destination.h:25:
In file included from /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-global.h:32:
/usr/include/c++/v1/string:730:43: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
730 | static_assert((is_same<_CharT, typename traits_type::char_type>::value),
| ^
/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-global.h:101:43: note: in instantiation of template class 'std::basic_string<unsigned short>' requested here
101 | class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short>
| ^
/usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
| ^
In file included from /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-destination.cpp:24:
In file included from /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-destination.h:25:
In file included from /var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-global.h:32:
In file included from /usr/include/c++/v1/string:625:
/usr/include/c++/v1/string_view:296:43: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
296 | static_assert((is_same<_CharT, typename traits_type::char_type>::value),
| ^
/usr/include/c++/v1/__type_traits/is_convertible.h:28:102: note: in instantiation of template class 'std::basic_string_view<unsigned short>' requested here
28 | struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant<bool, __is_convertible(_T1, _T2)> {};
| ^
/usr/include/c++/v1/string:702:29: note: in instantiation of template class 'std::is_convertible<const std::basic_string<unsigned short> &, std::basic_string_view<unsigned short>>' requested here
702 | : public _BoolConstant< is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&
| ^
/usr/include/c++/v1/string:1044:27: note: in instantiation of template class 'std::__can_be_converted_to_string_view<unsigned short, std::char_traits<unsigned short>, std::basic_string<unsigned short>>' requested here
1044 | __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
| ^
/usr/include/c++/v1/string:1047:93: note: while substituting prior template arguments into non-type template parameter [with _Tp = std::basic_string<unsigned short>]
1047 | _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1048 | : __r_(__default_init_tag(), __default_init_tag()) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1049 | __self_view __sv = __t;
| ~~~~~~~~~~~~~~~~~~~~~~~
1050 | __init(__sv.data(), __sv.size());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1051 | }
| ~
/usr/include/c++/v1/string:709:7: note: while substituting deduced template arguments into function template 'basic_string' [with _Tp = std::basic_string<unsigned short>, $1 = (no value)]
709 | class basic_string {
| ^
/var/tmp/portage/app-text/poppler-9999/work/poppler-9999/cpp/poppler-global.h:101:26: note: while declaring the implicit copy constructor for 'ustring'
101 | class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short>
| ^
/usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
| ^
2 errors generated.
ninja: build stopped: subcommand failed.
```
The generic char_traits implementation has been deprecated in LLVM 17 and removed in https://github.com/llvm/llvm-project/commit/c3668779c13596e223c26fbd49670d18cd638c40.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1461Add option to not override files2024-01-29T22:48:29ZkenorbAdd option to not override filesCurrently when using "pdftotext file.pdf file.txt" syntax, the destination file is always overridden.
It would be great to have option to ignore the conversion if the file already exist.
Otherwise the default behaviour could be very dest...Currently when using "pdftotext file.pdf file.txt" syntax, the destination file is always overridden.
It would be great to have option to ignore the conversion if the file already exist.
Otherwise the default behaviour could be very destructive.
For example when you specify the same file as destination (by mistake), it's going to be zeroed. So there should be some safer option to work with which won't erase the existing files.
pdftotext version 22.02.0https://gitlab.freedesktop.org/poppler/poppler/-/issues/1460pdfimages should returns exit code 2 when cannot open output files2024-01-24T22:33:04ZFernando Herrerapdfimages should returns exit code 2 when cannot open output filesThis is the current behavior:
```
fer@dyckola:~$ pdfimages test-manuscript.pdf /dev/null/cannot-write-here/page-
I/O Error: Couldn't open image file '/dev/null/cannot-write-here/page--000.ppm'
fer@dyckola:~$ echo $?
0
```
But according...This is the current behavior:
```
fer@dyckola:~$ pdfimages test-manuscript.pdf /dev/null/cannot-write-here/page-
I/O Error: Couldn't open image file '/dev/null/cannot-write-here/page--000.ppm'
fer@dyckola:~$ echo $?
0
```
But according to the man page it should be 2:
```
EXIT CODES
The Xpdf tools use the following exit codes:
0 No error.
1 Error opening a PDF file.
2 Error opening an output file.
3 Error related to PDF permissions.
99 Other error.
```https://gitlab.freedesktop.org/poppler/poppler/-/issues/1454Unicode supplementary plane support in annotation2024-01-15T16:48:47ZKeyu TaoUnicode supplementary plane support in annotationCurrently, poppler/Annot.cc still assumes each Unicode (UTF-16) character (scalar) takes 2 bytes. (https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/poppler/Annot.cc#L3042, https://gitlab.freedesktop.org/poppler/poppler/-/blob...Currently, poppler/Annot.cc still assumes each Unicode (UTF-16) character (scalar) takes 2 bytes. (https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/poppler/Annot.cc#L3042, https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/poppler/Annot.cc#L3048-3049)
This is true for BMP (Basic Multilingual Plane) characters. However, some characters like emoji and some rare characters in natural languages, are not in BMP and takes 4 bytes in UTF-16:
```console
>>> # use Python console as an example
>>> "a".encode(encoding="utf-16")[2:] # BOM stripped
b'a\x00'
>>> "😀".encode(encoding="utf-16")[2:]
b'=\xd8\x00\xde'
>>> "𰻝".encode(encoding="utf-16")[2:]
b'\x83\xd8\xdd\xde'
```
I have tried to add supplementary plane handling inside `HorizontalTextLayouter` constructor like this:
```diff
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index e8db39ff..8147d89f 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -3044,18 +3044,31 @@ public:
newFontNeeded = false;
} else {
Unicode uChar;
+ int charLength;
if (isUnicode) {
uChar = (unsigned char)(text->getChar(i)) << 8;
uChar += (unsigned char)(text->getChar(i + 1));
+ charLength = 2;
+ // If uChar is in supplementary plane, we need to get the next character
+ // because the font may not have the glyph for the first character.
+ if (uChar >= 0xD800 && uChar <= 0xDBFF) {
+ if (i + 3 < text->getLength()) {
+ uChar = (uChar - 0xD800) * 0x400 + ((unsigned char)(text->getChar(i + 2)) << 8) + (unsigned char)(text->getChar(i + 3)) + 0x10000;
+ charLength = 4;
+ printf("uChar: %x\n", uChar);
+ }
+ }
} else {
uChar = pdfDocEncoding[text->getChar(i) & 0xff];
+ charLength = 1;
}
const std::string auxFontName = form->getFallbackFontForChar(uChar, *font);
if (!auxFontName.empty()) {
+ printf("auxFontName: %s\n", auxFontName.c_str());
std::shared_ptr<GfxFont> auxFont = form->getDefaultResources()->lookupFont(auxFontName.c_str());
// Here we just layout one char, we don't know if the one afterwards can be layouted with the original font
- GooString auxContents = GooString(text->toStr().substr(i, isUnicode ? 2 : 1));
+ GooString auxContents = GooString(text->toStr().substr(i, charLength));
if (isUnicode) {
auxContents.prependUnicodeMarker();
}
@@ -3070,13 +3083,14 @@ public:
// we also need to allow the character if we have not layouted anything yet because otherwise we will end up in an infinite loop
// because it is assumed we at least layout one character
if (!availableWidth || *availableWidth > 0 || (isUnicode && i == 2) || (!isUnicode && i == 0)) {
- i += isUnicode ? 2 : 1;
+ i += charLength;
data.emplace_back(outputText.toStr(), auxFontName, blockWidth, charCount);
}
} else {
+ printf("auxFontName: not found\n");
error(errSyntaxError, -1, "HorizontalTextLayouter, couldn't find a font for character U+{0:04uX}", uChar);
newFontNeeded = false;
- i += isUnicode ? 2 : 1;
+ i += charLength;
}
}
// Now layout the rest of the text with the original font
```
However, this does not work (I'm testing this with Okular) as it could not find font to show the new uChar. I'm afraid that further investigation is a bit beyond my knowledge :(https://gitlab.freedesktop.org/poppler/poppler/-/issues/1459Improper "transparency knockout group" support: transparent objects where opa...2024-01-13T09:59:45ZRodrigo SeveroImproper "transparency knockout group" support: transparent objects where opaque ones expectedPDF with opaque objects are rendered transparent with poppler. Adobe Acrobar, FoxIT and Sumatra PDF renders the opaque objects properly.
[cabeceira_dagua.pdf](/uploads/fd3dd5152846eec69bc86bbb918550d8/cabeceira_dagua.pdf)
Wrong poppler...PDF with opaque objects are rendered transparent with poppler. Adobe Acrobar, FoxIT and Sumatra PDF renders the opaque objects properly.
[cabeceira_dagua.pdf](/uploads/fd3dd5152846eec69bc86bbb918550d8/cabeceira_dagua.pdf)
Wrong poppler rendering:![poppler_wrong](/uploads/28e28fd6f595ff133fed400058e43150/poppler_wrong.jpg)
Correct Sumatra PDF rendering:![sumatra_right](/uploads/7e571cd1b15c1b8492d184a02e51afaa/sumatra_right.jpg)
Search for “transparency knockout” on both (https://therion.speleo.sk/wiki/contrib:externalviewers) and (https://helpx.adobe.com/illustrator/using/transparency-blending-modes.html)https://gitlab.freedesktop.org/poppler/poppler/-/issues/940Pdf outline modification2024-01-08T22:36:20ZZachary IngersollPdf outline modificationWhether it is possible to modify a pdf's outline based on a given outline file?Whether it is possible to modify a pdf's outline based on a given outline file?https://gitlab.freedesktop.org/poppler/poppler/-/issues/1458pdftotext: support tsv output in reading order2024-01-08T18:59:48ZFawaz Ahmedpdftotext: support tsv output in reading orderHello,
I see [tsv flag](https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/831) was added to emulate tesseract format.
Tesseract prints tsv in reading order, but the tsv output by pdftotext is not in reading order.
It wil...Hello,
I see [tsv flag](https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/831) was added to emulate tesseract format.
Tesseract prints tsv in reading order, but the tsv output by pdftotext is not in reading order.
It will be helpful if tsv follows `-layout` reading order, when `-tsv` is true.https://gitlab.freedesktop.org/poppler/poppler/-/issues/1451pdf to svg shows raster lines (clippaths)2024-01-02T16:14:59Zrvanderboompdf to svg shows raster lines (clippaths)Hey,
we like to use pdftocairo -svg for our pdf to svg conversion, but some material that exists of images concatted to 1 images via clippath , show raster lines where the seperate images connect.
Some other paid tools do not do this an...Hey,
we like to use pdftocairo -svg for our pdf to svg conversion, but some material that exists of images concatted to 1 images via clippath , show raster lines where the seperate images connect.
Some other paid tools do not do this and show as it is visible in pdf.
Added the materal and the svg result.
[HFD_20231216_0_005_HI.pdf](/uploads/e3e430b97bed774cf0519ec386875a4e/HFD_20231216_0_005_HI.pdf)
[HFD_20231216_0_005_HI.svg](/uploads/9a3a1197942d9fa55de206ec3a896d9b/HFD_20231216_0_005_HI.svg)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1453Text fails to display in Cairo backend but it's ok in Okular and Acrobat Reader2024-01-01T12:58:10ZNelson Benítez LeónText fails to display in Cairo backend but it's ok in Okular and Acrobat ReaderThe attached PDF (created by Acrobat Distiller 6.0 in Windows) shows fine in Okular and Acrobat Reader, but Evince and Poppler Cairo backend (pdftocairo) fails to display very large portions of text, it seems something related to the fon...The attached PDF (created by Acrobat Distiller 6.0 in Windows) shows fine in Okular and Acrobat Reader, but Evince and Poppler Cairo backend (pdftocairo) fails to display very large portions of text, it seems something related to the fonts embedded.
[bug168518.pdf](/uploads/e7ca4a22af14e4579caeedf6f9856899/bug168518.pdf)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1452pdfimages -png and -tiff give inverted colour output2023-12-30T14:09:36ZShriramana Sharmapdfimages -png and -tiff give inverted colour outputPlease download the attachment which is just the first page from https://archive.org/details/wg224 (to avoid huge download). This contains black text on white background.
Run the commands:
```
pdfimages -png p.pdf q
pdfimages -tiff p.p...Please download the attachment which is just the first page from https://archive.org/details/wg224 (to avoid huge download). This contains black text on white background.
Run the commands:
```
pdfimages -png p.pdf q
pdfimages -tiff p.pdf r
pdfimages -all p.pdf s
fax2tiff -o s-000.tif $(< s-000.params) s-000.ccitt
```
We can see that the files q-000.png and r-000.tif display the colours inverted ie white text on black background whereas going to CCITT and then to TIF gives the correct output.
Please look into this and fix it. Thank you!
Attachment:
[p.pdf](/uploads/5b253d8d62460aa22c9ac8a3d8b1d00a/p.pdf)https://gitlab.freedesktop.org/poppler/poppler/-/issues/18[PATCH] Poppler-0.18.typelib on macOS (Homebrew) can't work because of incorr...2023-12-26T12:44:23ZBugzilla Migration User[PATCH] Poppler-0.18.typelib on macOS (Homebrew) can't work because of incorrect dylib path## Submitted by Wataru Shimizu
Assigned to **poppler-bugs**
**[Link to original bug (#106417)](https://bugs.freedesktop.org/show_bug.cgi?id=106417)**
## Description
Created attachment 139385
Patch that adds --library-path of g-ir-...## Submitted by Wataru Shimizu
Assigned to **poppler-bugs**
**[Link to original bug (#106417)](https://bugs.freedesktop.org/show_bug.cgi?id=106417)**
## Description
Created attachment 139385
Patch that adds --library-path of g-ir-scanner to fix wrong path setting of typelib on macOS
Poppler-0.18.typelib install by homebrew can't work correctly because of the wrong library path setting. Here is the sample code and the error message:
---- poppler-test.rb ----
#!/usr/bin/env ruby
require 'poppler'
--------------------------
$ ./poppler-test.rb
(null)-WARNING **: Failed to load shared library '@rpath/libpoppler-glib.8.dylib' referenced by the typelib: dlopen(@rpath/libpoppler-glib.8.dylib, 9): image not found
--------------------------
It tries to load the path (@rpath/libppoppler-glib.8.dylib), but dlopen can't handle "@rpath". It should be an abosulte path (e.g. /usr/local/Cellar/poppler/0.64.0/libpoppler-glib.8.dylib).
I investigated the reason. When g-ir-scanner generates Poppler-0.18.gir from libpoppler-glib.8.dylib, it embeds the "install name" of the dylib into it. Then g-ir-compiler compiles Poppler-0.18.typelib from Poppler-0.18.gir. It means that if the install name of the dylib is @rpath style, typelib refers dylib with @rpath style path, so the typelib cannot be used. AFAIK, to generate gir and typelib correctly, the install name of dylib must be an absolute path, but the current poppler.rb (build setting of homebrew) generates dylib with @rpath style install name.
poppler.rb: https://github.com/Homebrew/homebrew-core/blob/master/Formula/poppler.rb
More precisely, it generates and installs libpoppler-glib.8.dylib with @rpath style (line 80-81), then modifies the installed binary to absolute path style (line 92-98). But the binary in the building process must be absolute path style.
It can be changed by cmake option "-DCMAKE_INSTALL_NAME_DIR=/path/to/lib -DCMKAE_BUILD_WITH_INSTALL_RPATH=ON" (I will propose homebrew-core to use these options instead of line 92-98). However, this modification causes another problem. If the dylib has abosulte path style install name and --no-libtool option is set to g-ir-scanner, it fails to generate gir. To fix this problem, it needs to specify --library-path option to refer the directory where libpoppler-glib.8.dylib exists. (See https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/11 for more detail).
During the building process, libpoppler-glib.8.dylib is placed at ${CMAKE_CURRENT_BINARY_DIR}, so I propose to set it. See the attachment patch file for the detail.
**Attachment 139385**, "Patch that adds --library-path of g-ir-scanner to fix wrong path setting of typelib on macOS":
[patch1.txt](/uploads/9ce8b831c13f269491d4c62a05feeb67/patch1.txt)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1377Poppler::PSConverter mismanages certain OTF fonts embedded in the document?2023-12-18T20:55:14ZSergio CallegariPoppler::PSConverter mismanages certain OTF fonts embedded in the document?Hi, I am encountering an issue with the Okular PDF viewer that might ultimately be caused by an incorrect behavior of PSConverter, so I am also posting here for feedback.
Some PDF documents using certain OTF fonts are visualized correct...Hi, I am encountering an issue with the Okular PDF viewer that might ultimately be caused by an incorrect behavior of PSConverter, so I am also posting here for feedback.
Some PDF documents using certain OTF fonts are visualized correctly by okular, but do not print well, because some characters get changed in to small squares. Looks like okular does not pass the PDF directly to the printer, but for historical reasons performs an intermediate conversion to postscript, using Poppler::PSConverter. Hence, I wonder if it might be this conversion to be troublesome and to break the fonts.
The issue is particularly frequent on documents prepared with Libreoffice, using the free Adobe fonts in the "Source" family (e.g. Source Sans 3, see https://github.com/adobe-fonts/source-sans).
Here is the link to the discussion on the okular tracker: https://bugs.kde.org/show_bug.cgi?id=467328
Here is a PDF document triggering the issue: [test.pdf](/uploads/028f3ccf3e109616bc4d9a508ec3f1b8/test.pdf)https://gitlab.freedesktop.org/poppler/poppler/-/issues/1309Duplicate glyphs in SVG output2023-12-15T17:09:09ZDmitry ShubinDuplicate glyphs in SVG outputWhen running our internal tests as part of the upgrade from Popppler 21.04 to 22.10, we have noticed that some result SVG files became a bit larger. The size increase itself is not a big concern, but the underlying issue may be more impo...When running our internal tests as part of the upgrade from Popppler 21.04 to 22.10, we have noticed that some result SVG files became a bit larger. The size increase itself is not a big concern, but the underlying issue may be more important - possibly related to "Refactor CairoFontEngine caching" update.
Steps to reproduce:
- Convert the attached document [compAnno.pdf](/uploads/d4f245d1d6c8faedee445c73fe57c1c3/compAnno.pdf) to SVG, using poppler v21.04, and using v22.10
- Expected result: size of the SVG produced by v22.10 is about the same or smaller
- Actual result: size of the SVG produced by v22.10 is bigger (207 Kb vs 200 Kb)
If you look into the differences, you may notice that the SVG produced by 22.10 [compAnno.pdf.p1.22-10.svg](/uploads/000bc4d2aad4ab5f7189ecd7ea7eec1b/compAnno.pdf.p1.22-10.svg) contains more glyphs than that of 21.04 [compAnno.pdf.p1.21-04.svg](/uploads/aea33845881bb25c1ca3bdfef00fdaf4/compAnno.pdf.p1.21-04.svg): 270 vs 255. The extra glyphs in 22.10 seem to be exact duplicates of others. For example, glyph1-10 and glyph14-15 are identical.
Thank you!
Dmitryhttps://gitlab.freedesktop.org/poppler/poppler/-/issues/1435text selection is incorrect when close to some math symbols2023-12-15T12:21:40ZRehan MALAKtext selection is incorrect when close to some math symbolsFrom : https://github.com/vedang/pdf-tools/issues/237
**Describe the bug**
text selection is incorrect when close to some math symbols
**Evince:**
![evince.png](/uploads/dbbbcd022b02dc3645e509f026c96dd4/evince.png)
**Emacs pdf-view ...From : https://github.com/vedang/pdf-tools/issues/237
**Describe the bug**
text selection is incorrect when close to some math symbols
**Evince:**
![evince.png](/uploads/dbbbcd022b02dc3645e509f026c96dd4/evince.png)
**Emacs pdf-view :**
![pdfview.png](/uploads/720e35a60bcc370313fdf942ae881b10/pdfview.png)
**Steps to Reproduce the behaviour**
- <span dir="">`Download https://webusers.imj-prg.fr/~pierre.schapira/LectNotes/CatShv.pdf`</span>
- <span dir="">`Go to page 31`</span>
- <span dir="">`Impossible to select the word "coproduct" in the Definition 2.1.1 ii) when the mouse is over the word 'coproduct'`</span>
- <span dir="">`(it is possible by selecting on the next line, on the 'or' word)`</span>
**What is the expected behaviour?**
- <span dir="">`open https://webusers.imj-prg.fr/~pierre.schapira/LectNotes/CatShv.pdf- directly in Firefox or Okular`</span>
- <span dir="">`Go to page 31`</span>
- <span dir="">`select the word "coproduct" in the Definition 2.1.1 ii)`</span>
**Firefox :**
![firefox.png](/uploads/2a6bbe3a638ce0d333ba100fd1f136b9/firefox.png)
**Okular :**
![okular.png](/uploads/e11f3c19ff75fcdca9bfe9a89911ddde/okular.png)
**Versions :**
```plaintext
libpoppler-*/unstable,now 22.12.0-2+b1 amd64 [installed]
```
```plaintext
OS: Debian GNU/Linux trixie/sid
Emacs Version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2023-09-05
pdf-tools 20230611.239
Evince : GNOME Document Viewer 45.alpha
```https://gitlab.freedesktop.org/poppler/poppler/-/issues/1450pdftocairo -pdf causes font errors that did not exist2023-12-14T22:24:28ZHakan Usaklipdftocairo -pdf causes font errors that did not existThe provided sample is a 1 page pdf without any errors in Adobe Acrobat.
[input.pdf](/uploads/e3ac808e1c5470a974e195224741cba6/input.pdf)
After processing on Windows with Poppler version 23.11.0
`pdftocairo.exe -pdf "c:\temp\input.pdf" ...The provided sample is a 1 page pdf without any errors in Adobe Acrobat.
[input.pdf](/uploads/e3ac808e1c5470a974e195224741cba6/input.pdf)
After processing on Windows with Poppler version 23.11.0
`pdftocairo.exe -pdf "c:\temp\input.pdf" "c:\temp\output.pdf"`
and checking the file in Adobe Acrobat, the following error message is introduced
![image](/uploads/1eeb6dc53c2d9d8fa93847e553fe49e6/image.png)
For your information and Best Regardshttps://gitlab.freedesktop.org/poppler/poppler/-/issues/1446Font selection (okular)2023-12-13T22:39:32ZAlbert WikFont selection (okular)I'm using poppler as part of the okular application, and I'm having problems getting it to select the right fonts.
To reproduce the issue, download and open the following PDF:
https://gwern.net/doc/psychology/personality/psychopathy/194...I'm using poppler as part of the okular application, and I'm having problems getting it to select the right fonts.
To reproduce the issue, download and open the following PDF:
https://gwern.net/doc/psychology/personality/psychopathy/1941-cleckley-maskofsanity.pdf
Note: make sure you have the relevant fonts installed.
Here is a screenshot from okular:
https://drive.google.com/file/d/178nuOFvWiBOoqmSIs7spAqDrGt2YHAqQ/view
The fonts "CourierNew" and "TimesNewRoman" are installed on the system, but poppler substitutes "NimbusMonoPS" and "Times Roman".
fontconfig appears to be correctly configured:
```
$ fc-match "CourierNew"
cour.ttf: "Courier New" "Regular"
$ fc-match "TimesNewRoman"
times.ttf: "Times New Roman" "Regular"
```https://gitlab.freedesktop.org/poppler/poppler/-/issues/1448[skia] FTBFS on Android with Fontconfig font manager2023-12-10T22:55:21ZJonLiu1993[skia] FTBFS on Android with Fontconfig font managerWhe I update port poppler version to [23.11.0](https://github.com/microsoft/vcpkg/pull/35494) I get this error:
````
CMakeFiles/poppler.dir/poppler/GlobalParams.cc.o -c /mnt/vcpkg-ci/buildtrees/poppler/src/er-23.11.0-08ca2759be.clean/pop...Whe I update port poppler version to [23.11.0](https://github.com/microsoft/vcpkg/pull/35494) I get this error:
````
CMakeFiles/poppler.dir/poppler/GlobalParams.cc.o -c /mnt/vcpkg-ci/buildtrees/poppler/src/er-23.11.0-08ca2759be.clean/poppler/GlobalParams.cc
/mnt/vcpkg-ci/buildtrees/poppler/src/er-23.11.0-08ca2759be.clean/poppler/GlobalParams.cc:1563:5: error: use of undeclared identifier 'displayFontDir'; did you mean 'displayFontDirs'?
displayFontDir = fontDir;
^~~~~~~~~~~~~~
displayFontDirs
/mnt/vcpkg-ci/buildtrees/poppler/src/er-23.11.0-08ca2759be.clean/poppler/GlobalParams.cc:1379:20: note: 'displayFontDirs' declared here
static const char *displayFontDirs[] = { "/usr/share/ghostscript/fonts", "/usr/local/share/ghostscript/fonts", "/usr/share/fonts/default/Type1", "/usr/share/fonts/default/ghostscript", "/usr/share/fonts/type1/gsfonts", nullptr };
^
/mnt/vcpkg-ci/buildtrees/poppler/src/er-23.11.0-08ca2759be.clean/poppler/GlobalParams.cc:1563:20: error: array type 'const char *[6]' is not assignable
displayFontDir = fontDir;
````
I see that displayFontDir is declared earlier in the file, so I don't know why I'm getting this error.
https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/poppler/GlobalParams.cc?ref_type=heads#L1278
````
// The path to the font directory. Set by GlobalParams::setFontDir()
static std::string displayFontDir;
````https://gitlab.freedesktop.org/poppler/poppler/-/issues/1106pdfimages: options to add a container to JBIG2 and CCITT data2023-11-24T13:42:01ZShai4shepdfimages: options to add a container to JBIG2 and CCITT dataThe current extraction of (embedded) JBIG2 (stream) does not include any header (like `0xFF 0xD8` for JPEG), at least when there is no global data. The jbig2 output produced by [jbig2enc](https://github.com/agl/jbig2enc) will add a heade...The current extraction of (embedded) JBIG2 (stream) does not include any header (like `0xFF 0xD8` for JPEG), at least when there is no global data. The jbig2 output produced by [jbig2enc](https://github.com/agl/jbig2enc) will add a header to indicate that this is a JBIG2 file. Although this might not be standardized, it is helpful to add such a header so that it could be passed to subsequent applications like `img2pdf`.
Similar for CCITT: it seems better to have an option to contain the CCITT into a TIFF file without any conversion, but just including a container to facilitate the subsequent processing. Unlike `-tiff` option, it will not convert everything else to TIFF, nor perform any conversion between different types of TIFFs.