summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaph Levien <raph.levien@artifex.com>2006-08-09 17:48:58 +0000
committerRaph Levien <raph.levien@artifex.com>2006-08-09 17:48:58 +0000
commit0547fc99452256a099fee4f127413eca6c21013f (patch)
treef39a0cafa5085835b892a14b0fe1a6805ff029fe
parent0a23bd8fa56a9f9b1012aaaf87ab1315863187c9 (diff)
Fix: Change pdfwrite pattern bbox to use PDF compliant syntax for float
bbox coordinates, rather than sprintf %g. Fixes (reopened) bug #688167. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@6981 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/src/gdevpdfv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gs/src/gdevpdfv.c b/gs/src/gdevpdfv.c
index 33877b003..683ff6ac2 100644
--- a/gs/src/gdevpdfv.c
+++ b/gs/src/gdevpdfv.c
@@ -200,14 +200,16 @@ pdf_store_pattern1_params(gx_device_pdf *pdev, pdf_resource_t *pres,
double scale_y = pdev->HWResolution[1] / 72.0;
cos_dict_t *pcd = cos_stream_dict((cos_stream_t *)pres->object);
cos_dict_t *pcd_Resources = cos_dict_alloc(pdev, "pdf_pattern(Resources)");
- char buf[60];
+ float bbox[4];
int code;
if (pcd == NULL || pcd_Resources == NULL)
return_error(gs_error_VMerror);
pdev->substream_Resources = pcd_Resources;
- sprintf(buf, "[%g %g %g %g]", t->BBox.p.x, t->BBox.p.y,
- t->BBox.q.x, t->BBox.q.y);
+ bbox[0] = t->BBox.p.x;
+ bbox[1] = t->BBox.p.y;
+ bbox[2] = t->BBox.q.x;
+ bbox[3] = t->BBox.q.y;
/* The graphics library assumes a shifted origin to provide
positive bitmap pixel indices. Compensate it now. */
smat.tx += pinst->step_matrix.tx;
@@ -230,7 +232,7 @@ pdf_store_pattern1_params(gx_device_pdf *pdev, pdf_resource_t *pres,
if (code >= 0)
code = cos_dict_put_c_key_int(pcd, "/TilingType", t->TilingType);
if (code >= 0)
- code = cos_dict_put_string(pcd, (byte *)"/BBox", 5, (byte *)buf, strlen(buf));
+ code = cos_dict_put_c_key_floats(pcd, "/BBox", bbox, 4);
if (code >= 0)
code = cos_dict_put_matrix(pcd, "/Matrix", &smat);
if (code >= 0)