Главная страница


ru.linux

 
 - RU.LINUX ---------------------------------------------------------------------
 From : Olli Artemjev                        2:5020/1354    27 Oct 2001  06:16:00
 To : All
 Subject : ?: gs & pdf_sec.ps (restricted/crypted pdf's) - как читать?
 -------------------------------------------------------------------------------- 
 
 GhostScript versions 4.02 and later надо сделать для чтения без ограничений
 pdf'ов. Сделал как написано. GNU Ghostscript 5.10 (1998-12-17) , однако
 теперь не знаю что делать дальше - сказав на консоли в иксах gs получаю
 пустое окошко плюс собственную gs-консоль, ввожу там полный путь к pdf файлу и
 получаю следующее:
 
 GS> /tmp/file.pdf
 
 GS<2>
 
 А дальше я просто не знаю что вводить. :( Мне нужно всего лишь
 переконвертировать в текст и, желательно, но не обязательно, отобразить
 на экране. В man не посылать - с man я и сам разберусь за пару дней, а
 хочется поскорее. ;)
 - --------------------cut-------------------------
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN">
 <HTML>
 <HEAD>
 <META name="description"
 content="Modifications to GhostScript to allow it to read encrypted PDF
 files.">
 <META name="keywords"
 content="PDF encryption PDF security GhostScript viewing printing">
 <TITLE>Encrypted PDFs</TITLE>
 <LINK REV=made HREF="mailto:geoffk@ozemail.com.au">
 </HEAD>
 <BODY>
 <H1>Encrypted PDFs</H1>
 
 <P>When you give a PDF document an owner password, Adobe Acrobat
 encrypts it so that you can't just remove the password from the file.
 This web page provides the
 modifications necessary to view encrypted PDFs with <A
 HREF="http://www.cs.wisc.edu/%7Eghost/">GhostScript</A>.
 
 <P>It used to be that source code like this was not permitted to be
 exported from the US.  Happily, the regulations have now changed,
 and the code is unrestricted in most countries.
 
 <H2>GhostScript versions 4.01 and earlier</H2>
 
 <P>To allow versions of GhostScript from 3.33 through 4.01 to read
 encrypted PDFs, you need to download the appropriate patch from the
 list below, place it in the same directory as the files
 pdf_base.ps and pdf_main.ps, and pipe them into
 <KBD>patch -l</KBD>.  If you don't have `patch' on your
 machine, you can probably find a version at
 <A HREF="ftp://ftp.gnu.org/pub/gnu/">your friendly GNU archive</A>.
 
 <P>There are patches for versions:
 
 <UL>
 <LI><A HREF="patch-gs333-pdfsec">3.33</A>,</LI>
 <LI><A HREF="patch-gs353-pdfsec">3.53</A>,</LI>
 <LI><A HREF="patch-gs401-pdfsec">4.00 and 4.01</A>.</LI>
 </UL>
 
 <P>The last of these patches is quite a bit better than patches for
 earlier versions.
 
 <P>It is likely that these patches will not work if GhostScript is
 compiled with 64-bit integers.
 
 <H2>GhostScript versions 4.02 and later</H2>
 
 <P>For these versions, things became somewhat simpler. All you need to do
 is replace the file called pdf_sec.ps with the version
 provided below, as described in the documentation.
 
 <P><A HREF="pdf_sec.ps"><STRONG>pdf_sec.ps</STRONG></A>
 
 <P>This file is version 1.0.4, which corrected a small bug involving
 user passwords.  Version 1.0.3 corrected a bug visible with the US
 Copyright Office's Form TX.  Version 1.0.2 added support for
 versions 5.0 and later of GhostScript.  Version 1.0.1 corrected
 support for interpreters with 64-bit integers.
 
 <H2>Usage information</H2>
 
 <P>If GhostScript reports
 <SAMP>****This file has a user password set.</SAMP>,
 you can specify a password by setting <VAR>PDFPassword</VAR> to either
 the user or owner password of the PDF file. On the command line, you
 might say
 <KBD>gs -sPDFPassword=apassword somefile.pdf</KBD>.
 Inside GhostScript, you can say
 <KBD>/PDFPassword (apassword) def</KBD>.
 You can also put this in a file generated with pdf2dsc; put it just
 after the line that says <SAMP>%%BeginProlog</SAMP>.
 
 <P>I'm told that to do this with GSview, you go to the Options menu,
 chose Configure Ghostscript, and place
 <KBD>-sPDFPassword=apassword</KBD> in the Ghostscript option.
 
 <H3>Lost Passwords</H3>
 
 <P>Of course, to do this you must know the user or owner password of
 the file.  If you got the file from someone else, you will want to ask
 them for the password.  If it was your file and you've forgotten what
 password you chose, you should take whatever documents you generated
 the PDF file from, and re-generate it.
 
 <P>Alternatively, you might try contacting <A
 HREF="http://www.pwcrack.com/">PWCrack</A>, who can help you unprotect
 the file.
 
 <H2>Technical Details</H2>
 
 <P>If you're interested in how the patch works, you should look
 at version 1.2 of the PDF reference manual (available at <A
 HREF="http://www.adobe.com/">Adobe's Web site</A>). My patches predate
 this description, but they seem to conform to it exactly.
 
 <H1>RC4-compatible and MD5 PostScript</H1>
 
 <UL>
 <LI><A HREF="rc4-source.ps">Source for an RC4-compatible algorithm 
 implemented in PostScript</A>.</LI>
 <LI><A HREF="md5-source.ps">Source for MD5 implemented in
 PostScript</A>.</LI>
 </UL>
 
 <P>If you have your browser set to automatically run PostScript files
 with (say) Ghostview, you'll find doing that is not very interesting,
 as they don't make any marks on the page; they just run some
 self-tests.
 
 <P><HR>
 <P>Unless otherwise specified, these files are Copyright 1996-2000
 <A HREF="mailto:geoffk@ozemail.com.au">Geoffrey Keating</A>, and may be freely 
 distributed with or without modifications, so long as proper attribution is 
 given and copyright notices are not removed.
 </BODY>
 </HTML>
 - --------------------cut-------------------------
 -- 
 Bye.Olli.     mailto(remove "NOSPAM"): olli@digger.NOSPAMorg.ru
 *: Linux may become a power in a well directed hands.
 
 --- Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.1 (Bryce Canyon)
  * Origin: Sunrise. (2:5020/1354.0)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 ?: gs & pdf_sec.ps (restricted/crypted pdf\'s) - как читать?   Olli Artemjev   27 Oct 2001 06:16:00 
Архивное /ru.linux/552462e0d1b0d.html, оценка 3 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional