Re: pdf inclusion bug

"Akira Kakuto" <[email protected]> Sat, 30 Mar 2019 09:16:48 +0900
Newsgroups gmane.comp.tex.pdftex
Message-ID <A6B64750362545C59D3CB5039732A156@CJ3001517A>
Dear Hartmut,

> when a.pdf is edited so that (/A/B/C) are compact without spaces,
> all seems to be fine. And (/A/B/C ) gives an error with letter C.
> Seems it's a poppler issue, called from pdftoepdf.cc, might happen
> in line 434:
>
> ...fontdesc->dictLookup("CharSet", &charset)...
>

Many thanks.
I could obtain correct b.pdf by applying an
attached patch: epdf.c.diff.

Thanks,
Akira
epdf.c.diff (application/octet-stream, 713 B)
--- epdf.c.orig	Fri Feb 19 11:45:32 2016
+++ epdf.c	Sat Mar 30 09:07:03 2019
@@ -77,8 +77,16 @@
     if (charset == NULL)
         return;
     assert(fd != NULL);
+    while (*charset == ' ' || *charset == '\t')
+        charset++;
     for (s = charset + 1, q = charset + strlen(charset); s < q; s = p + 1) {
-        for (p = s; *p != '\0' && *p != '/'; p++);
+        for (p = s; *p != '\0' && *p != '/' && *p != ' ' && *p != '\t'; p++);
+        if (*p == ' ' || *p == '\t') {
+            *p = '\0';
+            p++;
+            while (*p == ' ' || *p == '\t')
+                p++;
+        }
         *p = '\0';
         if ((char *) avl_find(fd->gl_tree, s) == NULL) {
             glyph = xstrdup(s);