Document -remove-struct-tree

This commit is contained in:
John Whitington 2025-03-10 15:51:33 +00:00
parent f541afedde
commit b0e641fa5a
2 changed files with 9 additions and 3 deletions

Binary file not shown.

View File

@ -1,4 +1,3 @@
%Document %objnum in -extract-images
%\DocumentMetadata{lang=en, pdfversion=2.0, pdfstandard=ua-2, pdfstandard=a-4f, testphase={phase-III, title, table, math, firstaid}} %\DocumentMetadata{lang=en, pdfversion=2.0, pdfstandard=ua-2, pdfstandard=a-4f, testphase={phase-III, title, table, math, firstaid}}
\documentclass{book} \documentclass{book}
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf, % Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf,
@ -5758,6 +5757,9 @@ A role map, which maps non-standard structure types to standard ones, may be set
\vspace{1.5mm} \vspace{1.5mm}
\noindent\verb!cpdf -replace-struct-tree in.json in.pdf -o out.pdf! \noindent\verb!cpdf -replace-struct-tree in.json in.pdf -o out.pdf!
\vspace{1.5mm}
\noindent\verb!cpdf -remove-struct-tree in.pdf -o out.pdf!
\vspace{1.5mm} \vspace{1.5mm}
\noindent\verb!cpdf -verify "PDF/UA-1(matterhorn)" [-json] in.pdf! \noindent\verb!cpdf -verify "PDF/UA-1(matterhorn)" [-json] in.pdf!
@ -5790,6 +5792,8 @@ We can print an abbreviated form of the structure tree to standard output:
\noindent This might yield: \noindent This might yield:
\smallgap
\begin{minipage}{\linewidth} \begin{minipage}{\linewidth}
\begin{framed} \begin{framed}
\begin{verbatim} \begin{verbatim}
@ -5869,12 +5873,14 @@ This JSON file can be edited, for example to change text strings, and reapplied
\noindent If extra objects are required, they should be introduced with negative object numbers: Cpdf will renumber them on import so as not to clash with any existing numbers. \noindent If extra objects are required, they should be introduced with negative object numbers: Cpdf will renumber them on import so as not to clash with any existing numbers.
To remove a structure tree from a PDF, we can use \texttt{-remove-dict-entry} from Chapter \ref{chap:misc}, in other words: To remove a structure tree from a PDF, we can use \texttt{-remove-struct-tree}:
\begin{framed} \begin{framed}
\noindent\small\verb!cpdf -remove-dict-entry /StructTreeRoot in.pdf -o out.pdf! \noindent\small\verb!cpdf -remove-struct-tree in.pdf -o out.pdf!
\end{framed} \end{framed}
\noindent This removes the structure tree and all references to it.
\section{Verifying conformance to PDF/UA} \section{Verifying conformance to PDF/UA}
Cpdf contains a new, experimental verifier for PDF/UA via most of the machine-checkable subset of the Matterhorn Protocol, a list of checks based on the PDF/UA-1 specification. For example, we can run: Cpdf contains a new, experimental verifier for PDF/UA via most of the machine-checkable subset of the Matterhorn Protocol, a list of checks based on the PDF/UA-1 specification. For example, we can run: