summaryrefslogtreecommitdiff
path: root/gs/src/gdevpdfm.c
diff options
context:
space:
mode:
authorIgor Melichev <igor.melichev@artifex.com>2004-07-05 17:03:28 +0000
committerIgor Melichev <igor.melichev@artifex.com>2004-07-05 17:03:28 +0000
commite8a6acdec2da7337e410e48a6df4f67755ce6863 (patch)
treedc78cc1ea1422e9b31275b81be7f00e50e43d47d /gs/src/gdevpdfm.c
parent9d4d142b24a905d05c3cbb305867456b4b3da8cf (diff)
ps2write step 4 : Stream data length must preceed the stream.
DETAILS : The new code is disabled with PS2WRITE 0 in gdevvec.h . pdf_begin_data_stream, pdfmark_PS wrote a stream data length after the stream object. With OrderResources true we write a direct object instead that. EXPECTED DIFFERENCES : None. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@5139 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdfm.c')
-rw-r--r--gs/src/gdevpdfm.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/gs/src/gdevpdfm.c b/gs/src/gdevpdfm.c
index 8a8e28a98..e60fc90a2 100644
--- a/gs/src/gdevpdfm.c
+++ b/gs/src/gdevpdfm.c
@@ -1100,13 +1100,29 @@ pdfmark_PS(gx_device_pdf * pdev, gs_param_string * pairs, uint count,
return code;
pdf_open_separate(pdev, level1_id);
s = pdev->strm;
- pprintld1(s, "<</Length %ld 0 R>>stream\n", length_id);
- size = pdfmark_write_ps(s, &level1);
- stream_puts(s, "endstream\n");
- pdf_end_separate(pdev);
- pdf_open_separate(pdev, length_id);
- pprintld1(s, "%ld\n", (long)size);
- pdf_end_separate(pdev);
+# if PS2WRITE
+ if (pdev->OrderResources) {
+ int pos = stell(s) + 8, pos1;
+
+ pprintld1(s, "<</Length >>stream\n", length_id);
+ size = pdfmark_write_ps(s, &level1);
+ stream_puts(s, "endstream\n");
+ pos1 = stell(s);
+ sseek(s, pos);
+ pprintld1(pdev->strm, "%ld", (long)size);
+ sseek(s, pos1);
+ pdf_end_separate(pdev);
+ } else
+# endif
+ {
+ pprintld1(s, "<</Length %ld 0 R>>stream\n", length_id);
+ size = pdfmark_write_ps(s, &level1);
+ stream_puts(s, "endstream\n");
+ pdf_end_separate(pdev);
+ pdf_open_separate(pdev, length_id);
+ pprintld1(s, "%ld\n", (long)size);
+ pdf_end_separate(pdev);
+ }
}
size = pdfmark_write_ps(pdev->streams.strm, &source);
code = cos_stream_add(pcs, size);