[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1668-ge3d2cd4

[email protected] (Chris Liddell)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  e3d2cd4b2f13573962105d1761e7bb58d5f079c9 (commit)
      from  4ca426a86125b7bf2f52c00fbba1cef1395ea011 (commit)

----------------------------------------------------------------------
commit e3d2cd4b2f13573962105d1761e7bb58d5f079c9
Author: Chris Liddell <[email protected]>
Date:   Wed Sep 11 12:18:51 2019 +0100

    Bug 701563: pdfwrite annotation pdfmark /Border key
    
    Despite the spec saying the values for the /Border key are in user space
    coordinates, Distiller appears to pass the values through to the output PDF
    untouched (no rescaling - unlike the values for /Rect, also in user space,
    according to the spec, which it does scale/translate). Ghostscript/pdfwrite
    did scale the /Border values.
    
    This just changes pdfwrite to write the values out unchanged.

diff --git a/devices/vector/gdevpdfm.c b/devices/vector/gdevpdfm.c
index 345b97e..30cc1e1 100644
--- a/devices/vector/gdevpdfm.c
+++ b/devices/vector/gdevpdfm.c
@@ -266,54 +266,16 @@ pdfmark_make_rect(char str[MAX_RECT_STRING], const gs_rect * prect)
     str[stell(&s)] = 0;
 }
 
+#define MAX_BORDER_STRING 100
 /* Write a transformed Border value on a stream. */
 static int
 pdfmark_write_border(stream *s, const gs_param_string *str,
                      const gs_matrix *pctm)
 {
-    /*
-     * We don't preserve the entire CTM in the output, and it isn't clear
-     * what CTM is applicable to annotations anyway: we only attempt to
-     * handle well-behaved CTMs here.
-     */
-    uint size = str->size;
-#define MAX_BORDER_STRING 100
-    char chars[MAX_BORDER_STRING + 1];
-    double bx, by, c;
-    gs_point bpt, cpt;
-    const char *next;
+    int i;
 
-    if (str->size > MAX_BORDER_STRING)
-        return_error(gs_error_limitcheck);
-    memcpy(chars, str->data, size);
-    chars[size] = 0;
-    if (sscanf(chars, "[%lg %lg %lg", &bx, &by, &c) != 3)
-        return_error(gs_error_rangecheck);
-    gs_distance_transform(bx, by, pctm, &bpt);
-    gs_distance_transform(0.0, c, pctm, &cpt);
-    pprintg3(s, "[%g %g %g", fabs(bpt.x), fabs(bpt.y), fabs(cpt.x + cpt.y));
-    /*
-     * We don't attempt to do 100% reliable syntax checking here --
-     * it's just not worth the trouble.
-     */
-    next = strchr(chars + 1, ']');
-    if (next == 0)
-        return_error(gs_error_rangecheck);
-    if (next[1] != 0) {
-        /* Handle a dash array.  This is tiresome. */
-        double v;
-
-        stream_putc(s, '[');
-        while (next != 0 && sscanf(++next, "%lg", &v) == 1) {
-            gs_point vpt;
-
-            gs_distance_transform(0.0, v, pctm, &vpt);
-            pprintg1(s, "%g ", fabs(vpt.x + vpt.y));
-            next = strchr(next, ' ');
-        }
-        stream_putc(s, ']');
-    }
-    stream_putc(s, ']');
+    for (i = 0; i < str->size; i++)
+        stream_putc(s, str->data[i]);
     return 0;
 }
 


Summary of changes:
 devices/vector/gdevpdfm.c | 46 ++++------------------------------------------
 1 file changed, 4 insertions(+), 42 deletions(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.