Skip to main content

WarningCode

Enum WarningCode 

Source
#[non_exhaustive]
pub enum WarningCode {
Show 59 variants MissingHeader, XrefRepaired, XrefstmIgnored, StreamLengthRecovered, StaleGeneration, PageTreeNodeSkipped, PageCountMismatch, FlateTruncated, 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, 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

§

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.

§

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

Source

pub const ALL: &'static [Self]

Every variant, in codes.json order.

Added in 0.2.0.

Source

pub const fn from_code(code: &str) -> Option<Self>

The code with this name, if there is one.

Added in 0.2.0.

Source

pub const fn as_str(self) -> &'static str

The kebab-case code.

Added in 0.2.0.

Source

pub const fn kind(self) -> ErrorKind

The kind (ADR 0026 §2).

Added in 0.2.0.

Source

pub const fn summary(self) -> &'static str

One lowercase sentence: what happened.

Added in 0.2.0.

Source

pub const fn hint(self) -> &'static str

The hint (ADR 0026 §5), with its {limit}/{option} parameters unfilled.

Added in 0.2.0.

Source

pub fn docs_url(self) -> String

The code’s explain page (docsUrl, ADR 0026 §6).

Added in 0.2.0.

Trait Implementations§

Source§

impl Clone for WarningCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WarningCode

Source§

impl Debug for WarningCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WarningCode

Source§

impl Hash for WarningCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for WarningCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WarningCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.