[pdftex] pdftex-pdfcrypt update 31/03

Heiko Oberdiek oberdiek at ruf.uni-freiburg.de
Mon Apr 2 12:29:18 CEST 2001

At 14:28 31.03.2001 +0200, Ricardo Sanchez Carmenes wrote:
>The pdfcrypt version of pdftex has been updated:
>31/03/2001 a number of bugs, mainly shown by Heiko Oberdiek, fixed:

What will be the result of the discussion about the syntax of
the \pdfcrypt primitive?

For testing, I have written a LaTeX package for support of
the new \pdfcrypt primitive:

%%% cut %%% pdfcrypt.sty %%% cut %%%
% File:      pdfcrypt.sty
% Version:   2001/04/02 v0.1
% Author:    Heiko Oberdiek
% Email:     <oberdiek at ruf.uni-freiburg.de>
% Copyright: Copyright (C) 2001 Heiko Oberdiek.
%            This program may be distributed and/or modified under
%            the conditions of the LaTeX Project Public License,
%            either version 1.2 of this license or (at your option)
%            any later version. The latest version of this license
%            is in
%              http://www.latex-project.org/lppl.txt
%            and version 1.2 or later is part of all distributions
%            of LaTeX version 1999/12/01 or later.
% Function:  This package provides an interface to the new
%            pdfTeX primitive \pdfcrypt, implemented by
%            Ricardo Sanchez Carmenes <carmenes at bioquimica.uniovi.es>.
% Required:  pdfTeX-0.14h-pdfcrypt-20010310, pdfcrypt-20010331
% Use:       The options can be set as package options or
%            in the command \pdfcryptsetup:
%              owner=OwnerPassword
%              user=UserPassword
%              print, copy, edit, annotate=true, false
%              all, none
%            Example:
%              \usepackage[owner=Donald,user=Knuth,none,print]{pdfcrypt}
% History:   2001/04/02 v0.1:
%              First public version, published in the pdftex
%              mailing list for testing with pdfcrypt-20010331

  [2001/04/02 v0.1 Interface for setting pdf encryption (HO)]

\typeout{* Caution: This is a test version for pdfcrypt-20010331 *}

\expandafter\ifx\csname pdfcrypt\endcsname\relax
    PDF encryption is not supported%
    You need pdfTeX 3.14159-14h-pdfcrypt-20010310 or higher.%


\newif\ifpc at print
\newif\ifpc at copy
\newif\ifpc at edit
\newif\ifpc at annotate
\let\pc at owner\@empty
\let\pc at user\@empty

\edef\pc at temp{\catcode`\noexpand\"=\the\catcode`\"\relax}
\def\pc at set{%
    owner "\pc at owner"
    user "\pc at user"
    \ifpc at print   \else no\fi print
    \ifpc at copy    \else no\fi copy
    \ifpc at edit    \else no\fi edit
    \ifpc at annotate\else no\fi annotate%
\pc at temp

\def\pc at boolkey{\@dblarg\pc@@boolkey}
  \lowercase{\def\pc at temp{#3}}%
  \ifx\pc at temp\@empty
    \let\pc at temp\pc at true
  \ifx\pc at temp\pc at true
    \ifx\pc at temp\pc at false
      \let\pc at temp\relax
  \ifx\pc at temp\relax
      Unexpected value \string`#3\string' of
      option \string`#2\string'\MessageBreak
      instead of
      \string`true\string' or \string`false\string'%
    \csname pc@#2\pc at temp\endcsname
\def\pc at true{true}
\def\pc at false{false}

\define at key{pc}{print}[true]{%
  \pc at boolkey{print}{#1}%
\define at key{pc}{copy}[true]{%
  \pc at boolkey{copy}{#1}%
\define at key{pc}{edit}[true]{%
  \pc at boolkey{edit}{#1}%
\define at key{pc}{annotate}[true]{%
  \pc at boolkey{annotate}{#1}%
\define at key{pc}{all}[]{%
  \pc at boolkey{print}{true}%
  \pc at boolkey{copy}{true}%
  \pc at boolkey{edit}{true}%
  \pc at boolkey{annotate}{true}%
\define at key{pc}{none}[]{%
  \pc at boolkey{print}{false}%
  \pc at boolkey{copy}{false}%
  \pc at boolkey{edit}{false}%
  \pc at boolkey{annotate}{false}%

\define at key{pc}{owner}{%
  \def\pc at owner{#1}%
\define at key{pc}{user}{%
  \def\pc at user{#1}%

  \pc at set

% support of configuration file
\let\pc at ExecuteOptions\ExecuteOptions
\let\ExecuteOptions\pc at ExecuteOptions

% process global and local options
\def\pc at ProcessOptionsWithKV{%
  \let\pc at temp\@empty
    \@ifundefined{KV at pc@\CurrentOption}{}{%
      \edef\pc at temp{\pc at temp,\CurrentOption,}%
  \edef\pc at temp{%
      \pc at temp\@ptionlist{\@currname.\@currext}%
  \pc at temp
\pc at ProcessOptionsWithKV

%%% cut %%% pdfcrypt.sty %%% cut %%%

Yours sincerely
  Heiko <oberdiek at ruf.uni-freiburg.de>

More information about the pdftex mailing list