[DVIPDFMx] dvipdfmx patch

Karl Berry karl at freefriends.org
Fri Mar 30 08:12:17 KST 2012


ChoF, Matthias,

Wdyt of the below?  Seems pretty straightforward.

Do you think you'll be able to put together a new dvipdfmx release for
TL'12?  If not, would it be ok if we just install this in the TL sources
for this release, until you do have time?

Thanks,
Karl


Date: Wed, 21 Mar 2012 13:59:05 +0100
From: Alexander Grahn <A.Grahn at hzdr.de>
To: <tex-live at tug.org>
Subject: [tex-live] dvipdfmx still alive?

[...]
a while ago I proposed a patch on the dvipdfmx mailing list which solves the
broken pdf:fstream issue.  It was first reported here

http://tug.org/mailman/htdig/tex-live/2010-September/027379.html

Unlike the pdftex counterpart
  \pdfobj stream file {...}

and the dvipdfmx pdf special
  pdf:image

which both find files in the current directory and in the TeX search path
(TEXINPUTS, fndb),
  pdf:fstream

wants an absolute path plus file name, otherwise the file cannot be
found.  The patch makes pdf:fstream behave like pdf:image as for locating
files.

[...]

This is the current version of the patch, the first one I sent had some
deficiencies. Thanks for taking it into considration.

Alexander

--- dvipdfmx-20110311/src/spc_pdfm.c	2011-03-08 03:08:35.000000000 +0100
+++ dvipdfmx-20110311/src/spc_pdfm.c.new	2012-03-08 12:48:48.000000000 +0100
@@ -1364,7 +1364,7 @@
 {
   pdf_obj *fstream;
   long     nb_read;
-  char    *ident, *instring;
+  char    *ident, *instring, *fullname;
   pdf_obj *tmp;
   FILE    *fp;
 
@@ -1400,11 +1400,19 @@
       RELEASE(ident);
       return  -1;
     }
-    fp = DPXFOPEN(instring, DPX_RES_TYPE_BINARY);
+    fullname = kpse_find_pict(instring);
+    if (!fullname) {
+      spc_warn(spe, "File \"%s\" not found.", instring);
+      pdf_release_obj(tmp);
+      RELEASE(ident);
+      return  -1;
+    }
+    fp = DPXFOPEN(fullname, DPX_RES_TYPE_BINARY);
     if (!fp) {
       spc_warn(spe, "Could not open file: %s", instring);
       pdf_release_obj(tmp);
       RELEASE(ident);
+      RELEASE(fullname);
       return -1;
     }
     fstream = pdf_new_stream(STREAM_COMPRESS);


More information about the dvipdfmx mailing list