| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% pdf14.dtx |
| 4 |
% |
| 5 |
% Written in 2010 by Manuel P\'egouri\'e-Gonnard <[email protected]>. |
| 6 |
% |
| 7 |
% This work may be distributed and/or modified under the |
| 8 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 9 |
% of this license or (at your option) any later version. |
| 10 |
% The latest version of this license is in |
| 11 |
% http://www.latex-project.org/lppl.txt |
| 12 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 13 |
% version 2005/12/01 or later. |
| 14 |
% |
| 15 |
% This work has the LPPL maintenance status `maintained'. |
| 16 |
% |
| 17 |
% The Current Maintainer of this work is Manuel P\'egouri\'e-Gonnard. |
| 18 |
% |
| 19 |
% This work consists of the source file pdf14.dtx |
| 20 |
% and the derived files pdf14.sy, pdf14.pdf, test-pdf14.tex. |
| 21 |
% |
| 22 |
% Unpacking: |
| 23 |
% tex pdf14.dtx |
| 24 |
% Documentation: |
| 25 |
% pdflatex pdf14.dtx |
| 26 |
% |
| 27 |
%<*ignore> |
| 28 |
\begingroup |
| 29 |
\def\x{LaTeX2e}% |
| 30 |
\expandafter\endgroup |
| 31 |
\ifcase 0\ifx\install y1\fi\expandafter |
| 32 |
\ifx\csname processbatchFile\endcsname\relax\else1\fi |
| 33 |
\ifx\fmtname\x\else 1\fi\relax |
| 34 |
\else\csname fi\endcsname |
| 35 |
%</ignore> |
| 36 |
%<*install> |
| 37 |
\input docstrip.tex |
| 38 |
|
| 39 |
\keepsilent |
| 40 |
\askforoverwritefalse |
| 41 |
|
| 42 |
\preamble |
| 43 |
|
| 44 |
Written in 2010 by Manuel P\string\'egouri\string\'e-Gonnard <[email protected]>. |
| 45 |
|
| 46 |
This work can be distributed and/or modified under the terms of the LPPL. |
| 47 |
This is a generated file, see source file \inFileName for more details. |
| 48 |
|
| 49 |
\endpreamble |
| 50 |
|
| 51 |
\generate{% |
| 52 |
\file{pdf14.sty}{\from{pdf14.dtx}{package}}% |
| 53 |
\file{test-pdf14.tex}{\from{pdf14.dtx}{testfile}}% |
| 54 |
} |
| 55 |
|
| 56 |
\obeyspaces |
| 57 |
\Msg{************************************************************************} |
| 58 |
\Msg{*} |
| 59 |
\Msg{* To finish the installation you have to move the following} |
| 60 |
\Msg{* file into a directory searched by TeX:} |
| 61 |
\Msg{*} |
| 62 |
\Msg{* pdf14.sty} |
| 63 |
\Msg{*} |
| 64 |
\Msg{* Happy TeXing!} |
| 65 |
\Msg{*} |
| 66 |
\Msg{************************************************************************} |
| 67 |
|
| 68 |
\endbatchfile |
| 69 |
%</install> |
| 70 |
%<*ignore> |
| 71 |
\fi |
| 72 |
%</ignore> |
| 73 |
%<*driver> |
| 74 |
\documentclass{ltxdoc} |
| 75 |
\usepackage[ascii]{inputenc} |
| 76 |
\usepackage[T1]{fontenc} |
| 77 |
\usepackage{lmodern} |
| 78 |
\usepackage[a4paper]{geometry} |
| 79 |
\usepackage{xspace} |
| 80 |
\usepackage[babel=true, expansion=false]{microtype} |
| 81 |
\usepackage[english]{babel} |
| 82 |
\usepackage{hyperref} |
| 83 |
\usepackage{bookmark} |
| 84 |
|
| 85 |
\newcommand\pf{\textsf} |
| 86 |
\newcommand\mailto[1]{\href{mailto:#1}{<#1>}} |
| 87 |
\newcommand\texlive{\TeX\,Live\xspace} |
| 88 |
|
| 89 |
\begin{document} |
| 90 |
\DocInput{pdf14.dtx} |
| 91 |
\end{document} |
| 92 |
%</driver> |
| 93 |
% \fi |
| 94 |
% |
| 95 |
% \CheckSum{0} |
| 96 |
% |
| 97 |
% \CharacterTable |
| 98 |
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 99 |
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 100 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 101 |
% Exclamation \! Double quote \" Hash (number) \# |
| 102 |
% Dollar \$ Percent \% Ampersand \& |
| 103 |
% Acute accent \' Left paren \( Right paren \) |
| 104 |
% Asterisk \* Plus \+ Comma \, |
| 105 |
% Minus \- Point \. Solidus \/ |
| 106 |
% Colon \: Semicolon \; Less than \< |
| 107 |
% Equals \= Greater than \> Question mark \? |
| 108 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 109 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 110 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 111 |
% Right brace \} Tilde \~} |
| 112 |
% |
| 113 |
% \title{The \pf{pdf14} \LaTeX\ package} |
| 114 |
% \date{2010/03/26 v0.1} |
| 115 |
% \author{Manuel P\'egouri\'e-Gonnard \mailto{[email protected]}} |
| 116 |
% |
| 117 |
% \maketitle |
| 118 |
% |
| 119 |
% \begin{abstract} |
| 120 |
% Starting with \texlive 2010, the various formats that directly generate PDF |
| 121 |
% default to PDF 1.5. While this allows for more compact documents thanks to |
| 122 |
% objects compression, it can also lead to compatibility issues with some |
| 123 |
% older PDF viewers.\footnote{For reference, Adobe Reader 6.0, released in |
| 124 |
% 2003, was the first reader to handle PDF 1.5.} This package changes back the |
| 125 |
% version of generated PDF to 1.4 with formats based on pdf\TeX{} or Lua\TeX\ |
| 126 |
% in PDF mode, for documents that need to achieve maximal compatibility with |
| 127 |
% old viewers. |
| 128 |
% |
| 129 |
% If you need to generate maximally compatible documents, you may also be |
| 130 |
% interested in the \pf{pdfx} package. |
| 131 |
% \end{abstract} |
| 132 |
% |
| 133 |
% \section{Documentation} |
| 134 |
% |
| 135 |
% Just load this package, preferably right after the \verb+\documentclass+ |
| 136 |
% command. That's it. The rest of this documentation describes possible |
| 137 |
% problems that may arise under particular circumstances. |
| 138 |
% |
| 139 |
% The \pf{pdf14} package should be loaded as early as possible in order to |
| 140 |
% avoid problems. If you run into an error like: |
| 141 |
% \begin{verbatim} |
| 142 |
% ! pdfTeX error (setup): \pdfminorversion cannot be changed after data is |
| 143 |
% written to the PDF file. |
| 144 |
% \end{verbatim} |
| 145 |
% it probably means that some package loaded before \pf{pdf14} did write data |
| 146 |
% to the PDF file. In case the document class is (indirectly) doing it, you'll |
| 147 |
% need to load \pf{pdf14} even before the \verb+\documentclass+ command, using |
| 148 |
% \verb+\RequirePackage{pdf14}+ as the first line of your source file. |
| 149 |
% |
| 150 |
% Also, another package might try to set the PDF version itself, likely because |
| 151 |
% it is going to use some advanced PDF features. Currently, no check for this |
| 152 |
% is done by \pf{pdf14} to guard against this. So, it is your responsibility |
| 153 |
% to check that the document produced are actually PDF 1.4.\footnote{You may |
| 154 |
% do so using \texttt{pdfinfo} from the Xpdf distribution, or the |
| 155 |
% File$\to$Properties menu of Acrobat Reader.} Future versions of \pf{pdf14} |
| 156 |
% may include such a check, but it could only guarantee that the |
| 157 |
% \emph{declared} PDF version has not been changed, not that the file produced |
| 158 |
% is actually correct PDF 1.4.\footnote{Unfortunately, some packages are known |
| 159 |
% to use features available only in PDF 1.5 and greater without properly |
| 160 |
% setting the declared PDF version.} |
| 161 |
% |
| 162 |
% \section{Implementation} |
| 163 |
% |
| 164 |
% \begin{macrocode} |
| 165 |
%<*package> |
| 166 |
\NeedsTeXFormat{LaTeX2e} |
| 167 |
\ProvidesPackage{pdf14}[2010/03/26 v0.1 Generate PDF 1.4 documents (mpg)] |
| 168 |
% \end{macrocode} |
| 169 |
% |
| 170 |
% Check if we are running pdf\TeX\ or Lua\TeX\ in PDF mode. If not, issue |
| 171 |
% an information message and exit. Since we address only \LaTeX-based |
| 172 |
% formats in \texlive, we can assume that \verb|\pdfoutput| is available. |
| 173 |
% (We don't load \pf{ifpdf} in order to avoid loading too many packages |
| 174 |
% before \verb+\documentclass+.) |
| 175 |
% |
| 176 |
% \begin{macrocode} |
| 177 |
\begingroup |
| 178 |
\def\x{% |
| 179 |
\PackageInfo{pdf14}{% |
| 180 |
You are not running pdfTeX (or LuaTeX) in PDF mode.\MessageBreak |
| 181 |
Package pdf14 is useless in this case. Skipping.}% |
| 182 |
\endinput} |
| 183 |
\expandafter\ifx\csname pdfoutput\endcsname\relax \else |
| 184 |
\ifnum\pdfoutput<1 \else |
| 185 |
\def\x{}% |
| 186 |
\fi |
| 187 |
\fi |
| 188 |
\expandafter\endgroup |
| 189 |
\x |
| 190 |
% \end{macrocode} |
| 191 |
% |
| 192 |
% Actually set the values if the corresponding primitives are available. |
| 193 |
% |
| 194 |
% \begin{macrocode} |
| 195 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 196 |
\expandafter\ifx\csname pdfminorversion\endcsname\relax \else |
| 197 |
\pdfminorversion4\relax |
| 198 |
\fi |
| 199 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 200 |
\expandafter\ifx\csname pdfobjcompresslevel\endcsname\relax \else |
| 201 |
\pdfobjcompresslevel0\relax |
| 202 |
\fi |
| 203 |
% \end{macrocode} |
| 204 |
% |
| 205 |
% \begin{macrocode} |
| 206 |
%</package> |
| 207 |
% \end{macrocode} |
| 208 |
% |
| 209 |
% \section{Test} |
| 210 |
% |
| 211 |
% Minimal \LaTeX\ file actually producing some output, just to check that |
| 212 |
% the package loads correctly, and that the produced file is actually PDF |
| 213 |
% 1.4 (see the Makefile). |
| 214 |
% |
| 215 |
% \begin{macrocode} |
| 216 |
%<*testfile> |
| 217 |
\documentclass{minimal} |
| 218 |
\usepackage{pdf14} |
| 219 |
\begin{document} |
| 220 |
Bla. |
| 221 |
\end{document} |
| 222 |
%</testfile> |
| 223 |
% \end{macrocode} |
| 224 |
% |
| 225 |
% |
| 226 |
% \Finale |
| 227 |
\endinput |