#[non_exhaustive]pub enum WarningCode {
Show 55 variants
MissingHeader,
XrefRepaired,
XrefstmIgnored,
StreamLengthRecovered,
StaleGeneration,
PageTreeNodeSkipped,
PageCountMismatch,
FlateTruncated,
ObjstmIndexMismatch,
ObjectNumberOutOfRange,
AesPaddingInvalid,
PermsMismatch,
WarningsTruncated,
InvalidBox,
InvalidRotate,
NameTreeNodeSkipped,
OutlineCycle,
OutlineItemSkipped,
InvalidDate,
XmpInvalid,
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,
TounicodeConflict,
WholeFontRebuilt,
FlowKeepBroken,
MarkdownHtmlIgnored,
MarkdownImageMissing,
CoveredText,
RedactionNotApplied,
TextInEarlierRevision,
}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.
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.
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.
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.
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.
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.
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.