#[non_exhaustive]pub enum WarningCode {
Show 89 variants
MissingHeader,
XrefRepaired,
XrefstmIgnored,
StreamLengthRecovered,
DictionaryKeySkipped,
StaleGeneration,
PageTreeNodeSkipped,
PageCountMismatch,
FlateTruncated,
FilterCharactersSkipped,
ObjstmIndexMismatch,
ObjectNumberOutOfRange,
AesPaddingInvalid,
PermsMismatch,
WarningsTruncated,
InvalidBox,
InvalidRotate,
NameTreeNodeSkipped,
OutlineCycle,
OutlineItemSkipped,
InvalidDate,
XmpInvalid,
AnnotNameDuplicate,
XmpRepaired,
InvalidPageLabel,
InvalidEntry,
ContentUnknownOperator,
ContentBadOperands,
ContentUnbalancedQ,
ContentUnbalancedBt,
ContentUnbalancedMarked,
ContentSyntax,
ContentResourceMissing,
InlineImageUnterminated,
XobjectCycle,
ContentPathUnpainted,
FontInvalid,
CmapInvalid,
UnmappedGlyph,
ExtractLimitBlocks,
ExtractReadingOrderAmbiguous,
ExtractTableAmbiguous,
ExtractTableLimit,
ExtractStructTreeIgnored,
ExtractUntaggedContent,
ExtractNeedsOcr,
ExtractColumnOrderUncertain,
PdfaOneAuthor,
PdfuaTitleMissing,
PdfaInfoMismatch,
DuplicateTagsIncomplete,
ImportedTagsDropped,
ImportedPdfaUnchecked,
ImportedPdfuaUnchecked,
AnnotWithoutContents,
AnnotNotTagged,
FieldLabelMissing,
PdfaAnnotFlags,
PdfaTransparency,
PdfaFontNotEmbedded,
FlattenUntagged,
FigureWithoutAlt,
ContentTagsBroken,
PdfaAttachmentForbidden,
PdfaAttachmentIncomplete,
PdfaColorSpace,
PdfaOptionalContent,
FieldFormattingRemoved,
XfaOnlyContentRemoved,
ConformanceClaimRemoved,
RedactionMarksKept,
HiddenContentKept,
TounicodeConflict,
WholeFontRebuilt,
FlowKeepBroken,
MarkdownHtmlIgnored,
MarkdownImageMissing,
InterchangeSkipped,
InterchangeDocumentMismatch,
CoveredText,
RedactionNotApplied,
TextInEarlierRevision,
RichTextSimplified,
FlattenNoAppearance,
AttachmentStillHeld,
XfaRemoved,
FieldNameStillUsed,
FieldScriptReplaced,
SummaryPageNotDrawn,
}Expand description
Every warning code, in codes.json order.
Added in 0.2.0.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingHeader
missing-header: no %PDF-x.y header in the first 1,024 bytes; parsing went ahead.
XrefRepaired
xref-repaired: the stored cross-reference data was unusable and was rebuilt by scanning.
XrefstmIgnored
xrefstm-ignored: a hybrid file’s /XRefStm could not be read and was ignored.
StreamLengthRecovered
stream-length-recovered: a stream’s /Length was wrong, so its end was found by scanning for endstream.
DictionaryKeySkipped
dictionary-key-skipped: a dictionary had something other than a name where a key belongs, and it was skipped.
StaleGeneration
stale-generation: a reference’s generation did not match its xref entry, so it resolved to null.
PageTreeNodeSkipped
page-tree-node-skipped: a page-tree node was missing, malformed or too deep, and was skipped.
PageCountMismatch
page-count-mismatch: the page tree’s /Count differs from the number of pages walked.
FlateTruncated
flate-truncated: Flate data was truncated or had a bad checksum; the partial output was kept.
FilterCharactersSkipped
filter-characters-skipped: ASCIIHex or ASCII85 data held characters outside the filter’s alphabet; they were skipped.
ObjstmIndexMismatch
objstm-index-mismatch: an object stream’s index was stale and the object was found by searching.
ObjectNumberOutOfRange
object-number-out-of-range: an xref entry above max_object_number was dropped.
AesPaddingInvalid
aes-padding-invalid: AES-encrypted data had a bad length or padding and was kept as stored.
PermsMismatch
perms-mismatch: an R5/R6 document’s /Perms does not match its /P and /EncryptMetadata.
WarningsTruncated
warnings-truncated: more than max_warnings warnings were raised and the rest were dropped.
InvalidBox
invalid-box: a page boundary box is not four numbers and reads as absent.
InvalidRotate
invalid-rotate: a page’s /Rotate is not a multiple of 90 and reads as 0.
NameTreeNodeSkipped
name-tree-node-skipped: a name- or number-tree node was malformed, repeated or too deep, and was skipped.
OutlineCycle
outline-cycle: an outline item was reached twice; that branch of the walk stopped.
OutlineItemSkipped
outline-item-skipped: an outline item was missing, not a dictionary or too deep, and was skipped with its subtree.
InvalidDate
invalid-date: an Info date is not a valid PDF date; the raw string is kept.
XmpInvalid
xmp-invalid: the XMP metadata packet is not readable XMP and reads as absent.
AnnotNameDuplicate
annot-name-duplicate: two annotations on one page have the same name (/NM), which should be unique on its page.
XmpRepaired
xmp-repaired: the XMP metadata packet had damage other readers read past, and was read the same way.
InvalidPageLabel
invalid-page-label: a /PageLabels entry is malformed; the malformed part is dropped.
InvalidEntry
invalid-entry: an entry a view reads is unreadable or of the wrong type and reads as absent.
ContentUnknownOperator
content-unknown-operator: an operator the spec does not define was skipped outside a BX/EX section.
ContentBadOperands
content-bad-operands: an operator had too few operands or operands of the wrong type, or extra ones.
ContentUnbalancedQ
content-unbalanced-q: a Q without a matching q was ignored, or saved graphics states were left open.
ContentUnbalancedBt
content-unbalanced-bt: a text object was opened twice, closed outside one, or left open.
ContentUnbalancedMarked
content-unbalanced-marked: an EMC without a matching BMC or BDC was ignored, or marked content was left open.
ContentSyntax
content-syntax: content-stream bytes that are not a token were skipped.
ContentResourceMissing
content-resource-missing: an operator named a resource that is missing, of the wrong type or unreadable.
InlineImageUnterminated
inline-image-unterminated: no EI ends an inline image; the rest of the content was skipped.
XobjectCycle
xobject-cycle: a Form XObject draws itself, directly or through other forms.
ContentPathUnpainted
content-path-unpainted: a content stream ended with a path no painting operator ended.
FontInvalid
font-invalid: a font dictionary has a missing or malformed entry, so its text was decoded with defaults.
CmapInvalid
cmap-invalid: a font’s CMap or ToUnicode CMap is malformed or names a predefined CMap Lamina PDF has no table for.
UnmappedGlyph
unmapped-glyph: a font shows glyphs that nothing maps to text.
ExtractLimitBlocks
extract-limit-blocks: a page had more runs of text than the extraction block limit; the runs past it were left out.
ExtractReadingOrderAmbiguous
extract-reading-order-ambiguous: a page mixes horizontal and vertical writing, so the order of its blocks is a guess.
ExtractTableAmbiguous
extract-table-ambiguous: a table’s rules marked out merged cells that aren’t rectangles, so its cells were kept unmerged.
ExtractTableLimit
extract-table-limit: a page’s ruling lines would make a table bigger than the extraction’s cell limit; those lines gave no table.
ExtractStructTreeIgnored
extract-struct-tree-ignored: a tagged page’s structure tree covered too little of its text, or its order jumped back across columns too often, so the layout gave the reading order.
ExtractUntaggedContent
extract-untagged-content: a page read in structure-tree order has visible text that is neither in the tree nor an artifact; it follows the tree’s blocks, in layout order.
ExtractNeedsOcr
extract-needs-ocr: a page has no usable text layer: it is an image (with or without an invisible OCR layer), outlined glyphs, or glyphs without Unicode, so its extracted text is empty or unreliable.
ExtractColumnOrderUncertain
extract-column-order-uncertain: the layout rules had to guess how a page’s columns are read, so its blocks may be in the wrong order; the blocks concerned have a lower confidence.
PdfaOneAuthor
pdfa-one-author: the file claims PDF/A-1, which allows one author, and its metadata lists more.
PdfuaTitleMissing
pdfua-title-missing: the file claims PDF/UA-1, which requires a title in its metadata, and it has none.
PdfaInfoMismatch
pdfa-info-mismatch: the file claims PDF/A, which requires the Info dictionary and the XMP packet to agree, and they differ.
DuplicateTagsIncomplete
duplicate-tags-incomplete: a duplicated page’s content is partly untagged, which breaks the PDF/UA claim of the document’s metadata.
ImportedTagsDropped
imported-tags-dropped: pages copied in from another document came without their tags, which breaks the PDF/UA claim of the document’s metadata.
ImportedPdfaUnchecked
imported-pdfa-unchecked: pages copied in from a document that doesn’t claim the same PDF/A level may break the PDF/A claim of the document’s metadata.
ImportedPdfuaUnchecked
imported-pdfua-unchecked: pages copied in from a document that doesn’t claim PDF/UA-1 may break the PDF/UA claim of the document’s metadata.
AnnotWithoutContents
annot-without-contents: a new or changed annotation has no description, which breaks the document’s PDF/UA claim.
AnnotNotTagged
annot-not-tagged: a new annotation isn’t in the structure tree, which breaks the document’s PDF/UA claim.
FieldLabelMissing
field-label-missing: a new form field has no label for screen readers, which breaks the document’s PDF/UA claim.
PdfaAnnotFlags
pdfa-annot-flags: an annotation doesn’t print or is hidden, which breaks the document’s PDF/A claim.
PdfaTransparency
pdfa-transparency: an annotation, or an object added to a page, is translucent or blends, or is an image with an alpha channel, which PDF/A-1 forbids.
PdfaFontNotEmbedded
pdfa-font-not-embedded: the file claims PDF/A, and an edited annotation or page uses a font that isn’t embedded, such as a text box in a standard 14 font.
FlattenUntagged
flatten-untagged: the file claims PDF/UA-1, and flattening took comments or form fields out of the structure tree: their text is no longer read out.
FigureWithoutAlt
figure-without-alt: the file claims PDF/UA, and an edit replaced a figure’s image: the figure’s alternative text described the old image and was removed.
ContentTagsBroken
content-tags-broken: the file claims PDF/UA, and edited pages draw content their tags don’t cover, often because the file’s tags were already incomplete.
PdfaAttachmentForbidden
pdfa-attachment-forbidden: the file claims PDF/A-1 or PDF/A-2, which allow no attached files but PDF/A ones, and the edits attached a file.
PdfaAttachmentIncomplete
pdfa-attachment-incomplete: the file claims PDF/A-3, and an attached file lacks an association with the document, a page or an annotation, a modification date or a MIME type.
PdfaColorSpace
pdfa-color-space: the file claims PDF/A, and something the edits added paints in a device colour space its output intent doesn’t allow, such as a CMYK photo in a file with an RGB intent.
PdfaOptionalContent
pdfa-optional-content: the file claims PDF/A-1, and a watermark or background the edits added is in an optional content group, which PDF/A-1 forbids.
FieldFormattingRemoved
field-formatting-removed: a sanitise removed form fields’ format and keystroke scripts with the rest of the active content, so their values no longer format as typed.
XfaOnlyContentRemoved
xfa-only-content-removed: a sanitise removed an XFA form that had no AcroForm fields to fall back on, so the form no longer shows as it did.
ConformanceClaimRemoved
conformance-claim-removed: a sanitise removed the XMP metadata and with it the file’s PDF/A or PDF/UA claim.
RedactionMarksKept
redaction-marks-kept: a sanitise kept redaction marks that were never applied, so the text under them is still in the file.
HiddenContentKept
hidden-content-kept: a sanitise left hidden content in place: this build edits no page content, so it couldn’t remove layers that are off, content outside the page or hidden text.
TounicodeConflict
tounicode-conflict: one glyph was used for two different texts; ToUnicode keeps the first.
WholeFontRebuilt
whole-font-rebuilt: a font that forbids subsetting was rebuilt with every glyph kept.
FlowKeepBroken
flow-keep-broken: blocks kept together are taller than a page, so the flow split them.
MarkdownHtmlIgnored
markdown-html-ignored: the Markdown holds raw HTML, which the PDF leaves out.
MarkdownImageMissing
markdown-image-missing: the Markdown names an image that wasn’t supplied, so the PDF leaves it out.
InterchangeSkipped
interchange-skipped: the import leaves out a comment or field it can’t make: a sound, a link, a form field’s value, a comment for a page the document doesn’t have, or a reply to a missing comment.
InterchangeDocumentMismatch
interchange-document-mismatch: the exchange file was made for another PDF (its /ID or file name differs), so its comments may land in the wrong places.
CoveredText
covered-text: a page draws text and then paints a shape, an image or an annotation over it, so the text is hidden but still in the file.
RedactionNotApplied
redaction-not-applied: a page has redaction marks that were never applied, so the text under them is still in the file.
TextInEarlierRevision
text-in-earlier-revision: an earlier revision of the file holds text that the latest revision no longer has.
RichTextSimplified
rich-text-simplified: an edit changed a text box whose rich text had styles Lamina PDF doesn’t keep, such as a size or colour per word, so the box now has one size and colour.
FlattenNoAppearance
flatten-no-appearance: flattening left some annotations in place: they have no appearance, and Lamina PDF can’t draw one for their kind.
AttachmentStillHeld
attachment-still-held: a deleted attachment stays in the document because a file attachment annotation still holds it.
XfaRemoved
xfa-removed: flattening removed the form’s XFA part, so apps that read XFA forms show the fields that are left as a plain PDF form.
FieldNameStillUsed
field-name-still-used: a deleted or renamed form field’s name, or a split field’s object, is still used: a button’s or a signed field’s lock list names it, or a calculation reads it; or a list names a group the renamed field left.
FieldScriptReplaced
field-script-replaced: a field’s format, validation or calculation script that isn’t one of Acrobat’s helper calls was replaced by the helper call written.
SummaryPageNotDrawn
summary-page-not-drawn: a comment summary lists a page’s comments without drawing the page, because the page uses a font the file doesn’t embed, which PDF/UA-1 forbids, has content Lamina PDF can’t read to its end, or belongs to a protected file whose open password forbids copying.
Implementations§
Source§impl WarningCode
impl WarningCode
Sourcepub const fn from_code(code: &str) -> Option<Self>
pub const fn from_code(code: &str) -> Option<Self>
The code with this name, if there is one.
Added in 0.2.0.
Sourcepub const fn summary(self) -> &'static str
pub const fn summary(self) -> &'static str
One lowercase sentence: what happened.
Added in 0.2.0.