Document -stretch / -redact

This commit is contained in:
John Whitington 2024-09-26 17:52:43 +01:00
parent 466daaffd1
commit 505969d6cb
2 changed files with 30 additions and 5 deletions

Binary file not shown.

View File

@ -1,5 +1,3 @@
%Document -stretch
%Document -redact
\documentclass{book} \documentclass{book}
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf, % Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf,
% dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc. % dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc.
@ -1433,9 +1431,11 @@ The \texttt{-process-struct-trees} option used in conjunction with any splitting
\small\noindent\verb!cpdf -scale-page "<scale x> <scale y>" [-fast] in.pdf [<range>] -o out.pdf! \small\noindent\verb!cpdf -scale-page "<scale x> <scale y>" [-fast] in.pdf [<range>] -o out.pdf!
\vspace{1.5mm} \vspace{1.5mm}
\small\noindent\verb!cpdf -scale-to-fit "<x size> <y size>" [-fast]!\\ \small\noindent\verb!cpdf -scale-to-fit "<x size> <y size>" [-fast] [-prerotate]!\\
\noindent\verb! [-scale-to-fit-scale <scale>] [-prerotate]!\\ \noindent\verb! [-scale-to-fit-scale <scale>] in.pdf [<range>] -o out.pdf!
\noindent\verb! in.pdf [<range>] -o out.pdf!
\vspace{1.5mm}
\small\noindent\verb!cpdf -stretch "<x size> <y size>" [-fast] in.pdf [<range>] -o out.pdf!
\vspace{1.5mm} \vspace{1.5mm}
\small\noindent\verb!cpdf -scale-contents [<scale>] [<position>] [-fast]!\\ \small\noindent\verb!cpdf -scale-contents [<scale>] [<position>] [-fast]!\\
@ -1553,6 +1553,15 @@ Y factors given. This scales both the page contents, and the page size itself. I
\noindent Scale a file's pages to fit A4 portrait, scaling the page 90\% of its possible size. \noindent Scale a file's pages to fit A4 portrait, scaling the page 90\% of its possible size.
\end{framed} \end{framed}
\noindent The \texttt{-stretch} operation scales the contents to the given size without regard to aspect ratio.
\begin{framed}
\small\noindent\verb!cpdf -stretch a4landscape in.pdf -o out.pdf!
\vspace{2.5mm}
\noindent Scale a file's pages and their content to fit A4 landscape
\end{framed}
\noindent The \texttt{-scale-contents} operation scales the contents about the center \noindent The \texttt{-scale-contents} operation scales the contents about the center
of the crop box (or, if absent, the media box), leaving the page dimensions of the crop box (or, if absent, the media box), leaving the page dimensions
(boxes) unchanged. (boxes) unchanged.
@ -2760,6 +2769,9 @@ These two operations add content directly to the beginning or end of the page da
\vspace{1.5mm} \vspace{1.5mm}
\small\noindent\verb!cpdf -pad-multiple-before [<integer>] in.pdf -o out.pdf! \small\noindent\verb!cpdf -pad-multiple-before [<integer>] in.pdf -o out.pdf!
\vspace{1.5mm}
\small\noindent\verb!cpdf -redact [-process-struct-trees] in.pdf [<range>] -o out.pdf!
\vspace{1.5mm} \vspace{1.5mm}
\small\noindent\verb!cpdf [-impose <pagesize> | impose-xy "<x> <y>"]!\\ \small\noindent\verb!cpdf [-impose <pagesize> | impose-xy "<x> <y>"]!\\
\small\noindent\verb! [-impose-columns] [-impose-rtl] [-impose-btt]!\\ \small\noindent\verb! [-impose-columns] [-impose-rtl] [-impose-btt]!\\
@ -2825,6 +2837,19 @@ instance, to add a clean page between chapters of a document.)
\noindent The \texttt{-pad-multiple-before n} operation adds the padding pages at the beginning of the file instead. \noindent The \texttt{-pad-multiple-before n} operation adds the padding pages at the beginning of the file instead.
\section{Redaction}
Cpdf has very primitive redaction facilities to remove whole pages. We simply give the page range, and such pages will be emptied of content, and any annotations and page resources removed. The page size remains the same.
\begin{framed}
\noindent\small\verb!cpdf -redact in.pdf 1,2,19-end -o out.pdf!
\vspace{2.5mm}
\noindent Redact pages 1,2 and 19-end of \texttt{in.pdf}, writing to \texttt{out.pdf}
\end{framed}
\noindent If \texttt{-process-struct-trees} is added to the command, the document's structure tree will be shorn of any parts which are marked as relating to the now-redacted pages.
\section{Imposition} \section{Imposition}
\index{two-up}\index{imposition} \index{two-up}\index{imposition}