summaryrefslogtreecommitdiff
path: root/gs/src/gdevpdti.c
diff options
context:
space:
mode:
authorIgor Melichev <igor.melichev@artifex.com>2004-01-14 13:45:56 +0000
committerIgor Melichev <igor.melichev@artifex.com>2004-01-14 13:45:56 +0000
commit6b7bbacf59e308e30b785abedfc9dc6ca491771a (patch)
tree7c2a641404f7674939598c0f5d026d580c371812 /gs/src/gdevpdti.c
parent053b3de34b2b5d1c6cf7ca4ed2a53029f35be326 (diff)
pdfwrite : Implementing the PDF 1.4 encryption, step 2.
DETAILS : It implements the encryption of most PDF streams. Strings are not done yet. It can process 001-01.ps, but there are problems with other files. EXPECTED DIFFERENCES : None. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@4572 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdti.c')
-rw-r--r--gs/src/gdevpdti.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gs/src/gdevpdti.c b/gs/src/gdevpdti.c
index 8d9d4b65b..8396e1235 100644
--- a/gs/src/gdevpdti.c
+++ b/gs/src/gdevpdti.c
@@ -267,6 +267,9 @@ pdf_begin_char_proc_generic(gx_device_pdf * pdev, pdf_font_resource_t *pdfont,
stream_puts(s, "<</Length >>stream\n");
ppos->start_pos = stell(s);
}
+ code = pdf_encrypt(pdev, &pdev->strm, pres->object->id);
+ if (code < 0)
+ return code;
*ppcp = pcp;
return 0;
}
@@ -300,11 +303,14 @@ pdf_begin_char_proc(gx_device_pdf * pdev, int w, int h, int x_width,
int
pdf_end_char_proc(gx_device_pdf * pdev, pdf_stream_position_t * ppos)
{
- stream *s = pdev->strm;
- long start_pos = ppos->start_pos;
- long end_pos = stell(s);
- long length = end_pos - start_pos;
-
+ stream *s;
+ long start_pos, end_pos, length;
+
+ pdf_encrypt_end(pdev);
+ s = pdev->strm;
+ start_pos = ppos->start_pos;
+ end_pos = stell(s);
+ length = end_pos - start_pos;
if (length > 999999)
return_error(gs_error_limitcheck);
sseek(s, start_pos - 15);