Document font extraction

This commit is contained in:
John Whitington 2024-02-14 21:13:01 +00:00
parent 26735dd02b
commit 501f83a71a
2 changed files with 13 additions and 3 deletions

Binary file not shown.

View File

@ -3955,8 +3955,12 @@ Method & Effect\\\hline
\vspace{1.5mm} \vspace{1.5mm}
\noindent\verb!cpdf -embed-missing-fonts -gs <path to gs> in.pdf -o out.pdf! \noindent\verb!cpdf -embed-missing-fonts -gs <path to gs> in.pdf -o out.pdf!
\end{framed}}
\vspace{1.5mm}
\noindent\verb!cpdf -extract-font <page number>,<pdf font name> in.pdf -o out.font!
\end{framed}}
\section{Listing Fonts} \section{Listing Fonts}
\index{font!listing} \index{font!listing}
@ -4092,7 +4096,7 @@ recommended when file size is the sole consideration.
\vspace{2.5mm} \vspace{2.5mm}
\end{framed} \end{framed}
\section{Missing Fonts} \section{Missing Fonts}\label{listmisingfonts}
The \verb!-missing-fonts! operation lists any unembedded fonts in the document, one per line. The \verb!-missing-fonts! operation lists any unembedded fonts in the document, one per line.
\begin{framed} \begin{framed}
\small\noindent\verb!cpdf -missing-fonts in.pdf! \small\noindent\verb!cpdf -missing-fonts in.pdf!
@ -4111,7 +4115,13 @@ recommended when file size is the sole consideration.
\noindent\textit{Note: putting a PDF file through \texttt{gs} in this manner may not be lossless: some metadata may not be preserved.} \noindent\textit{Note: putting a PDF file through \texttt{gs} in this manner may not be lossless: some metadata may not be preserved.}
\label{listmisingfonts}\clearpage\pagestyle{empty} \section{Extracting Fonts}
We may extract a font file by giving the page number and the PDF font resource name, as printed by \texttt{-list-fonts} or \texttt{-list-fonts-json}. For example, for the TrueType font \texttt{/F50} on page 5:
\begin{framed}
\small\noindent\verb!cpdf -extract-font 5,/F50 in.pdf -o out.ttf!
\end{framed}
\begin{cpdflib} \begin{cpdflib}
\clearpage \clearpage