home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / GhostScript / !GhostScr / 6_01 / lib / pdf_sec.ps < prev    next >
Text File  |  2000-03-09  |  2KB  |  60 lines

  1. %    Copyright (C) 1996, 1997 Aladdin Enterprises.  All rights reserved.
  2. % This file is part of Aladdin Ghostscript.
  3. % Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  4. % or distributor accepts any responsibility for the consequences of using it,
  5. % or for whether it serves any particular purpose or works at all, unless he
  6. % or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  7. % License (the "License") for full details.
  8. % Every copy of Aladdin Ghostscript must include a copy of the License,
  9. % normally in a plain ASCII text file named PUBLIC.  The License grants you
  10. % the right to copy, modify and redistribute Aladdin Ghostscript, but only
  11. % under certain conditions described in the License.  Among other things, the
  12. % License requires that the copyright notice and this notice be preserved on
  13. % all copies.
  14.  
  15. % $Id: pdf_sec.ps,v 1.1 2000/03/09 08:40:40 lpd Exp $
  16. % pdf_sec.ps
  17. % Security hooks for PDF reader.
  18.  
  19. % This file contains the procedures that have to take encryption into
  20. % account when reading a PDF file.  There is no actual decryption code here,
  21. % because U.S. export control laws might prohibit making this file available
  22. % to anyone outside the U.S. if the code were included.  Instead, you can
  23. % get the real version of this file from
  24. %    http://www.ozemail.com.au/~geoffk/pdfencrypt/pdf_sec.ps
  25. % or, if the ~ character upsets your software,
  26. %    http://www.ozemail.com.au/%7Egeoffk/pdfencrypt/pdf_sec.ps
  27. % NOTE: these URLs are referenced in the error message below.
  28.  
  29. /.setlanguagelevel where { pop 2 .setlanguagelevel } if
  30. .currentglobal true .setglobal
  31. /pdfdict where { pop } { /pdfdict 100 dict def } ifelse
  32. pdfdict begin
  33.  
  34. % Process the encryption information in the Trailer.
  35. /pdf_process_Encrypt
  36.  { (\n) =
  37.    (    **** The PDF input file uses encryption and cannot be processed.) =
  38.    (    **** Please get and install the patch available from) =
  39.    (    ****     http://www.ozemail.com.au/~geoffk/pdfencrypt/pdf_sec.ps) =
  40.    (\n) = flush
  41.    /pdfopen cvx /invalidfileaccess signalerror
  42.  } bind def
  43.  
  44. % Run the code to resolve an object reference.
  45. /pdf_run_resolve
  46.  { PDFfile resolveopdict .pdfrun
  47.  } bind def
  48.  
  49. % Prefix a decryption filter to a stream if needed.
  50. % Stack: readdata? dict parms file/string filternames
  51. /pdf_decrypt_stream
  52.  {
  53.  } bind def
  54.  
  55. end            % pdfdict
  56. .setglobal
  57.