Package org.apache.tika.parser.pages
Class PagesConfig
java.lang.Object
org.apache.tika.parser.pages.PagesConfig
- All Implemented Interfaces:
Serializable
What a parser does with a document's pages when the document has to be rendered to get
pixels: how it renders (
render), where a page's text comes from (text), the
recognizer budget and verdict (ocr), what is released to inference bindings
(inference), and whether renders are emitted as embedded documents (emit).
One block for every rendering parser; the PDF parser and the EMF/WMF parsers read it.
Every field is nullable so an instance can be an overlay, and the same class is read at four
layers, later ones winning per field: the config's "parse-context": {"pages": ...},
a request's "pages" (which replaces the config's, as every parse-context key does),
a parser's own "pages" under "parsers", and that parser's "pages" in
the request. resolve(org.apache.tika.parser.ParseContext, org.apache.tika.parser.pages.PagesConfig...) folds them onto defaults().
- Since:
- Apache Tika 4.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWhenTextPolicy.AUTOsends a page to OCR: too few characters, or too many glyphs without a Unicode mapping.static classWhether, and for which documents, renders are emitted as RENDERING embedded documents.static classThe recognizer side oftext: how many pages may be OCR'd, how AUTO decides. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PagesConfigdefaults()Every field set: default render, AUTO, no OCR budget, TEXT released, nothing emitted.emit()The emit overlay, created if unset:pages.emit().setEnabled(true).booleanWhether emitted renders are the same image as the render OCR and inference see.The settings emitted renders use:renderwithemit.renderapplied.getEmit()getOcr()getText()ocr()The OCR overlay, created if unset.over(PagesConfig overlay) A copy of this with every set field ofoverlayapplied; null overlay is this.render()The render overlay, created if unset:pages.render().setDpi(96).static PagesConfigresolve(ParseContext context, PagesConfig... overlays) The effective block for a parse:defaults(), the context's"pages"(JSON, or aPagesConfigset on the context by class), then each overlay in order.voidsetEmit(PagesConfig.Emit emit) voidsetInference(List<InputKind> inference) TEXT,PAGES, or both; what the parser releases to inference bindings.voidsetOcr(PagesConfig.Ocr ocr) voidsetRender(RenderSettings render) voidsetText(TextPolicy text)
-
Field Details
-
KEY
- See Also:
-
-
Constructor Details
-
PagesConfig
public PagesConfig()
-
-
Method Details
-
defaults
Every field set: default render, AUTO, no OCR budget, TEXT released, nothing emitted. -
resolve
public static PagesConfig resolve(ParseContext context, PagesConfig... overlays) throws TikaConfigException, IOException The effective block for a parse:defaults(), the context's"pages"(JSON, or aPagesConfigset on the context by class), then each overlay in order.- Throws:
TikaConfigExceptionIOException
-
over
A copy of this with every set field ofoverlayapplied; null overlay is this. -
emittedRender
The settings emitted renders use:renderwithemit.renderapplied. -
emitsSameImage
public boolean emitsSameImage()Whether emitted renders are the same image as the render OCR and inference see. -
getRender
-
setRender
-
render
The render overlay, created if unset:pages.render().setDpi(96). -
getText
-
setText
-
getOcr
-
setOcr
-
ocr
The OCR overlay, created if unset. -
getInference
-
setInference
TEXT,PAGES, or both; what the parser releases to inference bindings. -
getEmit
-
setEmit
-
emit
The emit overlay, created if unset:pages.emit().setEnabled(true).
-