From d1ce83db1b84b8f8fce62e74acd9586a9f8a5c20 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Fri, 10 May 2024 14:20:36 +0800 Subject: [PATCH] Ready for updated cpdfdocs.js --- cpdfmanual.tex | 44 +++++++------- docsplits/javascriptsplits/c19.tex | 93 +----------------------------- docsplits/javascriptsplits/c20.tex | 93 ++++++++++++++++++++++++++++++ docsplits/splitjs | 3 +- 4 files changed, 118 insertions(+), 115 deletions(-) create mode 100644 docsplits/javascriptsplits/c20.tex diff --git a/cpdfmanual.tex b/cpdfmanual.tex index 170a1fd..417ef2b 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -1191,10 +1191,10 @@ In modern usage, \texttt{-utf8} is almost always the sensible option. But for hi \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/cm1} -\lstinputlisting{javascriptsplits/c00} -\lstinputlisting{javascriptsplits/c01} -\lstinputlisting{javascriptsplits/c02} +\lstinputlisting{docsplits/javascriptsplits/cm1} +\lstinputlisting{docsplits/javascriptsplits/c00} +\lstinputlisting{docsplits/javascriptsplits/c01} +\lstinputlisting{docsplits/javascriptsplits/c02} \end{small} \end{jscpdflib} @@ -1408,7 +1408,7 @@ Presently, cpdf will include the input structure tree in each output PDF. To rem \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c03} +\lstinputlisting{docsplits/javascriptsplits/c03} \end{small} \end{jscpdflib} @@ -1768,7 +1768,7 @@ Bleed box & Pink \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c04} +\lstinputlisting{docsplits/javascriptsplits/c04} \end{small} \end{jscpdflib} @@ -1905,7 +1905,7 @@ When appropriate passwords are not available, the option \texttt{-decrypt-force} \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c05} +\lstinputlisting{docsplits/javascriptsplits/c05} \end{small} \end{jscpdflib} @@ -1992,7 +1992,7 @@ The option \texttt{-squeeze-no-pagedata} avoids the reprocessing of page data, w \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c06} +\lstinputlisting{docsplits/javascriptsplits/c06} \end{small} \end{jscpdflib} @@ -2207,7 +2207,7 @@ Cpdf can automatically generate a table of contents from existing bookmarks, add \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c07} +\lstinputlisting{docsplits/javascriptsplits/c07} \end{small} \end{jscpdflib} @@ -2320,7 +2320,7 @@ the file using a different page range each time. \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c08} +\lstinputlisting{docsplits/javascriptsplits/c08} \end{small} \end{jscpdflib} @@ -2725,7 +2725,7 @@ These two operations add content directly to the beginning or end of the page da \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c09} +\lstinputlisting{docsplits/javascriptsplits/c09} \end{small} \end{jscpdflib} @@ -2931,7 +2931,7 @@ As an alternative, pages can be chopped into two at a given position, horizontal \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c10} +\lstinputlisting{docsplits/javascriptsplits/c10} \end{small} \end{jscpdflib} @@ -3076,7 +3076,7 @@ given page range. \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c11} +\lstinputlisting{docsplits/javascriptsplits/c11} \end{small} \end{jscpdflib} @@ -3580,7 +3580,7 @@ Unclassified: 11229 bytes (3.62%) \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c12} +\lstinputlisting{docsplits/javascriptsplits/c12} \end{small} \end{jscpdflib} @@ -3683,7 +3683,7 @@ The \texttt{-dump-attachments} operation, when given a PDF file and a directory \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c13} +\lstinputlisting{docsplits/javascriptsplits/c13} \end{small} \end{jscpdflib} @@ -3950,7 +3950,7 @@ NB: CYMK images will be converted to RGB or untouched by some of these processes \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c14} +\lstinputlisting{docsplits/javascriptsplits/c14} \end{small} \end{jscpdflib} @@ -4178,7 +4178,7 @@ We may extract a font file by giving the page number and the PDF font resource n \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c15} +\lstinputlisting{docsplits/javascriptsplits/c15} \end{small} \end{jscpdflib} @@ -4350,7 +4350,7 @@ We can load a JSON PDF file with the \texttt{-j} option in place of a PDF file a \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c16} +\lstinputlisting{docsplits/javascriptsplits/c16} \end{small} \end{jscpdflib} @@ -4437,7 +4437,7 @@ In a PDF file, optional content groups are used to group graphical elements toge \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c17} +\lstinputlisting{docsplits/javascriptsplits/c17} \end{small} \end{jscpdflib} @@ -4560,7 +4560,7 @@ Cpdf can build multi-pages files from one or more PDF-appropriate JBIG2 fragment \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c18} +\lstinputlisting{docsplits/javascriptsplits/c18} \end{small} \end{jscpdflib} @@ -5129,7 +5129,7 @@ If the drawing range is a single page, and the next page already exists, the dra \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c19} +\lstinputlisting{docsplits/javascriptsplits/c19} \end{small} \end{jscpdflib} @@ -5462,7 +5462,7 @@ $ cpdf -extract-stream-decompress 2 hello.pdf -stdout \clearpage \section*{JavaScript Interface} \begin{small}\tt -\lstinputlisting{javascriptsplits/c19} +\lstinputlisting{docsplits/javascriptsplits/c20} \end{small} \end{jscpdflib} diff --git a/docsplits/javascriptsplits/c19.tex b/docsplits/javascriptsplits/c19.tex index ab87891..abe1bb2 100644 --- a/docsplits/javascriptsplits/c19.tex +++ b/docsplits/javascriptsplits/c19.tex @@ -1,93 +1,2 @@ -//CHAPTER 18. Miscellaneous +//CHAPTER 18. Drawing on PDFs -/** Removes images on the given pages, replacing them with crossed boxes if -'boxes' is true. -@arg {pdf} pdf PDF document -@arg {range} range page range -@arg {boolean} boxes replace with crossed boxes */ -function draft(pdf, range, boxes) {} - -/** Removes all text from the given pages in a given document. -@arg {pdf} pdf PDF document -@arg {range} range page range */ -function removeAllText(pdf, range) {} - -/* Blackens all text on the given pages. -@arg {pdf} pdf PDF document -@arg {range} range page range */ -function blackText(pdf, range) {} - -/** Blackens all lines on the given pages. -@arg {pdf} pdf PDF document -@arg {range} range page range */ -function blackLines(pdf, range) {} - -/** Blackens all fills on the given pages. -@arg {pdf} pdf PDF document -@arg {range} range page range */ -function blackFills(pdf, range) {} - -/** Thickens every line less than min_thickness to min_thickness. Thickness -given in points. -@arg {pdf} pdf PDF document -@arg {range} range page range -@arg {number} min_thickness minimum required thickness */ -function thinLines(pdf, range, min_thickness) {} - -/** Copies the /ID from one document to another. -@arg {pdf} pdf_from source document -@arg {pdf} pdf_to destination document */ -function copyId(pdf_from, pdf_to) {} - -/** Removes a document's /ID. -@arg {pdf} pdf PDF document */ -function removeId(pdf) {} - -/** Sets the minor version number of a document. -@arg {pdf} pdf PDF document -@arg {number} version */ -function setVersion(pdf, version) {} - -/** Sets the full version number of a document. -@arg {pdf} pdf PDF document -@arg {number} major version -@arg {number} minor version */ -function setFullVersion(pdf, major, minor) {} - -/** Removes any dictionary entry with the given key anywhere in the document. -@arg {pdf} pdf PDF document -@arg {string} key key to remove */ -function removeDictEntry(pdf, key) {} - -/** Removes any dictionary entry with the given key whose value matches the -given search term. -@arg {pdf} pdf PDF document -@arg {string} key key to remove -@arg {string} searchterm search term */ -function removeDictEntrySearch(pdf, key, searchterm) {} - -/** Replaces the value associated with the given key. -@arg {pdf} pdf PDF document -@arg {string} key key to remove -@arg {string} newval new value */ -function replaceDictEntry(pdf, key, newval) {} - -/** Replaces the value associated with the given key if the existing value -matches the search term. -@arg {pdf} pdf PDF document -@arg {string} key key to remove -@arg {string} newval new value -@arg {string} searchterm search term */ -function replaceDictEntrySearch(pdf, key, newval, searchterm) {} - -/** Removes all clipping from pages in the given range. -@arg {pdf} pdf PDF document -@arg {range} range page range */ -function removeClipping(pdf, range) {} - -/* Returns a JSON array containing any and all values associated with the -given key. -@arg {pdf} pdf PDF docment -@arg {string} key key -@return {Uint8Array} results as an array of bytes */ -function getDictEntries(pdf, key) {} diff --git a/docsplits/javascriptsplits/c20.tex b/docsplits/javascriptsplits/c20.tex new file mode 100644 index 0000000..8550129 --- /dev/null +++ b/docsplits/javascriptsplits/c20.tex @@ -0,0 +1,93 @@ +//CHAPTER 19. Miscellaneous + +/** Removes images on the given pages, replacing them with crossed boxes if +'boxes' is true. +@arg {pdf} pdf PDF document +@arg {range} range page range +@arg {boolean} boxes replace with crossed boxes */ +function draft(pdf, range, boxes) {} + +/** Removes all text from the given pages in a given document. +@arg {pdf} pdf PDF document +@arg {range} range page range */ +function removeAllText(pdf, range) {} + +/* Blackens all text on the given pages. +@arg {pdf} pdf PDF document +@arg {range} range page range */ +function blackText(pdf, range) {} + +/** Blackens all lines on the given pages. +@arg {pdf} pdf PDF document +@arg {range} range page range */ +function blackLines(pdf, range) {} + +/** Blackens all fills on the given pages. +@arg {pdf} pdf PDF document +@arg {range} range page range */ +function blackFills(pdf, range) {} + +/** Thickens every line less than min_thickness to min_thickness. Thickness +given in points. +@arg {pdf} pdf PDF document +@arg {range} range page range +@arg {number} min_thickness minimum required thickness */ +function thinLines(pdf, range, min_thickness) {} + +/** Copies the /ID from one document to another. +@arg {pdf} pdf_from source document +@arg {pdf} pdf_to destination document */ +function copyId(pdf_from, pdf_to) {} + +/** Removes a document's /ID. +@arg {pdf} pdf PDF document */ +function removeId(pdf) {} + +/** Sets the minor version number of a document. +@arg {pdf} pdf PDF document +@arg {number} version */ +function setVersion(pdf, version) {} + +/** Sets the full version number of a document. +@arg {pdf} pdf PDF document +@arg {number} major version +@arg {number} minor version */ +function setFullVersion(pdf, major, minor) {} + +/** Removes any dictionary entry with the given key anywhere in the document. +@arg {pdf} pdf PDF document +@arg {string} key key to remove */ +function removeDictEntry(pdf, key) {} + +/** Removes any dictionary entry with the given key whose value matches the +given search term. +@arg {pdf} pdf PDF document +@arg {string} key key to remove +@arg {string} searchterm search term */ +function removeDictEntrySearch(pdf, key, searchterm) {} + +/** Replaces the value associated with the given key. +@arg {pdf} pdf PDF document +@arg {string} key key to remove +@arg {string} newval new value */ +function replaceDictEntry(pdf, key, newval) {} + +/** Replaces the value associated with the given key if the existing value +matches the search term. +@arg {pdf} pdf PDF document +@arg {string} key key to remove +@arg {string} newval new value +@arg {string} searchterm search term */ +function replaceDictEntrySearch(pdf, key, newval, searchterm) {} + +/** Removes all clipping from pages in the given range. +@arg {pdf} pdf PDF document +@arg {range} range page range */ +function removeClipping(pdf, range) {} + +/* Returns a JSON array containing any and all values associated with the +given key. +@arg {pdf} pdf PDF docment +@arg {string} key key +@return {Uint8Array} results as an array of bytes */ +function getDictEntries(pdf, key) {} diff --git a/docsplits/splitjs b/docsplits/splitjs index adfc66c..f78c600 100755 --- a/docsplits/splitjs +++ b/docsplits/splitjs @@ -1,5 +1,5 @@ #!/bin/bash -csplit -k -f javascriptsplits/c ../../coherentpdf.js/cpdfdocs.js '/CHAPTER/' {18} +csplit -k -f javascriptsplits/c ../../coherentpdf.js/cpdfdocs.js '/CHAPTER/' {19} mv javascriptsplits/c00 javascriptsplits/c00.tex mv javascriptsplits/c01 javascriptsplits/c01.tex mv javascriptsplits/c02 javascriptsplits/c02.tex @@ -20,3 +20,4 @@ mv javascriptsplits/c16 javascriptsplits/c16.tex mv javascriptsplits/c17 javascriptsplits/c17.tex mv javascriptsplits/c18 javascriptsplits/c18.tex mv javascriptsplits/c19 javascriptsplits/c19.tex +mv javascriptsplits/c20 javascriptsplits/c20.tex