Format: Keep a Changelog.
Spec reference: ISO 32000-2:2020 (PDF 2.0). Legacy read tolerance: ISO 32000-1:2008 (PDF 1.7).
[Unreleased]
[2.0.0] - 2026-11-19
Breaking
-
pdfBuilderwrites the Standard 14 metrics by default.addFont({ baseFont })of a Standard 14 Type1 face with nostandard14now carriesFirstChar,LastChar,Widthsand aFontDescriptor, which PDF 2.0 requires of every simple font (ISO 32000-2 Table 109): the builder declares@awacloud/fonts'standard14LookupandencodingLookupand uses them. Symbol and ZapfDingbats with an/Encoding, and a base font outside the 14, keep the legacy dictionary;standard14: falsewrites it on request. The standalone write bundles carry the two lookups (about 33 KB minified); the fw-variant ones declare them (next entry). pdf's Arlington write measure reads 387 / 387, from 327 / 343. A runtime composed withoutpkg_require(the README registers it) can no longer resolvepdfBuilder. -
The fw-variant Read+Write bundles declare the
@awacloud/fontsmodules they use.@awacloud/pdf/build/pdf-rw.js,pdf-large-rw.js,pdf-full-rw.jsandpdf-legacy-rw.jsno longer inlinestandard14Lookup,encodingLookupand their tables: register@awacloud/fonts' manifest on the runtime, as for the unbundled modules. The standalone bundles are unchanged and still need nothing. Each fw-variant Read+Write bundle is about 32.6 KB smaller minified (pdf-rw.min.js226,956 → 194,324 bytes) and 60.9 KB smaller unminified; its.meta.jsonnames the two declared modules undersiblingDependencies. -
readDocumentopens an encrypted document with the empty password by default. Read with nopassword(and withoutallowEncrypted), an encrypted document the empty password opens, as the user then as the owner, now reads, with onepdf/document/opened-with-empty-passwordloss carrying the permission bits; one it does not open still throwspdf/document/encrypted.emptyPassword: falsekeeps the 1.x refusal.pdfMergerefuses an encrypted source by name,pdf/merge/encrypted-source, since its pages would land in an unencrypted output. On the corpus, 10 of 42 encrypted files open this way (AES), 7 more with thelegacyRc4reader. -
readDocumentrebuilds an unusable cross-reference chain by default. A wrongstartxref, an undecodable cross-reference stream, nostartxrefor a trailer without/Rootnow rebuilds the table from the file's bytes, recorded aspdf/document/xref-rebuilt, unlessrecoverXref: false, which throws the walk's error as 1.x did. A byte source whose chain fails is read whole once for the rebuild, andrecoverXref: truewith a source no longer throwspdf/document/recover-needs-bytes.pdfSignandpdfFormFill, which append an incremental update, read their base withrecoverXref: false. On 2,422 corpus PDFs, 27 deliberately damaged qpdf test files now read; no file that read changes.
Changed
-
A composite font follows its embedded CMap.
pdfFontDecoderread aType0font's glyph widths from/Wonly underIdentity-H/-V(any other CMap gave/DWandtext/width-approximated), and split its strings 2 bytes at a time. Under an embedded CMap stream it now maps each code to its CID through@awacloud/fonts'cmapCid(the stream's/UseCMapparent under it) and takes/Wthere, and reads the codes by the CMap's codespace when they are not all 2 bytes long: the decoder gainssplit(bytes)andwidth(code, length), whichdecodeShowandpdfPageTextuse. A predefined CMap by another name keeps/DW. Over the reference corpus, the 10 documents with such a font change: their runs placed by/W,text/width-approximatedgone from them; every other page is unchanged. -
The TeXCMMaths fonts read as the signs they draw. A simple font of the
TeXCMMathsSymbols,TeXCMMathsItalicorTeXCMMathsExtensionfamily names each glyph by a Computer Modern position, and its ToUnicode repeats the names:=was read as¼,+asþ,(and)asðandÞ, the minus sign as U+FFFD,/as=.pdfFontDecodernow reads those three families through@awacloud/fonts'encodingTexMathbefore the ToUnicode (the glyph name gives the position); every other font is read as before. The decoder depends onencodingTexMath, which@awacloud/fonts' manifest registers.
Added
-
pdfPageText's visitor knows the losses so far.visit'sctxgainslossCount, the number of losses the walk has recorded before the operator, so a caller's own losses fall in order among the walk's, asrunCountplaces its items among the runs. -
Fonts with CFF outlines embed.
pdfFontEmbed.embedSimpleandembedCidtook TrueType outlines only (a CFF or CFF2 font threwfonts/subset-bad-font). They now subset any outlines and write the dictionaries ISO 32000-2 Table 124 asks for: a CFF font's subset is aFontFile3 /OpenTypeprogram under/Type1(its codes reaching their glyphs by name, a/Differencesof the subset's glyph names over/WinAnsiEncoding) or a/CIDFontType0CIDFont (its codes the program's CIDs, no/CIDToGIDMap). A CID-keyed program (a CFF2 font's subset is one) has no simple form:embedSimplerefuses it withpdf/embed/cid-keyed-simple. A TrueType font embeds as before, byte for byte. The builder writes aFontFile3stream with/Subtype /OpenTypeand without/Length1.pdfFontEmbeddepends onfontSfntandfontCffProgram, in the fonts manifestpkg_requirecarries. -
Zapf Dingbats glyph names and the Standard 14 symbol fonts read as characters (
pdfFontDecoder). A font whose family names Dingbats resolves its glyph names through the ITC Zapf Dingbats Glyph List (a73→■), and a non-embeddedSymbolorZapfDingbatsfont with no base in/Encodingtakes its built-in encoding (a24→✘, not8). On 2,422 corpus PDFs (first 60 pages each), the undecodable codes fall from 3,017 to 2,744. -
Symbol and Wingdings private-use text read as characters (
pdfFontDecoder). A ToUnicode entry at 0xF020–0xF0FF in aSymbol,SymbolMTorWingdingsfont is read again: Symbol's throughSymbolEncodingand the AGL (U+F0B7 →•), Wingdings' for the pairs Word itself writes (U+F0A7 →▪, U+F0FC →✓). On 2,422 corpus PDFs (first 60 pages each), the private-use characters fall from 50,675 to 438. -
pdfFontDecoderreads a symbolic font's built-in encoding. A symbolicType1orMMType1font whose embedded program is/FontFile(Type 1),/FontFile3Type1C, or/FontFile3OpenTypewith aCFFtable, and whose/Encodingnames no base, now decodes through the program's built-in encoding (ISO 32000-2 §9.6.6.1), with/Differencesover it. Before,StandardEncodingwas used. pdfLaTeX's Computer Modern text and math, which carry no/ToUnicode, now come out as text: a comma where a semicolon came out, a period for a colon, and the minus, relation and Greek symbols where codes were counted undecodable. The decoder depends onfontType1,fontCffProgramandfontSfnt. -
pdfFormFill, fill an AcroForm and save it.fill(bytes, values)sets text, check-box, radio and choice fields by their full names, in an incremental update that keeps the prior bytes (an earlier signature still verifies). Each filled text field gets a generated appearance stream (its/DAfont and size, one line), and the AcroForm gets/NeedAppearances true. -
pdfMerge, copy pages from several documents into a new one.merge(sources, opts?)takes each source's bytes and, optionally, the page indices wanted, and writes the chosen pages in order: each with its inherited attributes flattened and every object it reaches, renumbered and shared once. The sources' outlines, structure trees, form fields and Info are not carried; a link to a page left out loses its destination. -
A read document's public reach.
readDocument's result carriesresolve(node)(the resolver_raw.resolveis),info()(the Info dictionary as decoded text, ornull) andpageContents(i)(a page's content streams decoded and joined), so no caller needs_raw;_rawstays. -
pdfPageText, a page text extra.extractPage(page, resolve, opts)walks a page's content streams and returns its positioned runs (text,x,y,xEnd,fontSize,bold,mcid), its counts and its text losses:- Form XObjects are executed under cycle, depth and operator-budget guards;
opts.cellKernscuts aTJtable row at its cell gaps;opts.visit(op, ctx)sees every operator walked, with the CTM, the marked-content id, the resources in force, the form depth and the run count.
pageText(page, resolve, opts)returns the runs joined into lines. Its walk is@awacloud/oconv's pdf page walk without the layout opt-ins: on 5,217 pages of 1,678 PDFs, its runs, counts and text losses equal that walk's. It is onpdfFontDecoder, so it is not in the prebuilt bundles either. -
pdfFontDecoder, a font decoder extra.buildDecoder(fontDict, resolve)anddecodeShow(decoder, bytes)turn a Font dict's character codes into Unicode text and glyph widths:- text through the ToUnicode CMap, the encoding + AGL hop, or a Type 0 font's predefined Unicode CMaps;
- widths from
/Widths,/W//DW, the Standard 14 AFM widths or a declared fallback.
It was moved from
@awacloud/oconv's pdf reader, where a copy stays until oconv is rebuilt on it. On 5,217 pages of 1,678 PDFs both give the same text items. It is registered in the extras. It is not in the prebuilt bundles: their generator cannot bundle a@awacloud/fontsdependency (the same gap aspdfFontEmbed). -
pdf.readthrough a byte source.pdf.read(source, opts)takes a synchronous{ byteLength, read(offset, length) }in place of the bytes. The file is read by windows: its header, its tail, each xref section and each object as it is resolved. A window starts at 64 KiB (opts.sourceWindow) and doubles while a parse needs it, up to the parser'smaxStreamBytesplus 64 KiB (pdf/document/source-window). The result's_rawcarriessource;recoverXrefneeds the bytes (pdf/document/recover-needs-bytes). AUint8Arrayreads as before. A 6 GB PDF of the Stressful corpus now reads within 1 GiB. -
The Arlington tail typed.
pdfMisc.typeSmallObject(value, kind)(withSMALL_OBJECT_KEYS) types fifteen small objects no other typer was bound to: an alternate image, a page-piece data dictionary, a structure destination's dictionary, a fixed-print dictionary, the mark information, a marked-content and an object reference, a minimum bit depth, a namespace, a reference XObject's reference, a web capture's source information, a timespan, a URL alias, a user property, the Windows launch parameters.pdfDocumentParts.typeDPartcopies a part's/AF(af), andtypePagetypes/Hid(hid). The read keys of the Arlington PDF Model now handled: 3,355 of 3,357. -
The public-key security handler typed.
typeEncryptDicttypes a public-key/Encryptdictionary (no/R;/Rstays required for the Standard handler) and its/Recipients(Recipients: [Uint8Array]). A new opt-in extra,pdfCryptPublicKey(registered bypdf-full), types a public-key crypt filter, the public-key and Standard crypt filter maps, and/EncryptedPayload. A document under the public-key handler is now refused by the read withpdf/crypto/unsupported-filter(it was refused withpdf/crypto/encrypt-dict/missing-V-R). Typing only: the package decrypts the Standard handler alone. -
The builder's structure API: tagged documents.
openElement(type, props?)(alt,lang,attributes),markContent()(the current page's next MCID) andcloseElement()declare the logical structure; the caller writes the marked content.build()writes the StructTreeRoot, the elements with their marked-content references (an MCR for another page), the ParentTree, the pages' StructParents and MarkInfo, and underpdfUA: 2the PDF 2.0 namespace. Misuse is aContractError(pdf/builder/bad-struct-type,bad-struct-props,no-open-element,open-element). So tagged, the builder's documents conform to PDF/UA-1 and PDF/UA-2 as veraPDF 1.30.3 judges them. -
builder({ pdfUA: 1 | 2, lang }): a document claiming PDF/UA. The catalog gets MarkInfo/Marked true,/Lang, ViewerPreferences/DisplayDocTitle trueand an XMP packet withpdfuaidand theaddMetadatafields (a Title required); version 1.7 (UA-1) or 2.0 (UA-2), a trailer/ID, every font embedded.pdfXmp.packetwritespdfuaid. A bad part (pdf/builder/bad-pdfua), a missing language (pdf/builder/pdfua-lang) or Title (pdf/builder/pdfua-title), asetVersionagainst the part (pdf/builder/pdfua-version) andpdfUAwithpdfA(pdf/builder/pdfua-with-pdfa) areContractErrors. The logical structure is not written yet: an untagged document so claimed fails only veraPDF's structure rules. -
A font without a program is refused under
pdfA.build()throwspdf/builder/pdfa-font-not-embedded(aContractError, its context naming the fonts) when a document claiming PDF/A registered a font with no embedded program; PDF/A requires every font embedded. -
The PDF/A output intent. Under
pdfA,pdfBuilderwrites the catalog's/OutputIntents: oneGTS_PDFA1intent whose destination profile is a first-party sRGB ICC profile (the newpdfSrgbIccmodule, generated in code from the public IEC 61966-2.1 colorimetry, no third-party bytes), or the caller's (builder({ pdfA, outputIntent: { profile, components, identifier, info } }); a malformed one, or one withoutpdfA, is aContractErrorpdf/builder/bad-output-intent). With it, veraPDF 1.30.3 judges the builder's PDF/A-4 and PDF/A-2b documents — text in embedded fonts, a soft-masked image — conforming. -
builder({ pdfA: '4' | '2b' }): a document claiming PDF/A.pdfBuilderwrites an XMP packet (pdfaidand theaddMetadatafields) as the catalog's unfiltered/Metadata; under PDF/A-4 no trailer Info and version 2.0, under PDF/A-2b the Info mirrored in the XMP, version 1.7 and a trailer/ID. ApdfAvalue other than'4'or'2b'(pdf/builder/bad-pdfa) and asetVersionagainst the profile (pdf/builder/pdfa-version) areContractErrors.pdfXmp.packet(fields)writes the packet;writeDocument'sderiveId: truederives the/IDat any version. The output withoutpdfAis unchanged. Colours, output intent and fonts are not handled yet: a blank page conforms to both profiles, as veraPDF 1.30.3 judges it. -
The PDF/A and PDF/UA linters read a
pdf.readresult and name the veraPDF rule of each finding.validatePdfABasics(doc, { profile })(pdfAOutputIntent) andvalidatePdfUa(doc, { part })(pdfUaTagged) take whatpdf.readreturns — the catalog fromcatalog.raw, references resolved, encryption and/Pfrom the trailer — as well as the hand-built shape they took. Each result gainsfindings: [{ rule, severity, message }],rulethe veraPDF rule id of the check for the profile ('1b'…'4f') or the part (1 or 2; PDF/UA-2 is new). A profile or part out of range is aContractError(pdf/extra/pdfa/bad-profile,pdf/extra/pdfua/bad-part). On a read document the linters found the catalog missing in every file; over the 787 PDF/A and PDF/UA files of the veraPDF corpus, the rules they fail now equal veraPDF 1.30.3's on those rules for every file.
Fixed
-
The tarball ships the sRGB profile's provenance note. The package's
filesnow takesrc/**/*.md, sosrc/prepress/PROVENANCE.md, whichdocs/api/prepress/srgb-icc.mdlinks, is in the npm tarball. -
A ToUnicode entry of U+FFFD no longer hides a glyph name that reads. The entry says the producer knew no character;
pdfFontDecodernow reads the code through the font's encoding instead, and keeps U+FFFD only when that reads nothing either. With@awacloud/fonts' fuller glyph-name reading,one.SPreads1where the text had U+FFFD. -
A stream whose
/Lengthnames itself no longer overflows the stack.readDocument's resolver reads a reference to an object it is already reading as null, recorded aspdf/document/reference-cycle, and the stream's data ends at itsendstream; an object stream whose/Lengthnames one of its members reads too. A nesting of more than 32 objects being read throwspdf/document/resolve-too-deep. Found by qpdf'sissue-117.pdf, which the cross-reference rebuild now reaches. -
Qrestores the text font.pdfPageText:qnow saves the font in force, its size and the leading with the CTM,Tc,TwandTz, andQbrings them back (ISO 32000-2 §8.4.1). Text drawn after aq … Tf … Q, as after a list label in a bullet font, was decoded through the font set inside theq. On 2,422 corpus PDFs (first 60 pages each), the undecodable codes fall from 14,410 to 3,017. -
The PDF/UA linter's verdicts follow their rules. A missing
/ViewerPreferences /DisplayDocTitle trueis an error (a "shall" of both parts; it was a warning); a missing catalog/Langis a warning under PDF/UA-1, which asks only that the language be determinable (it was an error, wrong on 18 conforming files of the veraPDF corpus), and an error under PDF/UA-2; a/Markedheld by reference is read. The PDF/A linter's "/MarkInfo must be a dictionary" is a warning (no PDF/A rule names it).
[1.2.0] - 2026-11-02
Added
pdfInfo.decodeTextString(bytes): decodes a pdf text string such as the Info/Title(UTF-16BE after its BOM, its language escapes removed; UTF-8 after its BOM; else PDFDocEncoding); anything but bytes throwspdf/info/bad-text-string.typeInfostill returns the strings as bytes.pdfXmpExtended.dcTitle(input): thedc:titleof an XMP packet — itsx-defaultalternative, else its first, else a leaf value — which the leaf harvest ofparsePacketdoes not reach.parseXrefTablenames the shapes it tolerated. Its result gainstolerated('subsection-header-space','entry-eol-one-byte'), absent for a table in the standard's shape.- Encrypted documents read with a password.
readandreadDocumenttakepassword(a string or bytes;''is the empty user password): the Standard handler V=4 R=4, V=5 R=5 or V=5 R=6 is applied, the password tried as the user, then as the owner password, and every object's strings and stream payload are decrypted as it is read (a cross-reference stream, the metadata stream underEncryptMetadata falseand a signature's/Contentsstay as stored); an object stream is decrypted as a stream and its members read as stored. Without it an encrypted document still fails loud withpdf/document/encrypted— the empty password is never tried on its own. New errors on the new option only:pdf/document/bad-password-option,pdf/document/bad-password,pdf/crypto/unsupported-filter.pdfSecurity.typeEncryptDictaccepts the typed dictionaryreadyields. - RC4 V=1 / V=2 read with a password, through the legacy extra.
readandreadDocumenttakelegacyRc4, the opt-inpdfLegacyRc4Readinstance: underpassword, an RC4 document (R2, R3) is decrypted with it (the user, then the owner password). Thepdf-legacybundle'sreadpasses its own.pdfLegacyRc4ReadgainsvalidateOwnerPassword. New error on the new option only:pdf/document/bad-legacy-rc4-option. - A fast cipher for the decrypting read, opt-in.
readDocument/pdf.readtakefastCipher: true(withpassword): the key check — the R6 key hardening above all — and the AES-CBC string and stream decryption go through fw's T-tableaes.ttable.fninstead of the constant-timeaes.fn(a 30-page R6 read 0.9 s → 25 ms; a stream 0.3 → about 100 MB/s). Not constant-time: for a trusted, single-user host. The Standard handlers' read functions anddispatchDecryptStreamtake an optional trailingopts. New error on the new option only:pdf/document/bad-fast-cipher-option. - Cross-reference recovery, opt-in.
readDocument(andpdf.read) take a newrecoverXrefoption: withtrue, a cross-reference chain the reader cannot use (a wrong offset, an undecodable cross-reference stream, nostartxref, a trailer without/Root) is rebuilt from the file's bytes — object definitions in file order, object-stream members, the merged trailer dictionaries — and the read recordspdf/document/xref-rebuiltinlosses;xref.sectionsthen holds the one section{ at: null, kind: 'rebuilt', entries }. Without the option every read is unchanged. - Standard 14 metrics in every encoding.
pdfBuilder.addFont's opt-instandard14now also takes a Latin face inMacRomanEncoding,StandardEncodingor with noencoding(its built-in StandardEncoding) when the spec givesencodings, the@awacloud/fontsencodingLookupAPI: each code's width is its glyph's (the WinAnsi table's, else the record'sextraWidths, else 0). Withoutencodingssuch a registration still throwspdf/builder/bad-font; every other output unchanged. - Entries the typers knew but never returned are now typed. Each
of these typers listed the entries as known (so they were neither
typed nor in
_extras, reachable only throughraw) and now returns them as new optional fields, set only when the entry is present — numbers, integers, booleans and names by their value, strings as bytes, dictionaries, arrays and streams as read; a dictionary without them gives the record it gave before:typePage:lastModified,boxColorInfo,thumb,b,dur,trans,aa,pieceInfo,structParents,id,pz,separationInfo,templateInstantiated,presSteps,vp,af,outputIntents,dPart(ISO 32000-2 Table 31);typeCatalog:threads,openAction,aa,uri,spiderInfo,pieceInfo,perms,legal,requirements,collection,needsRendering,dss,af,dPartRoot(Table 29);- the four field typers:
parent,kids,tu,tm,aa(Table 226), plusdaandqon the button and signature fields,dvon the signature field andrvon the text field (Table 230); typeEmbeddedFile:length,filter,decodeParms,dl— what itsbytesare encoded with; the opt-intypeSoundStream:type,length,filter,decodeParms;typeFontFile3OpenType:filter,decodeParms;typeCollection:colors,folders,split;typeFileSpec:type,thumb;typeOutlineItem:se; the opt-intypeCollectionItem,typeCfEntryandtypeDocMdpParams:type.
- Stream dictionary entries typed. The core
pdfFilterDispatchgainstypeStreamEntries(stream), for a stream or its dictionary: the entries every stream dictionary shares (ISO 32000-2 §7.3.8.2, Table 5) —/Length(an integer or a reference), the/Filterand/DecodeParmschain as read, the external-file entries/F,/FFilter,/FDecodeParms, and/DL. The existing functions are unchanged. - The filter decode parameters.
typeDecodeParms(dict, filter)onpdfFilterDispatchtypes the decode parameters of the Flate, LZW, CCITT fax, DCT, JBIG2 and Crypt filters; the decode path unchanged. - Viewer preferences typed. The opt-in
pdfMiscgainstypeViewerPreferences(dict)for the catalog's/ViewerPreferences(ISO 32000-2 §12.2, Table 147): the window and display booleans, the page-mode, direction, area, clip and scaling names at their Table 147 defaults when absent,/Duplex,/PickTrayByPDFSize,/PrintPageRangeas[first, last]pairs,/NumCopiesand/Enforce; every other entry in_extras. The core catalog record, which keeps the dictionary as read (viewerPrefs), is unchanged. - Font descriptors typed. The opt-in
pdfFontColorTagginggainstypeFontDescriptor(dict), a typer for the font descriptor of any font kind — simple, Type 3, CIDFont, or a value of a CIDFont descriptor's/FD(ISO 32000-2 §9.8, Tables 120, 122 and 123): the names, the family and character set strings, weight and flags, the bounding box, the metrics (/Leading,/XHeight,/StemH,/AvgWidth,/MaxWidth,/MissingWidthat their default 0 when absent), the font programs and/CIDSet({ num, gen }for a reference),/Style,/Langand/FD; every other entry in_extras. The core font typers, which return the descriptor untyped asfontDescriptor, are unchanged. - The font file stream keys and the font name.
typeFontFileEntrieson the opt-inpdfFontColorTaggingtypes a font file stream's own keys (Length1–Length3,Subtype,Metadata);typeFontFile3OpenTypegainslength1–length3;typeStyleDicton the opt-inpdfFontCidTypedtypes a CIDFont's/Style; the coretypeFontgainsname(/Name). - Markup and PDF 2.0 annotation entries typed. The opt-in
pdfAnnotExtendedgainstypeMarkupEntries(dict), a companion typer for an annotation of any subtype: the entries PDF 2.0 adds to every annotation (/ca,/BM,/Lang, ISO 32000-2 Table 166) and, on the markup subtypes listed in the newMARKUP_SUBTYPES(§12.5.6.2 Table 171, plusProjection), the markup entries of Table 172 (/T,/Popup,/RC,/CreationDate,/IRT,/Subj,/RT,/IT,/ExData), which the core annotation record keeps untyped in_extras. The core record and the existing typers are unchanged. - The annotation appearance dictionaries.
typeAppearanceDict(dict, kind)on the opt-inpdfAnnotExtendedtypes the appearance characteristics, border style, border effect and icon fit; the line annotation gainslloandco, the ink annotationpath, the opt-intype3DAnnot3DUandGEO. - The remaining actions. The opt-in
typeExtendedActiontypes Thread, Sound, Movie, RichMediaExecute, GoToDp and the PDF 1.2 SetState and NOP;typeAdditionalActions(dict, kind)types the additional-actions dictionaries (catalog, form field, page, screen and widget annotation triggers). The coretypeGoTo/typeGoToRreadSD(sd). - The form field keys.
typeFieldEntries(dict)on the opt-inpdfFormActionsExtendedtypes a field dictionary's shared keys and its rich text (DS,RV) beside the core field typers;typeFieldLock(dict, kind)on the opt-inpdfMisctypes a signature field's lock, the FieldMDP transform parameters and the UR transform parameters (urTransform). - The signature and DSS dictionaries.
typeVRIEntry(dict)on the opt-inpdfSigPadestypes one VRI entry;typeSeedValue(dict, kind)andSEED_VALUE_KEYStype a signature field's, certificate's,/MDP's and/TimeStamp's seed value (kindfield,cert,mdp,timeStamp): one field per key of its list, named after the key in lower case, present only when the key is; the other keys in_extras. Errors:pdf/extra/pades/seed/not-dict,pdf/extra/pades/seed/kind. - The signature build data.
typeBuildData(dict, kind)andtypeBuildProperties(dict)on the opt-inpdfSigPadestype a signature's/Prop_Buildand itsFilter,PubSec,AppandSigQentries;typeReferenceArray's entries gaindigestValueanddigestLocation; the coretypeSignaturegainstype,changes,randadbeBuild. - The requirements of ISO 32000-2. Each entry of the opt-in
typeRequirementsgainstype,v,penalty,digSigandencrypt(present only when the key is);REQUIREMENT_S_VALUESholds the 27 requirement types of ISO 32000-2;typeRequirementHandler(dict)types a requirement handler (type,s,script). - The structure attributes of ISO 32000-2 typed. The opt-in
typeStructAttributetypes the ownerNSO(nsand every standard owner's fields), the Layout keysTBorderStyle,TPadding,RubyAlign,RubyPosition,GlyphOrientationVertical, and the Table'sShort. The coretypeStructElementreadsRef(ref). - The optional content dictionaries.
typeOptionalContent(dict, kind)on the opt-inpdfOptionalContentExtendedtypes the optional content properties, the membership dictionaries and the usage sub-dictionaries (creator info, language, export, zoom, print, view, user, page element). - The colour and prepress dictionaries.
typeColorPart(dict, kind)on the opt-inpdfColorSpacesExtendedtypes the DeviceN attributes, mixing hints, process and solidities, the default colour spaces and a dictionary of functions;typePrepressPart(dict, kind)on the opt-inpdfXPrepresstypes separations, box colour information and style, trap regions and the output profile reference; the opt-intypeExtGStategainshtp(PDF 1.2's halftone phase). typeOpi(dict),typeOpiDict(dict, version)andOPI_KEYSon the opt-inpdfXPrepress. Type an image or form XObject's/OPIdictionary (Open Prepress Interface):version13/version20, each version dictionary with one field per key of its list, named after the key in lower case, present only when the key is; the other keys in_extras. A non-dictionary throwspdf/extra/pdfx/opi/not-dict, a version other than'1.3','2.0'pdf/extra/pdfx/opi/version.typeHalftone(value)andHALFTONE_KEYSon the opt-inpdfContentOpsExtended. Types a halftone dictionary or stream (the value an ExtGState'sHTnames) by its/HalftoneType(1, 5, 6, 10, 16): one field per key of its type's list, named after the key in lower case, present only when the key is; a type 5 halftone's colorant entries incolorants; a stream's own Table 5 keys left totypeStreamEntries; the other keys in_extras. A value that is neither a dictionary nor a stream throwspdf/extra/halftone/not-dict, a missing or unknown/HalftoneTypepdf/extra/halftone/bad-type.typePattern(value)andPATTERN_KEYSon the opt-inpdfShadingTyped. Types a tiling or shading pattern (by its/PatternType; a tiling pattern's own Table 5 keys left totypeStreamEntries): one field per key of its list, named after the key in lower case, present only when the key is; the other keys in_extras. Errors:pdf/extra/shading/pattern/not-dict,pdf/extra/shading/pattern/bad-type.- The 3D and RichMedia dictionaries.
type3DScene(dict, kind)andSCENE_KEYSon the opt-inpdf3dRichMediatype the 3D view and scene dictionaries — views (ISO 32000-2'sSnapshotandParamsincluded), cross sections, nodes, render modes, backgrounds, lighting schemes, units, the 3D stream (stream;type3DScenetakes a stream as well, its dictionary read and its own Table 5 keys left totypeStreamEntries), animation styles (animationStyle), references (reference), projections (projection), markup external data (markup) and measurement references (measureRef),kindnaming which: one field per key of its list, named after the key in lower case, present only when the key is; the other keys in_extras. A non-dictionary throwspdf/extra/3d/scene/not-dict, an unknownkindpdf/extra/3d/scene/kind.type3DMeasure(dict)andMEASURE_KEYStype a 3D measurement dictionary (RD3,AD3,PD3,LD3,3DC); a non-dictionary throwspdf/extra/3d/measure/not-dict, a missing or unknown/Subtypepdf/extra/3d/measure/bad-subtype.type3DActivationreadsStyle,WindowandTransparent(style,window,transparent;nullwhen absent).typeRichMedia(dict, kind)andRICH_MEDIA_KEYStype the RichMedia dictionaries — activation and deactivation, animation, command, configuration, instance, position, presentation, settings, window and its width and height,kindnaming which; a non-dictionary throwspdf/extra/rm/dict/not-dict, an unknownkindpdf/extra/rm/dict/kind.typeRichMediaContentgainstype, the/Typename. typeMeasurement(dict, kind)andMEASUREMENT_KEYSon the opt-inpdfMisc. Types the measurement dictionaries — rectilinear and geospatial measures, number formats, viewports, point data, the coordinate systems (geographicCS,projectedCS) and a geospatial markup's external data (markupGeo),kindnaming which: one field per key of its list, named after the key in lower case, present only when the key is, a reference read as read for every key; the other keys in_extras. A non-dictionary throwspdf/misc/measurement/not-dict, an unknownkindpdf/misc/measurement/kind.typeXObjectEntries(value, kind)andXOBJECT_ENTRY_KEYSon the opt-inpdfMisc. The companion of the core XObject typers: the keys of an image, image mask, soft mask, form, printer mark, trap network or PostScript XObject they leave out (Alternates,SMaskInData,ID,StructParent,OPI,OC,AF,Measure,PtData,PieceInfo,LastModified,XUID, the trap network and printer mark keys …), one field each, named after the key in lower case; no_extras. Errors:pdf/misc/xobject/not-dict,pdf/misc/xobject/kind.- The keys the core typers read without exposing.
typeObjectEntries(value, kind)on the opt-inpdfMisctypes a thumbnail's, a CMap stream's, an ICC profile's, a page tree node's, a resource dictionary's, an encoding's, the trailer's and an object stream's keys beside the core typers; no core record changes. - The name, extensions and URI dictionaries.
typeCatalogPart(dict, kind)on the opt-inpdfMisctypes the catalog's name dictionary, its extensions and developer extensions dictionaries and its URI dictionary; the coretypeCataloggainsextensions. - The embedded file parameters and the go-to-embedded targets.
pdfEmbeddedFileexportstypeEmbeddedFileParams(dict), whose record gainsmac;typeFilePart(dict, kind)on the opt-inpdfEmbeddedFilesPortfoliotypes a file specification's/EFand/RF, the Mac OS file information and the targets;typeFileSpecgainsep(PDF 2.0's encrypted payload). - The collection folders, colours, split and sub-items.
typeCollectionPart(dict, kind)on the opt-inpdfEmbeddedFilesPortfoliotypes them;typeSchemaFieldandtypeSortread the optional/Type(type). - The presentation and navigation dictionaries.
typePresentation(dict, kind)on the opt-inpdfMisctypes the floating window parameters, transitions, navigation nodes, beads, threads, slide shows, page labels, view parameters and the outline root;typeNavigatoron the opt-inpdfEmbeddedFilesPortfoliogainstypeandlayout. - The Web Capture dictionaries.
typeWebCapture(dict, kind)on the opt-inpdfMisctypes the page sets, image sets, commands and command settings. typeMediaDict(dict, kind)andMEDIA_KINDSon the opt-inpdfLegacyDeprecatedAnnots. Types the multimedia dictionaries the Screen annotations and rendition actions point at (ISO 32000-2 § 13.2: renditions, media clips and sections, play and screen parameters, media criteria, durations and offsets, permissions, players, player info, software identifiers, minimum screen size) and the movie and movie-activation dictionaries: one field per key of the kind's table, present only when the key is, the other keys in_extras. A non-dictionary throwspdf/legacy-annot/media-not-dict, an unknown kindpdf/legacy-annot/media-kind(ContractError). The existing functions are unchanged.
Changed
- Typed records stop leaving some keys in
_extras. Each of these entries was in the record's_extrasand is now a typed field, set only when the entry is present; a 1.1.0 consumer that read it from_extrasfinds it in the field named here (the records are a read model, nothing is written back from them):typeCatalog:Extensionsisextensions;typeStructElement:Refisref;typeFileSpec:EPisep;- the embedded file parameters (
paramsoftypeEmbeddedFile):Macismac; - the ink annotation:
Pathispath; the line annotation:LLOislloandCOisco; the opt-intype3DAnnot:3DUandGEO(named as the keys); - the opt-in
typeExtGState:HTPishtp; - the opt-in
typeFontFile3OpenType:Length1toLength3arelength1tolength3; - the opt-in
typeSchemaFieldandtypeSort:Typeistype; - the opt-in
typeStructAttribute: the Table'sShortand the print field'sCheckedare typed, and anNSOowner (read as a vendor owner, its keys in_extras) is typed withATTRIBUTE_OWNERSholding it; - the opt-in
typeLegal:HideAnnotationActionsandGoToRemoteActions, when integers, joinflags;OptionalContent, when a boolean, isoptionalContent(a value of another type stays in_extras).
typeStructAttributereadsWidth,HeightandLineHeightgiven as a name. The Layout attributeswidth,heightandlineHeightwere a number ornull; a name is now returned by its value.typeRequirementsmarks all 27 requirement types of ISO 32000-2 asstandard.standardwastrueforEnableJavaScriptsonly.typeLaunchkeepsMacandUnixas read, whatever their type. A non-dictionary value was dropped; a dictionary still counts as a target, a value of another type does not.pdfDocumentdeclares more dependencies. The reader now composespdfSecurity,pdfStandardV4,pdfStandardV5andpdfStandardV6, so a registry that composespdfDocumentitself also resolves fw'saes,cbc,sha256,sha384,sha512,bitArrayandpdfAesGcm.
Fixed
- Two classic cross-reference table shapes are read. A subsection
header ending with spaces or tabs before its EOL, and entries of 19
bytes (a one-byte EOL), threw
pdf/xref/bad-digit; both are now read, each recorded once as apdf/document/xref-toleratedloss. Any other entry keeps the 20-byte stride, and a malformed field still throws. - A page-tree
/Kidsgiven by reference.walkPageTreerefused a/Pagesnode whose/Kidsis an indirect reference to an array (pdf/pages/missing-kids); any value may be indirect (ISO 32000-2 § 7.3.10), so the reference is now resolved first. A reference to anything but an array still throws. /Encrypt nullis a plaintext document.typeTrailertyped a trailer/Encrypt nullas an encryption entry, soreadDocumentrefused the filepdf/document/encrypted(and, given a password, built a reference with no number). A null value is an absent entry (ISO 32000-2 § 7.3.9): the trailer now has noencryptand the file reads.- A signature's
/Contentsis written clear.writeEncryptedDocumentencrypted the/Contentsstring of a/Type /Sigor/DocTimeStampdictionary, which ISO 32000-2 § 7.6.2 leaves clear (and the decrypting read leaves as stored); it is now written as given. encryptMetadata: falseleaves the metadata stream clear.writeEncryptedDocumentencrypted the/Type /Metadatastream even when the flag said not to (ISO 32000-2 Table 20); it is now written as given.typeDPartreads the pages of a document part./Startand/Endare references to the part's first and last page objects (ISO 32000-2 Table 408); the opt-in typer read them as integers only, so a conforming file gavestartandendasnull. A reference is now{ num, gen }; an integer is kept as before.
[1.1.0] - 2026-10-21
Added
- Standard 14 metrics on the legacy
addFont. PDF 2.0 requiresFirstChar,LastChar,WidthsandFontDescriptorin every simple font dictionary, the Standard 14 faces included (ISO 32000-2 Table 109). The new opt-instandard14option of the non-embedded shape takes the@awacloud/fontsstandard14LookupAPI and writes them from the Adobe Core 14 metrics (WinAnsiEncodingfor the Latin faces, the built-in encoding forSymbolandZapfDingbats); without it the legacy bytes are unchanged. Astandard14value that is not that API, a face outside the 14, a subtype other thanType1, or an encoding the face does not take (WinAnsiEncodingfor a Latin face, none forSymbolandZapfDingbats) throwspdf/builder/bad-font. Committed-rwdist bundles regenerated.
Changed
- PDF 2.0 files written without an
/IDnow carry a derived one. ISO 32000-2 Table 15 requires the trailer/IDin PDF 2.0;pdfWriter.writeDocumentwrote one only when given, sopdfBuilderwithoutsetIdandpdf.writeof a document that had none emitted%PDF-2.0files without it, and the bytes of every such file change. When no/IDis given and the version is'2.0', both halves are now the first 16 bytes of the SHA-256 of the bytes written before the trailer (still reproducible). An explicit/IDand other versions are unchanged, andpdfXrefStreamWriterstill derives none.pdfWritergainssha256andbitArrayas its last, optional dependencies (a hand-wiredfactory(errors, serializer)keeps the old output). Committed dist bundles regenerated.
Fixed
- CIDSystemInfo entries written as strings. Every composite embedding
written through
pdfBuilderchanges by two entries:pdfFontEmbed.embedCidwrote the descendant CIDFont's/CIDSystemInfo/Registryand/Orderingas names (/Adobe,/Identity), and ISO 32000-2 Table 114 makes them ASCII strings; the opt-inpdfFontCidTyped.typeCIDSystemInforefused such a dictionary withpdf/extra/cid-system-info/incomplete. They are now strings ((Adobe),(Identity)); a value already given as a typed PDF object is kept. - Portfolio schemas that carry
/Typetype. The opt-inpdfEmbeddedFilesPortfolio.typeSchemaread every schema entry as a field definition, so a schema carrying the optional/Type /CollectionSchema(ISO 32000-2 Table 155) threwpdf/portfolio/bad-schema-field, andtypePortfoliothrew on the whole collection. A name-valued/Typeis now skipped; the fields are typed as before. Committed dist bundles carrying the module regenerated. - V=4 crypt filters resolve per class. A
/StmF /Identitypaired with a named/StrFdecrypted the streams with the/StrFfilter; ISO 32000-2 Table 20 names/StmFthe filter of every stream and Table 26 makesIdentitya pass-through. Streams of such a file now read unchanged (as on V=5; embedded files too when/EFFis absent), and signing it writes the new streams in the clear. Committed-rwdist bundles regenerated. - Errors survive the fw sanity layer.
PdfErrordefinednameby assignment, which throws aTypeErroronceapplyBase()has frozenError.prototype, so the typed error (code, context) was lost.nameis now an own property set withObject.defineProperty(same shape: writable, enumerable, configurable). Committed dist bundles regenerated.
Security
- Stream scripts reach the sandbox linter. A script held in a stream
is an indirect reference inside its action dictionary (ISO 32000-2
§ 7.3.8), and the opt-in
pdfFormActionsExtendedaccepted/JSonly as a string or a direct stream: a JavaScript action with such a script threwpdf/extra/action-ext/bad-js, and a rendition action dropped it (js: null, nosandboxedflag), sopdfSandbox.lintActionsdid not report its script. Both keep the reference now (js, for the caller to resolve) and are markedsandboxed; the linter reports them. Committed dist bundles carrying the module regenerated. - FlateDecode output ceiling (decompression bomb).
pdfFlate.decodestops at 256 MiB of inflated output per stream (the ooxml/odfmaxUncompresseddefault) and throwspdf/flate/output-limit; a long input is inflated 16 KiB at a time, so it is abandoned early instead of being inflated whole.decode(bytes, params, { maxOutput })sets another ceiling (0disables it);pdfFlate.limitsexposes the default.
[1.0.0] - 2026-10-07
Added
-
Core surface (L0) — typed object graph + classical xref + page-tree walker.
pdfErrorsexposesPdfError,ParseError,RenderError,ContractError,EncryptionError; every throw in the package uses these classes with a kebab-case, namespacedcodeand a structuredcontext.pdfTokenizer(binary lexer, ISO 32000-2 §7.2),pdfParser/pdfParserObj/pdfParserStream(typed object parser, §7.3 —null/bool/int/real/name/string/array/dict/ref/stream),pdfXref(classical xref, §7.5.4),pdfTrailer,pdfCatalog(§7.7.2),pdfPages(balanced page-tree walker, cycle + depth detection),pdfPage(§7.7.3.3),pdfDocument(top-level reader,/Prevxref chaining). Top-levelpdffactory exposes.read(),.header(),.use(...)(idempotent by name),.usedExtension(),.write(). -
Writer + filters (L1) —
pdfSerializer(typed-object → bytes, canonical real-number formatting,#xxname escapes, automatic hex form for binary strings),pdfWriter(writeDocument(...)emits the header it is given,%PDF-2.0by default),pdfBuilder(constructive DSL —addPage/addContent/addFont/addMetadata/setVersion/setId/.build()— builds a document from-scratch with nopdf.read()upstream). Five filters:pdfFlate(delegates to@awacloud/fw/io/compress/zlib, full/PredictorPNG (10–15, incl. optimum) + TIFF (2) encode and decode),pdfAsciiHex,pdfAscii85(incl.zshorthand +~>EOD),pdfRunLength,pdfFilterDispatch(/Filter+/DecodeParmschain walker, abbreviation table, DCT/JPX passthrough). Compressed-object readerspdfObjStream(§7.5.7) andpdfCrossRefStream(§7.5.8). -
Content streams + fonts + AcroForm (L2) —
pdfContentStream(~70 operators per ISO 32000-2 Table 60, inline-imageBI…ID…EIcapture),pdfContentOps(operator catalogue),pdfGraphics(GStateStack,q/Q, CTM),pdfText(Td/TD/Tm/T* tracking,extractText),pdfColor,pdfImages(XObject typing),pdfResources(page-tree parent-chain resolution). Font glue to@awacloud/fonts:pdfFont(every ISO subtype),pdfFontEncoding,pdfType3,pdfFontEmbed(single adapter to@awacloud/fonts/embed-pdffor subset embedding). AcroForm baseline:pdfAcroForm,pdfFieldTree,pdfButtonField,pdfTextField,pdfChoiceField,pdfSignatureField,pdfAppearance. -
Annotations, tagged PDF, OCG, outlines/actions/destinations, embedded files, linearization, metadata, prepress, associated files (L3) —
pdfAnnotorchestrator + 12 subtype typers (Text, Link, FreeText, shape family viapdfShapeAnnot, markup family viapdfMarkupAnnot, Ink, Stamp, FileAttachment, Widget, Popup, Projection, Redact — ISO 32005).pdfStructTree/pdfStructElement/pdfRoleMap/pdfParentTree/pdfClassMap/pdfMarkedContent(StructTreeRoot walking, heterogeneous/Kchildren, RoleMap + Namespaces per Table 364–365, MCID resolution + extraction).pdfOCG/pdfOCConfig.pdfOutline,pdfDestination,pdfAction+ GoTo/GoToR/GoToE/URI/ Named/Launch typers.pdfFileSpec/pdfEmbeddedFile/pdfCollection(PDF Portfolio).pdfLinearization(types the/Linearizedparameter dictionary, read-only).pdfInfo/pdfXmp.pdfOutputIntent/pdfPageBoundary(PDF/A, PDF/X, PDF/E; effective Crop/Trim/Bleed/Art box resolution).pdfAssociatedFiles(/AF+/AFRelationship, PDF 2.0). -
Encryption, decrypt + encrypt (L3) —
pdfSecurity(Security Handler dispatcher),pdfStandardV4(PDF 1.6/ISO 32000-1 §7.6.3 — AESV2 AES-128-CBC and V2 RC4-128,/O//Uderivation, per-object key derivation, string/stream/embedded-file encrypt and decrypt round-trip),pdfStandardV5(PDF 1.7 — AES-256-CBC + SHA-256),pdfStandardV6(PDF 2.0 — Algorithm 2.B hardening loop + Algorithm 8 FEK unwrap, SHA-256/384/512 selection),pdfPermissions(/PermsAlgorithm 13),pdfAesGcm(TS 32003 AES-GCM crypt filter, decode and encode),pdfEncryptedWriter(writeDocument-style encrypted write path — V4/V5 R=5/V6 R=6,/CFM AESV4GCM opt-in). All crypto via@awacloud/fw/crypto/*(pure JS, worker-safe).readdoes not decrypt: it refuses an encrypted file unlessallowEncrypted: trueis passed, and the handlers are then called by the caller. -
Digital signatures, verify + generate —
pdfSignature/pdfByteRange/pdfTimestamp/pdfCertChain/pdfDssBuilder: Sig/DocTimeStamp typing, PKCS#7 detached blob locator, ByteRange compute/extract, RFC 3161 TSP parser, X.509 cert chain extraction (CMS SignedData + PEM), structural chain ordering check, DSS dict typing.verifySignature(...)performs full public-key verification —verifyPkwires RSA-PSS (PKCS#1 v1.5 refused per fw policy), ECDSA (P-256/P-384/P-521), Ed25519; the result carriesverified: true(aliasvalid),pkVerified: true,computedDigestwhen the digest chain and PK-verify both succeed — the digest-only structural pass this superseded is gone (see Security).pdfSign.sign(pdfBytes, opts)generates PAdES signatures at all four levels: B (single embedded PKCS#7, no TSA), T (adds an RFC 3161 timestamp token via a caller-suppliedopts.tsaSign({ digest, hashAlg })callback), LT (appends a/DSSdict with certs viapdfIncrementalWriter), LTA (appends a/DocTimeStampon top of the LT bytes).verifyAllSignatures/validateBLtaChainround-trip a full B→T→LT→LTA chain end-to-end (tsaVerified/imprintVerifiedon the reconstructedDocTimeStamp).validateDocMdp(ref)validates MDP/P1/2/3 +/DigestMethod+/V1.2/2.2tolerance. Algorithms: RSA-PSS, ECDSA, Ed25519 across both verify and sign. -
Constructive + incremental writers —
pdfIncrementalWriter.appendIncremental(pdfBytes, updates)emitsoriginalBytes ‖ updatedObjs ‖ xref ‖ trailer ‖ %%EOFwith a/Prevchain (the mechanismpdfSign's LT/LTA levels build on).pdfXrefStreamWriter(src/document/xrefStreamWriter.js) implementswriteXrefStreamDocument(model, opts)— native/Type /XRefemission (PDF 1.5+/2.0) with an opt-inuseObjStmgrouping non-stream indirects into compressed/Type /ObjStmwrappers (§7.5.7). It is registered insrc/main.jsmodules, re-exported by name from the root entry, and ships in every Read+Writedist/root. -
Parser hardening —
parserLimits(maxDepth: 200,maxArrayLen: 1_000_000,maxStreamBytes: 256 MiB), adjustable at runtime viasetParserLimits(partial);findEndstreamaccepts an explicitmaxScanBytes. -
Shared helper factory
pdfShared(src/_shared/index.js) — canonical magic bytes (HEADER_PREFIX,EOF_MARKER,BINARY_MARKER), frozenASCIIbyte-constant table, character-class predicates per §7.2 (isWs/isEol/isDigit/isHex/isDelim/isRegular/hexNibble), theHEX_LOlookup table, codec instances and wrappers (encodeAscii/decodeUtf8/decodeUtf8Lenient/decodeLatin1), byte helpers (pad10/hexLit/bytesEqual/concatBytes).pdfTokenizerand the top-levelpdfdeclare it as a dependency; the filters, the writer and the serializer still carry their own inline copies of some of these helpers.pdfSigOidsconsolidates the OID → dispatch-label tables (DIGEST_OIDS,SIG_DISPATCH_OIDS,KEY_ALG_OIDS,SIG_ALG_OIDS_VERBOSE,OID_TST_INFO,OID_AA_TIMESTAMP,shortOid) previously duplicated acrosssignature.js/timestamp.js/certChain.jsinto one factory, which all three now declare as a dependency. -
Coverage extras (opt-in, the
extrasarray ofsrc/main.js— 32 modules undersrc/extra/— tree-shaken when unused) reach the PDF 2.0 long-tail + PDF 1.7 read tolerance: P0 (common) —content-ops-extended,font-cid-typed,font-color-tagging,tagged-pdf-typed,annot-extended,pdf-a-output-intent,pdf-ua-tagged. P1 (extended) —form-actions-extended,color-spaces-extended,shading-typed,transparency-typed,sig-pades,sig-aes-gcm,document-parts(ISO TS 32004),redaction-iso32005,pdf-x-prepress,well-tagged-pdf(WTPDF 1.0),optional-content-extended,embedded-files-portfolio,associated-files,xmp-extended. P2 (tail) —linearization-write(builds the/Linearizeddictionary and a zero-length hint-stream placeholder; it does not produce a linearized file),3d-richmedia,jbig2-read(segment-header enumeration, decode intentionally not implemented),legacy-xfa-read,legacy-rc4-read(RC4 known-answer-test verified),legacy-deprecated-filters(LZWDecode via fw + DCT/JPX passthrough; CCITTFax delegates to the siblingccitt-fax-decodercodec — see below),legacy-deprecated-annots(Sound/Movie/Screen typing). P3 (misc) —misc(SpiderInfo/Threads/Legal/Requirements/NeedsRendering),info-dict-deprecated(Info dict lint). Plus two modules added after the initial P0–P3 pass:pdf-sandbox(pdfSandbox.lintActions(...)— classifies/Launch//JavaScript//SubmitForm//ImportData//URI, bundled opt-in viapdf-full) andccitt-fax-decoder(a full ITU-T T.4/T.6 codec, encode + decode, for K<0 Group 4, K=0 Group 3 1D, K>0 Group 3 mixed — split out once the original header-only stub was completed; consumed bylegacy-deprecated-filtersas a dependency, and covered by both suites' tests). The legacy decoders are called through their extras' own API; they are not registered intopdfFilterDispatch. -
Bundles — three ergonomic compositions of core + extras, each a pure fw descriptor consumed via
ModuleRuntime.resolve(...):pdfLargeBundle(@awacloud/pdf/pdf-large, P0+P1, the common PDF 2.0 features),pdfFullBundle(@awacloud/pdf/pdf-full, +P2+P3, every PDF 2.0 extra),pdfLegacyBundle(@awacloud/pdf/pdf-legacy, +legacy-*family, reads PDF 1.7;writestill emits a%PDF-2.0header and re-emits legacy content — XFA, RC4 encryption, LZW streams, Sound/Movie annotations — as it was read, without converting it). Each resolved bundle exposes.read,.write,.use,.usedExtension,.header, and every wired extra under its factory name; re-applying a bundle is a no-op. Seedocs/api/bundles/README.mdfor the per-bundle extras breakdown. -
Pre-built bundles — two-surface
dist/, Read and Read+Write families.tools/generate-bundles.mjs(bun run gen:bundles, a thin wrapper around@awacloud/tool-prebuild-generator) emits two path-discriminated surfaces side by side underdist/:dist/standalone/<root>. {js,min.js,meta.json}(dependencies: [], every fw + pdf-local factory inlined, zero runtime registration) anddist/build/<root>.{js,min.js,meta.json}(declares the fw modules as dependencies, inlines only the pdf-local factories, smallest payload). The roots form a two-family × size matrix: the four assembly roots (pdf,pdf-large,pdf-full,pdf-legacy) are the Read family, and four-rwroots (pdf-rw,pdf-large-rw,pdf-full-rw,pdf-legacy-rw) form the Read+Write family — each the Read root's segment plus the write inventory, withpdfXrefStreamWritershipping in every-rwroot — on both surfaces, 8 roots × 2 surfaces. Strictly additive: adding the-rwroots left the four Read roots unchanged.dist/build/index.jsis a barrel re-exporting the whole@awacloud/pdfnamespace.package.jsonexposes./build/*and./standalone/*. Output is byte-deterministic across runs (no build stamp); the root.gitignore's blanketdist/exclusion is re-included via the package's own.gitignore(!dist/+!dist/**). Seedocs/api/bundles/dist-matrix.md. -
Documentation —
docs/README.mdtop-level index;docs/api/one page per source module (core,_shared/,extra/,bundles/), following the@awacloud/fwmodule-page format;docs/guide/— getting started, read pipeline, extension hook, coverage (withparserLimits), crypto (AES-CBC malleability risk,verifiedvsvalidsemantics,auditByteRange,pdfSandbox), PDF 1.7 legacy reading, and PAdES signing and verification. -
Tests + integration — one sibling test file per source module, co-located in
src/; integration suite undertests/:roundtrip.integration.test.js(wires the full stack through@awacloud/fwModuleRuntime, read → write → read on fixtures sized 1–10 pages, everyfactory.toString()transportability assertion),legacy-conversion.test.js(%PDF-1.xheader tolerance),fuzz.test.js(empty/garbage/truncated/no-xref/bad-header inputs → typedPdfError, never a bareError),_helpers/build.js(shared fixture builder). The package's coverage floor isawa.coverageFloorinpackage.json. -
Architecture — clean binary format (no ZIP;
%PDF-2.0header + indirect objects + xref + trailer); worker-safe factories (factory.toString()serializable, no closure on mutable module-level state — see Changed); zero external dependency beyond@awacloud/fw+@awacloud/fonts(both workspace); content stream parsed to an operator list, not interpreted (rendering / coordinate math is left to the caller); fonts always delegated to@awacloud/fonts(even standard-14 metrics); AcroForm field inheritance resolved at lookup time, never collapsed onto children, to preserve roundtrip fidelity; bundle composition is layered (pdf-full ⊃ pdf-large,pdf-legacy ⊃ pdf-full). -
Package surface —
package.jsonexposes:. src/main.js 5 descriptor arrays + every core descriptor by name ./pdf src/pdf.js top-level orchestrator only ./errors src/errors.js pdfErrors ./serializer src/syntax/serializer.js ./filters/* src/syntax/filters/*.js ./annot/* src/annot/*.js ./tagged/* src/tagged/*.js ./crypto/* src/crypto/*.js ./sig/* src/sig/*.js ./ocg/* src/ocg/*.js ./action/* src/action/*.js ./embedded/* src/embedded/*.js ./metadata/* src/metadata/*.js ./prepress/* src/prepress/*.js ./extra/* src/extra/*.js the opt-in extras ./bundles/* src/bundles/*.js 3 compositions ./pdf-large src/bundles/pdf-large.js ./pdf-full src/bundles/pdf-full.js ./pdf-legacy src/bundles/pdf-legacy.js ./build/* dist/build/* two-surface prebuilt (fw-DI variant) ./standalone/* dist/standalone/* two-surface prebuilt (framework-free)Note:
src/document/*(writer, builder, incremental/xref-stream writers, catalog, pages, resources) has no dedicated subpath export — reachable only through the root entry's additive named re-exports (below).awa.maturity: "L4"(the initial core surface shipped at L0, then progressed L0 → L1 → L2 → L3 → L4 through the factory-only refactor and the read/write gap closure). -
addFontencodingoption. A non-embeddedaddFontspec accepts an optionalencoding—WinAnsiEncoding,MacRomanEncodingorStandardEncoding— emitted as/Encoding /<name>after the existing keys, so a Standard-14 simple font can declare how its codes map to glyphs. Absent (orundefined) emits nothing and the bytes are unchanged; an unknown value, orencodingcombined withembedded, throwspdf/builder/bad-fontwith{ name, encoding }in itscontext. -
./<family>/*.jsexport twins. All twelve wildcard families of theexportsmap (./filters/*,./annot/*,./tagged/*,./crypto/*,./sig/*,./ocg/*,./action/*,./embedded/*,./metadata/*,./prepress/*,./extra/*,./bundles/*) gain a./<family>/*.jstwin, so a specifier written with the.jssuffix (e.g.@awacloud/pdf/extra/sig-pades.js) resolves to the same file under Node and under a browser prefix import map. The existing forms are unchanged. -
pdf.write(model, opts)options.strictforwards toassembleIndirects; the lenient skip list is exposed asskippedObjectsand throughonSkipped. -
sign()signs encrypted bases. The signature field's/Tis encrypted with the document key derived fromopts.password(standard security handler, AESV2/AESV3); RC4 and AES-GCM bases are refused with typed errors. This supersedes the encrypted-base exception (signature-only update, no field) noted under Fixed. -
PAdES LT and LTA on encrypted bases. The DSS streams, the VRI strings and the document-timestamp field are encrypted with the document key; the signature
/Contentsstay clear, as the standard requires. -
External-oracle tests. OpenSSL-produced ECDSA and Ed25519 CMS signatures verify, and
sign()output matches their structure. -
Ed25519 signatures declare ISO/TS 32002. The Ed25519 signing update re-emits the Catalog with
/Extensionsdeclaring theISO_developer extension (/ExtensionLevel 32002, ISO/TS 32002 §4), merged with any existing extensions dictionary, and sets/Version /2.0on a document below PDF 2.0. A malformed/Extensionsis refused (pdf/sign/bad-extensions). ECDSA and RSA-PSS output is unchanged.
Changed
- API reference pages and source comments describe each opt-in module by
what it covers — internal milestone labels are removed from the
extra/pages and the module, crypto and signature comments. - Standard 14 font dictionaries are shared across pages.
pdfBuilder.addFont(non-embedded) writes one font dictionary per distinct(baseFont, subtype, encoding)and every page that uses it references that object. A document that repeats a font on several pages gets smaller: a 3-page document using 4 faces drops from 12 font dictionaries to 4. Documents without a repeated font are unchanged. - Truncated FlateDecode streams decode to their prefix.
pdfFlate.decodereturns the bytes decoded before a FlateDecode stream ends without its final block, flagged by a non-enumerabletruncated: true, instead of throwingpdf/flate/inflate-failed. Content streams of such files now extract. Other inflate errors still throwpdf/flate/inflate-failed. - Documentation pass. The README follows the published-package
layout (installation, quick start, sub-path table with targets, maturity,
licence, project links) with executed quick-start snippets and no
hand-typed counts; guides open with their purpose and prerequisites; the
coverage and bundle pages state what the filter dispatch, the legacy
extras and
writeactually do; reference pages were checked against the resolved module surfaces; apdfSharedreference page was added; links to the historical audit pages, which no longer ship, were removed. - The Read+Write prebuilt bundles include signature verification.
Every
-rwroot underdist/build/anddist/standalone/shipspdfSignaturebesidepdfSign, so an invoked bundle exposesverifySignatureandverifyAllSignatures. Each-rw.min.jsgrows by about 21.8 KB (6.4 KB gzipped); the Read bundles are unchanged. - Dist — dist regenerated with the licence banner: every committed
dist/**/*.js/.min.jsopens with the package's/*! … */legal block (content from the source repository's licence matrix), each*.meta.jsonbytesentry is measured on the final bytes, and there is nobuiltAttimestamp —bun run gen:bundlesis byte-deterministic; the fixedsign.js(no hard-coded/Root 1 0 Rtrailer; whole-token/ByteRangegap) ships in every-rwbundle. /ByteRangegap: the signer emits the whole<…>token; the verifier accepts exactly two forms.pdfSign.sign(the/Sig, and the LTA/DocTimeStampthrough the same emitter) now leaves the whole/Contents <…>token out of the signed ranges, delimiters included — ISO 32000-2 §12.8.3.3.1 requires the string to "fit precisely in the space between the ranges", and PDFBox and pyHanko emit and check that form (b). It previously left out the hex digits only (form a).computeByteRangetakes the token span as an optional fourth argument (opts.token, new codepdf/sig/byterange/bad-token); its three-argument call is unchanged.auditByteRangeaccepts a gap that is exactly the token or exactly the digits, and reports which in the additivegapFormfield ('token' | 'digits' | null); before, it accepted the token only and flaggedpdfSign's own output.verifySignature/verifyAllSignaturesnow apply that rule to every/Sig: any other gap givesverified: falsewithgap-start-mismatch/gap-end-mismatchinerrors. This is a tightening — measured on 2026-09-23, the verify path had no gap check at all: a gap of<+ digits, or digits +>, re-signed over its own ranges verifiedtrue; both are now refused. Signatures written in form (a) — every signed PDF committed in the repo — are not re-signed and keep verifying./DocTimeStamp/ByteRangegap check.verifyAllSignaturesapplies the same rule to every/DocTimeStamp: a gap that is not exactly the<…>token or exactly the hex digits givesverified: falsewithgap-start-mismatch/gap-end-mismatchinerrors(imprintVerifiedstill reports the imprint alone), and eachtimestamps[]entry gains the additivegapFormfield ('token' | 'digits' | null, present on every entry). A tightening: an off-by-one DocTimeStamp gap re-stamped over its own ranges verifiedtruebefore.- Package contents — the npm tarball ships
NOTICE(dual licence + trademark notice, commercial-licence contact) next toLICENSE; the pre-publication checklist no longer ships. Packagedescriptioncorrected: the shipped signature surface covers PKCS#7/PAdES sign and verify. main.jsrestructured as a declarative manifest — no runtime bootstrap, no re-export of resolved instances, no import of built bundles. Exportsfw_require(the@awacloud/fwfactories consumed by fw-bound modules, completed with every provider's transitive deps, e.g.zlib→deflate→bitstream/huffman,pem→b64,rsa/ecc→bn/random/hex/hmac),pkg_require(cross-package bridge re-exporting@awacloud/fonts' ownfw_require+modulesplus 4 internalembed-pdf/subsetForPdf/*helper descriptors it doesn't itself export, sopdfFontEmbed's full dependency graph resolves through a bare@awacloud/pdfregistration),modules(the core factories, topologically ordered),extras(opt-in),bundle(3 descriptors). Everymodulesdescriptor is additionally re-exported by binding name so a sibling composer (e.g.@awacloud/oconv,@awacloud/facturx) can resolve any pdf dependency through the bare@awacloud/pdfspecifier — purely additive, the five arrays stay byte-unchanged; theextrasandbundledescriptors are not re-exported by name.tools/generate-bundles.mjsis a thin wrapper over@awacloud/tool-prebuild-generator(see Added — two-surfacedist/).- Factory-only strict — the five error classes
(
PdfError/ParseError/RenderError/ContractError/EncryptionError) are declared insidepdfErrors's factory body; every consumer declares'pdfErrors'as a dependency and destructures the classes from the injectederrorsparameter instead of a top-levelimport { ParseError } from '../errors.js'. EachpdfErrors.factory()call therefore creates its own classes; aModuleRuntimecaches the resolved instance, so the modules of one runtime share them. The transitional ESM compatibility shim that temporarily re-exported the five classes as named bindings is fully retired (see Removed).pdfSigOidslikewise moved its 8 top-levelexport const/export functionOID tables into its factory body, withsignature.js/timestamp.js/certChain.jsreceiving them via DI. Across the refactor, every factory in the package is worker-safe: module-level constants/helpers a factory body referenced are relocated or inlined into that factory, sofactory.toString()rehydrates in a Web Worker without resolving an external module symbol (pinned bytests/roundtrip.integration.test.js's worker-safety assertion over every registered factory). - Bundles simplified to pure fw descriptors —
pdfLargeBundle/pdfFullBundle/pdfLegacyBundleare{ name, dependencies, factory }descriptors whose factory wires each resolved extra into the corepdfvia.use({ name, register })and returns the enriched instance; consumption is exclusivelyModuleRuntime.resolve(...)(see Removed for the retired imperative builders). verifySignature(...)result shape (breaking) — carriesverified,valid(alias, mirrorsverified),pkVerified,computedDigest, in place of the earlier structural-only{ valid: errors.length === 0, errors, signerCerts, hashAlg, signatureAlg }. See Security for the vulnerability this closes.pdfSignature.dependenciesgained'bitArray'.- Error codes namespaced by origin — granular kebab-case codes
(
pdf/flate/bad-predictor,pdf/sig/byterange/*,pdf/parser/*, …) replace earlier placeholder-style codes; every raised error carries a structuredcontext.pdf/ts/parseandpdf/ts/parse-failedrecords keep the underlying error ascause; apdf/sig/digest-failedrecord is{ code, message }, with the underlying error's message appended tomessage. - Hash streaming for
/ByteRange—verifySignatureuseshashMod.fn+update/finalizewhenbitArrayis available, avoiding anO(document size)intermediate buffer allocation; falls back tohashMod.hash(...)otherwise. standardV6scratch buffer — the hardening loop (Algorithm 2.B) reuses a scratch buffer for AES-128 key scheduling instead of allocating per round.- Packaging —
awa.maturityprogressedL0→L1→L2→L3→L4;package.jsoncarriesdescription,keywords,engines,sideEffects: false, and the legal and project metadata (licenseAGPL-3.0-only,author,repository,bugs,homepage);LICENSEandNOTICEship in the tarball. sign()documentation. Thesign()JSDoc lists every option the body reads.- Ed25519 viewer support documented. Adobe Acrobat Reader does not validate Ed25519 (EdDSA) signatures, including OpenSSL-produced ones; OpenSSL 3.5 and later verify them. The PAdES guide recommends ECDSA P-256 where Acrobat must validate the signature, and its algorithm claim row carries that caveat.
Deprecated
validon signature verification results. Thevalidfield ofverifySignature/verifyAllSignaturesresults (signatures and document timestamps) is deprecated: readverified. It carries the same value and is kept for compatibility.
Fixed
-
Identity crypt filters on V=5 mean no encryption. On V=5 (R=5 and R=6) files, a
/StmF,/StrFor/EFFnamedIdentity, or absent, now resolves toIdentity: those strings and streams are left as they are instead of being decrypted as AES-256, andsign()no longer encrypts its new strings on such files. -
The PAdES guide's external-TSA example runs. The
tsaSignexample is executed by the test suite, and the guide's verification-report sample shows SHA-512 for Ed25519. -
Source comments match the code. The comments of the legacy-filters extra, the writer, the filter dispatcher, the legacy bundle,
pdfSharedand the font-embed adapter describe the current behaviour: CCITT decoder delegation, header bytes, the dispatch map, no conversion on write, and the codec helpers. -
Documentation links resolve from the npm tarball. Links that pointed outside the package now point at the public repository at this release's tag, so they resolve from the tarball; references to sources that are not published are plain-text citations.
-
readDocumentopens PDF 1.5+ cross-reference streams and object streams. The top-level reader now picks a cross-reference form per section: anxrefkeyword takes the classical table path, anything else is parsed as a/Type /XRefstream (§7.5.8). Mixed/Prevchains (a classical incremental section over an xref-stream base, or the reverse) and hybrid-reference files (a classical trailer carrying/XRefStm) resolve end to end, and objects held in a/Type /ObjStmcontainer (§7.5.7) are materialised on demand bydoc._raw.resolve, each container decoded once per document.xref.sections[i]gainskind('table' | 'stream') and an indirect materialised from a container carriesobjStm; the publicreadDocumentsignature and return shape are otherwise unchanged. -
/DecodeParmsreach the decoders as plain values. Filter dispatch now marshals the typed dictionary (or array of dictionaries) into plain parameters, so a/Predictor(e.g. PNG predictor 12 on cross-reference streams) is actually applied instead of silently skipped. -
readDocumentsurvives two real-world shapes./Rootis resolved across a chain of cross-reference streams whose sections carry it in different trailers (merged newest first), and a non-catalog object marked free but still referenced degrades to a recorded loss instead of a throw; the returned document gains alossesarray for these. A document whose catalog itself is free is still refused. -
Indirect page resources are resolved.
typeResources/resolvePageResourcesaccept an optionalresolveRef, so a page whose/ExtGState(or another resource category) is an indirect reference no longer drops the whole resource map, fonts included. -
appendIncrementalextends cross-reference-stream bases with an uncompressed/Type /XRefsection carrying/Prevand/Root; the classical-table path is byte-unchanged. A hybrid-reference base (a classical trailer with/XRefStm) is refused withpdf/incremental/hybrid-base, and astartxrefthat designates neither form withpdf/incremental/unsupported-base.pdfXrefgainsreadXrefStreamDictandbuildXrefStream. -
Signing over cross-reference-stream and object-stream bases now yields a document that re-reads.
pdfSign.sign()appends the signature (and the LTA DocTimeStamp) throughpdfIncrementalWriter, so the signature section follows the base's cross-reference form (table or stream) and carries/Root,/Infoand/IDfrom the merged trailer instead of a hard-coded/Root 1 0 R. The signature takes the first object number at or past the merged/Size, so it no longer overwrites an object held in an object stream. At LT/LTA the Catalog is resolved throughreadDocumentfrom/Root, whatever its number or container, instead of a byte scan for1 0 obj. A hybrid-reference base is refused withpdf/incremental/hybrid-base, and nothing is written.pdfIncrementalWritergainsappendIncrementalWithOffsetsandreadBaseTrailer, andappendIncremental's output is unchanged.pdfSigngains apdfDocumentdependency, appended last. It is required only at LT/LTA and reported aspdf/sign/no-document-reader. Every level now requirespdfIncrementalWriter. -
pdfSign.sign()registers the signature in a signature field. The/Sigupdate now also writes an invisible/FT /Sigfield merged with its widget (/T Signature<n>,/V,/Rect [0 0 0 0],/F 132,/Ppage 1), the page 1/Annotsentry and the Catalog/AcroForm(/Fields,/SigFlags 3), per ISO 32000-2 §12.7.5.5, so viewers list the signature. The LTA/DocTimeStampgets its own field.pdf/sign/no-document-readernow fires at every level, because the field needs the Catalog and page 1 — this supersedes the LT/LTA-only rule above. An encrypted base keeps the signature-only update (no field). -
assembleIndirectsreports the objects it could not resolve. Read-then-write no longer drops an unresolvable object without a trace: every skipped{ num, gen, code }is listed on the returned array's non-enumerableskippedObjectsproperty, andassembleIndirects(model, { strict: true })throws aRenderErrorcodedpdf/writer/unresolvable-objectswhosecontext.objectsis that list. The default stays lenient and the output for a fully resolvable model is unchanged. -
ECDSA signature value is DER. The ECDSA CMS signature value is now the DER
ECDSA-Sig-Value; the verifier accepts the DER form and the earlier raw r||s. -
Ed25519 signs over SHA-512. Ed25519 signatures use SHA-512 as RFC 8419 requires;
hashAlgdefaults tosha512for Ed25519 and any other value is refused (pdf/sign/ed25519-requires-sha512). -
One-byte
/ToUnicodecodespace for simple fonts.embedSimplewrites a one-byte/ToUnicodecodespace matching its WinAnsi codes. -
Update trailers repeat
/Encrypt. Incremental updates written bypdfIncrementalWriter/pdfXref.buildXrefStreamcan repeat the base's/Encrypt(opts.encrypt);sign()does so over encrypted bases. -
CMS signed attributes in DER order. CMS signed attributes are written in DER SET OF order, so verifiers that re-encode them (OpenSSL with Ed25519) accept the signature.
Removed
-
pdfParserStream, the stream-body helpers module. No module depended on it andpdfParsercarries its own helpers. It is no longer inmodulesand no longer a named export of@awacloud/pdf. -
The
prebuilt/bundle directory that used to sit undersrc/bundles/, andtools/generate-prebuilds.mjs/bun run gen:prebuilds— retired in favour of the two-surfacedist/build/+dist/standalone/convention (see Added). Exported factory names and resolve keys are unchanged; only the on-disk location and generator moved (tools/generate-bundles.mjs/bun run gen:bundles). -
Imperative bundle builders
buildPdfLarge,buildPdfFull,buildPdfLegacyand the constantsPDF_LARGE_EXTRAS,PDF_FULL_EXTRAS,PDF_LEGACY_EXTRAS— consumption is now exclusivelyModuleRuntime.resolve('pdfLargeBundle' | 'pdfFullBundle' | 'pdfLegacyBundle'); the extras list lives inbundleDescriptor.dependencies. -
Named re-exports of extras from the bundle entry points — import an extra from its canonical module (
@awacloud/pdf/extra/...), or register theextrasarray exported by@awacloud/pdf(the root entry does not re-export extras by name). -
Top-level error-class named exports (
PdfError,ParseError,RenderError,ContractError,EncryptionError) from@awacloud/pdf/@awacloud/pdf/errors, and the transitional ESM compatibility shim that temporarily preserved them during the factory-only migration. Consumers resolve viapdfErrors:import { pdfErrors } from '@awacloud/pdf'; const { PdfError, ParseError, isPdfError } = pdfErrors.factory();or
runtime.resolve('pdfErrors').
Security
- The encrypted writer uses cryptographic randomness only.
pdfEncryptedWriterno longer falls back toMath.randomfor keys, salts and IVs. It usesencrypt.randomByteswhen given, elsecrypto.getRandomValues; with neither it throws anEncryptionErrorwith codepdf/crypto/enc-writer/no-random. - Signature verification — end of the silent false-positive.
Before public-key wiring,
verifySignature(...)returnedvalid: errors.length === 0without ever invokingrsa.pssVerify/ecc.verify/ed25519.verify— a PKCS#7 structurally valid but cryptographically forged signature reportedvalid: trueto a naïve consumer.verified/validare nowtrueonly once the digest chain and PK-verify both succeed (see Changed). auditByteRange(...)(src/sig/byteRange.js) — public helper detecting six/ByteRangeattack vectors:self-overlap,gap-start-mismatch,gap-end-mismatch,cross-overlap,incomplete-coverage(opt-inrequireFullCoverage),non-zero-start. Exposed viaruntime.resolve('pdfByteRange').- Sandboxed action flag — every typer for
/Launch,/JavaScript,/SubmitForm,/ImportData,/URIaddssandboxed: trueto its returned record, alongside the existingsecurityWarning, so a naïve consumer can't mistake a typed action record for an execution instruction. The opt-inpdfSandboxmodule (pdf-fullbundle) additionally exposeslintActions([...])→{ hasErrors, hasActiveContent, issues }. - Parser hardening — see Added (
parserLimits): depth cap, array literal cap, stream fallback-scan quota, each raising a typedpdf/parser/*error. - Encryption — Standard Security Handler V4/V5/V6 decrypt + encrypt
(AES-128/256-CBC, and RC4-128 through the V4 handler's
V2crypt filter), AES-GCM (TS 32003) decrypt + encrypt. The older RC4 revisions (40-bit R2, 128-bit R3) are read-only, through the opt-inlegacy-rc4-readextra of thepdf-legacybundle.