Document -replace-obj

This commit is contained in:
John Whitington 2024-09-04 15:43:36 +01:00
parent 72e10b19cf
commit f8233c6a62
2 changed files with 14 additions and 0 deletions

Binary file not shown.

View File

@ -5467,6 +5467,9 @@ Once we are sure a file complies to PDF/UA, in terms of both machine and human c
\vspace{1.5mm} \vspace{1.5mm}
\noindent\verb!cpdf -obj <object specification> in.pdf! \noindent\verb!cpdf -obj <object specification> in.pdf!
\vspace{1.5mm}
\noindent\verb!cpdf -replace-obj <object specification>=<object> in.pdf!
\vspace{1.5mm} \vspace{1.5mm}
\noindent\verb!cpdf -extract-stream[-decompress] <obj num> in.pdf [-o out.dat | -stdout]! \noindent\verb!cpdf -extract-stream[-decompress] <obj num> in.pdf [-o out.dat | -stdout]!
\end{framed}} \end{framed}}
@ -5718,6 +5721,17 @@ $ cpdf -extract-stream-decompress 2 hello.pdf -stdout
\noindent By these mechanisms, ad-hoc exploration of PDF files is possible. \noindent By these mechanisms, ad-hoc exploration of PDF files is possible.
We may also edit dictionary entries with \texttt{-replace-obj} by giving an object specification, and the new value in JSON format:
\begin{framed}
\small\noindent\verb!cpdf -replace-obj /Root/MarkInfo/Marked=true in.pdf -o out.pdf!
\vspace{2.5mm}
\noindent Replace or add dictionary entry in \texttt{in.pdf}, writing to \texttt{out.pdf}.
\end{framed}
\noindent Any part of the object specification not already present will be fabricated using direct nested dictionaries. For example, if \texttt{/MarkInfo} does not exist in the root dictionary, this command adds \texttt{/MarkInfo <</Marked true>>} to the root dictionary.
\begin{cpdflib} \begin{cpdflib}
\clearpage \clearpage
\section*{C Interface} \section*{C Interface}