Commit 18340b883564386c6e8e5d3126698a023033a548

Authored by Jay Berkenbilt
1 parent bf8fd41f

Spell check

ChangeLog
1 2021-01-04 Jay Berkenbilt <ejb@ql.org> 1 2021-01-04 Jay Berkenbilt <ejb@ql.org>
2 2
3 * When qpdf CLI extracts pages, it now only attempts to remove 3 * When qpdf CLI extracts pages, it now only attempts to remove
4 - unreferenced resourecs from the pages that it is keeping. This 4 + unreferenced resources from the pages that it is keeping. This
5 change dramatically reduces the time it takes to extract a small 5 change dramatically reduces the time it takes to extract a small
6 number of pages from a large, complex file. 6 number of pages from a large, complex file.
7 7
examples/pdf-custom-filter.cc
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 // is no such filter in PDF, so the streams created by the example 23 // is no such filter in PDF, so the streams created by the example
24 // would not be usable by any PDF reader. However, the techniques here 24 // would not be usable by any PDF reader. However, the techniques here
25 // would work if you were going to implement support for a filter that 25 // would work if you were going to implement support for a filter that
26 -// qpdf does not support natively. For example, using the techinques 26 +// qpdf does not support natively. For example, using the techniques
27 // shown here, it would be possible to create an application that 27 // shown here, it would be possible to create an application that
28 // downsampled or re-encoded images or that re-compressed streams 28 // downsampled or re-encoded images or that re-compressed streams
29 // using a more efficient "deflate" implementation than zlib. 29 // using a more efficient "deflate" implementation than zlib.
@@ -85,7 +85,7 @@ class SF_XORDecode: public QPDFStreamFilter @@ -85,7 +85,7 @@ class SF_XORDecode: public QPDFStreamFilter
85 // validate and interpret decode parameters (/DecodeParms) for the 85 // validate and interpret decode parameters (/DecodeParms) for the
86 // made-up /XORDecode stream filter. Since this is not a real 86 // made-up /XORDecode stream filter. Since this is not a real
87 // stream filter, no actual PDF reader would know how to interpret 87 // stream filter, no actual PDF reader would know how to interpret
88 - // it. This is just to illlustrate how to create a stream filter. 88 + // it. This is just to illustrate how to create a stream filter.
89 // In main(), we call QPDF::registerStreamFilter to tell the 89 // In main(), we call QPDF::registerStreamFilter to tell the
90 // library about the filter. See comments in QPDFStreamFilter.hh 90 // library about the filter. See comments in QPDFStreamFilter.hh
91 // for details on how to implement the methods. For purposes of 91 // for details on how to implement the methods. For purposes of
@@ -260,7 +260,7 @@ StreamReplacer::maybeReplace(QPDFObjGen const&amp; og, @@ -260,7 +260,7 @@ StreamReplacer::maybeReplace(QPDFObjGen const&amp; og,
260 // necessary setup. When we are actually ready to supply the data, 260 // necessary setup. When we are actually ready to supply the data,
261 // this method is called again with pipeline populated and 261 // this method is called again with pipeline populated and
262 // dict_updates as a nullptr. In this mode, we are not allowed to 262 // dict_updates as a nullptr. In this mode, we are not allowed to
263 - // change anything, sincing writing is already in progress. We 263 + // change anything, since writing is already in progress. We
264 // must simply provide the stream data. 264 // must simply provide the stream data.
265 265
266 // The return value indicates whether or not we should replace the 266 // The return value indicates whether or not we should replace the
include/qpdf/QPDFStreamFilter.hh
@@ -39,7 +39,7 @@ class QPDF_DLL_CLASS QPDFStreamFilter @@ -39,7 +39,7 @@ class QPDF_DLL_CLASS QPDFStreamFilter
39 // setDecodeParms() and getDecodePipeline(). QPDF will always call 39 // setDecodeParms() and getDecodePipeline(). QPDF will always call
40 // setDecodeParms() before calling getDecodePipeline(). It is 40 // setDecodeParms() before calling getDecodePipeline(). It is
41 // expected that you will store any needed information from 41 // expected that you will store any needed information from
42 - // decode_parms (or the decode_parms object iself) in your 42 + // decode_parms (or the decode_parms object itself) in your
43 // instance so that it can be used to construct the decode 43 // instance so that it can be used to construct the decode
44 // pipeline. 44 // pipeline.
45 45
ispell-words
@@ -119,6 +119,7 @@ argExternalizeInlineImages @@ -119,6 +119,7 @@ argExternalizeInlineImages
119 argfile 119 argfile
120 argFilteredStreamData 120 argFilteredStreamData
121 argFlattenAnnotations 121 argFlattenAnnotations
  122 +argFlattenRotation
122 argForceVersion 123 argForceVersion
123 argGenerateAppearances 124 argGenerateAppearances
124 argHelp 125 argHelp
@@ -277,6 +278,7 @@ bookinfo @@ -277,6 +278,7 @@ bookinfo
277 bool 278 bool
278 BoringSSL 279 BoringSSL
279 BORLANDC 280 BORLANDC
  281 +boxkey
280 bp 282 bp
281 BPC 283 BPC
282 bpp 284 bpp
@@ -397,6 +399,7 @@ commandline @@ -397,6 +399,7 @@ commandline
397 COMP 399 COMP
398 compareVersions 400 compareVersions
399 compatbility 401 compatbility
  402 +completionCommon
400 CompressConfig 403 CompressConfig
401 computeDeterministicIDData 404 computeDeterministicIDData
402 concat 405 concat
@@ -428,6 +431,7 @@ CreateFile @@ -428,6 +431,7 @@ CreateFile
428 createPageContents 431 createPageContents
429 createWhat 432 createWhat
430 CreationDate 433 CreationDate
  434 +cred
431 cregex 435 cregex
432 CRNL 436 CRNL
433 CropBox 437 CropBox
@@ -558,8 +562,11 @@ doFinalChecks @@ -558,8 +562,11 @@ doFinalChecks
558 Dohnal 562 Dohnal
559 DOTLESS 563 DOTLESS
560 doubleBoxSize 564 doubleBoxSize
  565 +downsampled
  566 +downsampler
561 doWrite 567 doWrite
562 doWriteSetup 568 doWriteSetup
  569 +DoXOR
563 Doxygen 570 Doxygen
564 dp 571 dp
565 DQPDF 572 DQPDF
@@ -707,6 +714,7 @@ filetrailer @@ -707,6 +714,7 @@ filetrailer
707 filterability 714 filterability
708 filterAsContents 715 filterAsContents
709 filterCompressedObjects 716 filterCompressedObjects
  717 +filterContents
710 filterp 718 filterp
711 filterPageContents 719 filterPageContents
712 findAndSkipNextEOL 720 findAndSkipNextEOL
@@ -732,6 +740,7 @@ flarp @@ -732,6 +740,7 @@ flarp
732 flate 740 flate
733 Flate's 741 Flate's
734 FlateDecode 742 FlateDecode
  743 +FlateLzwDecode
735 flattenAnnotations 744 flattenAnnotations
736 flattenAnnotationsForPage 745 flattenAnnotationsForPage
737 flattenPagesTree 746 flattenPagesTree
@@ -750,6 +759,10 @@ forcePDFVersion @@ -750,6 +759,10 @@ forcePDFVersion
750 ForceR 759 ForceR
751 ForceV 760 ForceV
752 foreach 761 foreach
  762 +forEachFormXObject
  763 +forEachImage
  764 +ForEachImage
  765 +forEachXObject
753 ForeignStreamData 766 ForeignStreamData
754 FormatMessageA 767 FormatMessageA
755 fp 768 fp
@@ -826,6 +839,7 @@ getCount @@ -826,6 +839,7 @@ getCount
826 getCropBox 839 getCropBox
827 getDA 840 getDA
828 getDataChecksum 841 getDataChecksum
  842 +getDecodePipeline
829 getDefaultAppearance 843 getDefaultAppearance
830 getDefaultProvider 844 getDefaultProvider
831 getDefaultValue 845 getDefaultValue
@@ -850,6 +864,7 @@ getFileChecksum @@ -850,6 +864,7 @@ getFileChecksum
850 GetFileInformationByHandle 864 GetFileInformationByHandle
851 getFilename 865 getFilename
852 getFilePosition 866 getFilePosition
  867 +getFilterOnWrite
853 getFinalVersion 868 getFinalVersion
854 getFirstChar 869 getFirstChar
855 getFlags 870 getFlags
@@ -857,6 +872,7 @@ getFontFromResource @@ -857,6 +872,7 @@ getFontFromResource
857 getFontName 872 getFontName
858 getFormFields 873 getFormFields
859 getFormXObjectForPage 874 getFormXObjectForPage
  875 +getFormXObjects
860 getFullyQualifiedName 876 getFullyQualifiedName
861 getGen 877 getGen
862 getGeneration 878 getGeneration
@@ -864,6 +880,7 @@ getHeight @@ -864,6 +880,7 @@ getHeight
864 getHexDigest 880 getHexDigest
865 getId 881 getId
866 getIdentifier 882 getIdentifier
  883 +getImages
867 getImpl 884 getImpl
868 getInheritableFieldValue 885 getInheritableFieldValue
869 getInheritableFieldValueAsName 886 getInheritableFieldValueAsName
@@ -1091,6 +1108,7 @@ ImageC @@ -1091,6 +1108,7 @@ ImageC
1091 ImageChecker 1108 ImageChecker
1092 ImageInverter 1109 ImageInverter
1093 ImageMask 1110 ImageMask
  1111 +imagemask
1094 ImageOptimizer 1112 ImageOptimizer
1095 ImageProvider 1113 ImageProvider
1096 img 1114 img
@@ -1163,12 +1181,15 @@ isDictionary @@ -1163,12 +1181,15 @@ isDictionary
1163 isdigit 1181 isdigit
1164 isDirectNull 1182 isDirectNull
1165 isEncrypted 1183 isEncrypted
  1184 +isFormXObject
1166 isIgnorable 1185 isIgnorable
  1186 +isImage
1167 isIndirect 1187 isIndirect
1168 isInitialized 1188 isInitialized
1169 isInlineImage 1189 isInlineImage
1170 isInteger 1190 isInteger
1171 isLinearized 1191 isLinearized
  1192 +isLossyCompression
1172 isMatrix 1193 isMatrix
1173 isName 1194 isName
1174 isNull 1195 isNull
@@ -1189,6 +1210,7 @@ isReserved @@ -1189,6 +1210,7 @@ isReserved
1189 isScalar 1210 isScalar
1190 isspace 1211 isspace
1191 isSpace 1212 isSpace
  1213 +isSpecializedCompression
1192 isStream 1214 isStream
1193 isString 1215 isString
1194 isText 1216 isText
@@ -1202,6 +1224,7 @@ iter @@ -1202,6 +1224,7 @@ iter
1202 ith 1224 ith
1203 iz 1225 iz
1204 jarr 1226 jarr
  1227 +JBIG
1205 JCS 1228 JCS
1206 JDIMENSION 1229 JDIMENSION
1207 jdouble 1230 jdouble
@@ -1233,6 +1256,7 @@ keybits @@ -1233,6 +1256,7 @@ keybits
1233 keylen 1256 keylen
1234 KEYLENGTH 1257 KEYLENGTH
1235 keyset 1258 keyset
  1259 +KeyStream
1236 kgdl 1260 kgdl
1237 LARGEFILE 1261 LARGEFILE
1238 LastChar 1262 LastChar
@@ -1334,6 +1358,7 @@ makeNumber @@ -1334,6 +1358,7 @@ makeNumber
1334 makePipeline 1358 makePipeline
1335 makeReal 1359 makeReal
1336 makeString 1360 makeString
  1361 +Mal
1337 malloc 1362 malloc
1338 manualFinish 1363 manualFinish
1339 mappingname 1364 mappingname
@@ -1342,6 +1367,7 @@ Mateusz @@ -1342,6 +1367,7 @@ Mateusz
1342 maxEnd 1367 maxEnd
1343 maxlen 1368 maxlen
1344 maxval 1369 maxval
  1370 +maybeReplace
1345 md 1371 md
1346 mdash 1372 mdash
1347 MDd 1373 MDd
@@ -1439,6 +1465,7 @@ nitems @@ -1439,6 +1465,7 @@ nitems
1439 nkids 1465 nkids
1440 nl 1466 nl
1441 nlines 1467 nlines
  1468 +nlohmann
1442 nmatches 1469 nmatches
1443 nMatches 1470 nMatches
1444 NoBackref 1471 NoBackref
@@ -1535,6 +1562,7 @@ OptionEntry @@ -1535,6 +1562,7 @@ OptionEntry
1535 ord 1562 ord
1536 org 1563 org
1537 orig 1564 orig
  1565 +OrigLength
1538 orred 1566 orred
1539 os 1567 os
1540 oss 1568 oss
@@ -1582,7 +1610,9 @@ param @@ -1582,7 +1610,9 @@ param
1582 params 1610 params
1583 parms 1611 parms
1584 parseable 1612 parseable
  1613 +parseAsContents
1585 parsecontent 1614 parsecontent
  1615 +parseContents
1586 parseContentStream 1616 parseContentStream
1587 parsedoffset 1617 parsedoffset
1588 ParseGuard 1618 ParseGuard
@@ -1614,6 +1644,7 @@ pdfdoc @@ -1614,6 +1644,7 @@ pdfdoc
1614 PDFDoc 1644 PDFDoc
1615 PDFDocEncoding 1645 PDFDocEncoding
1616 pdfDumpInfoDict 1646 pdfDumpInfoDict
  1647 +PDFEx
1617 PDFs 1648 PDFs
1618 pdfs 1649 pdfs
1619 pdh 1650 pdh
@@ -1630,6 +1661,7 @@ phe @@ -1630,6 +1661,7 @@ phe
1630 php 1661 php
1631 pikepdf 1662 pikepdf
1632 pikepdf's 1663 pikepdf's
  1664 +pipeContents
1633 pipeContentStreams 1665 pipeContentStreams
1634 pipeForeignStreamData 1666 pipeForeignStreamData
1635 PipelineAccessor 1667 PipelineAccessor
@@ -1694,6 +1726,7 @@ programlisting @@ -1694,6 +1726,7 @@ programlisting
1694 programmatically 1726 programmatically
1695 ProgressReporter 1727 ProgressReporter
1696 Projet 1728 Projet
  1729 +ProtectXOR
1697 prov 1730 prov
1698 provideRandomData 1731 provideRandomData
1699 provideStreamData 1732 provideStreamData
@@ -1722,6 +1755,7 @@ pytest @@ -1722,6 +1755,7 @@ pytest
1722 qarray 1755 qarray
1723 QArray 1756 QArray
1724 qbilt 1757 qbilt
  1758 +qdata
1725 qdf 1759 qdf
1726 qdf's 1760 qdf's
1727 QdfFixer 1761 QdfFixer
@@ -1735,6 +1769,7 @@ QIntC @@ -1735,6 +1769,7 @@ QIntC
1735 ql 1769 ql
1736 qnumbers 1770 qnumbers
1737 QNumbers 1771 QNumbers
  1772 +qoh
1738 qp 1773 qp
1739 qpdf 1774 qpdf
1740 qpdf's 1775 qpdf's
@@ -1773,6 +1808,7 @@ qpdfs @@ -1773,6 +1808,7 @@ qpdfs
1773 QPDFSomethingDocumentHelper 1808 QPDFSomethingDocumentHelper
1774 QPDFSomethingObjectHelper 1809 QPDFSomethingObjectHelper
1775 QPDFStream 1810 QPDFStream
  1811 +QPDFStreamFilter
1776 QPDFSystemError 1812 QPDFSystemError
1777 QPDFTokenizer 1813 QPDFTokenizer
1778 QPDFTYPES 1814 QPDFTYPES
@@ -1848,6 +1884,8 @@ registerForeignStream @@ -1848,6 +1884,8 @@ registerForeignStream
1848 registerImage 1884 registerImage
1849 registerImpl 1885 registerImpl
1850 registerProgressReporter 1886 registerProgressReporter
  1887 +registerStream
  1888 +registerStreamFilter
1851 Regsvr 1889 Regsvr
1852 releaseResolved 1890 releaseResolved
1853 ReleaseResolver 1891 ReleaseResolver
@@ -1872,6 +1910,7 @@ reportProgress @@ -1872,6 +1910,7 @@ reportProgress
1872 repos 1910 repos
1873 requiredChoices 1911 requiredChoices
1874 requiredParameter 1912 requiredParameter
  1913 +resampler
1875 resave 1914 resave
1876 reserveObjects 1915 reserveObjects
1877 resetBits 1916 resetBits
@@ -1928,6 +1967,7 @@ saphir @@ -1928,6 +1967,7 @@ saphir
1928 sarray 1967 sarray
1929 SASLprep 1968 SASLprep
1930 savable 1969 savable
  1970 +sc
1931 scanline 1971 scanline
1932 scanlines 1972 scanlines
1933 Scarff 1973 Scarff
@@ -1956,6 +1996,7 @@ setCompressStreams @@ -1956,6 +1996,7 @@ setCompressStreams
1956 setContentNormalization 1996 setContentNormalization
1957 setDataKey 1997 setDataKey
1958 setDecodeLevel 1998 setDecodeLevel
  1999 +setDecodeParms
1959 setDefaultProvider 2000 setDefaultProvider
1960 setDescription 2001 setDescription
1961 setDeterministicID 2002 setDeterministicID
@@ -1967,6 +2008,7 @@ setExtraHeaderText @@ -1967,6 +2008,7 @@ setExtraHeaderText
1967 setFieldAttribute 2008 setFieldAttribute
1968 setFile 2009 setFile
1969 setFilename 2010 setFilename
  2011 +setFilterOnWrite
1970 setFromVector 2012 setFromVector
1971 setIgnoreXRefStreams 2013 setIgnoreXRefStreams
1972 setImmediateCopyFrom 2014 setImmediateCopyFrom
@@ -2047,6 +2089,7 @@ src @@ -2047,6 +2089,7 @@ src
2047 srdp 2089 srdp
2048 sregex 2090 sregex
2049 ss 2091 ss
  2092 +ssp
2050 sstream 2093 sstream
2051 stampfile 2094 stampfile
2052 stamppdf 2095 stamppdf
@@ -2080,6 +2123,7 @@ strcpy @@ -2080,6 +2123,7 @@ strcpy
2080 streamDataChoices 2123 streamDataChoices
2081 StreamDataProvider 2124 StreamDataProvider
2082 streammethod 2125 streammethod
  2126 +StreamReplacer
2083 strerror 2127 strerror
2084 StrF 2128 StrF
2085 stricmp 2129 stricmp
@@ -2144,6 +2188,7 @@ Te @@ -2144,6 +2188,7 @@ Te
2144 TerminateParsing 2188 TerminateParsing
2145 terminateParsing 2189 terminateParsing
2146 testcase 2190 testcase
  2191 +TestDriver
2147 testOutlines 2192 testOutlines
2148 testPages 2193 testPages
2149 TESTSUITE 2194 TESTSUITE
@@ -2320,6 +2365,7 @@ wfilenamep @@ -2320,6 +2365,7 @@ wfilenamep
2320 WFLAGS 2365 WFLAGS
2321 wfopen 2366 wfopen
2322 whoami 2367 whoami
  2368 +willFilterStream
2323 WinAnsi 2369 WinAnsi
2324 winansi 2370 winansi
2325 WinAnsiEncoding 2371 WinAnsiEncoding
@@ -2411,6 +2457,8 @@ XObject @@ -2411,6 +2457,8 @@ XObject
2411 XObject's 2457 XObject's
2412 XObjects 2458 XObjects
2413 xor 2459 xor
  2460 +XORDecode
  2461 +XORs
2414 xp 2462 xp
2415 xpacket 2463 xpacket
2416 xpdf 2464 xpdf
libqpdf/QPDFPageObjectHelper.cc
@@ -1084,7 +1084,7 @@ QPDFPageObjectHelper::flattenRotation() @@ -1084,7 +1084,7 @@ QPDFPageObjectHelper::flattenRotation()
1084 // When we rotate the page, pivot about the point 0, 0 and then 1084 // When we rotate the page, pivot about the point 0, 0 and then
1085 // translate so the page is visible with the origin point being 1085 // translate so the page is visible with the origin point being
1086 // the same offset from the lower left corner of the media box. 1086 // the same offset from the lower left corner of the media box.
1087 - // These calculations have been verified emperically with various 1087 + // These calculations have been verified empirically with various
1088 // PDF readers. 1088 // PDF readers.
1089 QPDFObjectHandle::Matrix cm; 1089 QPDFObjectHandle::Matrix cm;
1090 cm.e = 0.0; 1090 cm.e = 0.0;