Package com.datalogics.PDFL
Class WordFinderConfig
java.lang.Object
com.datalogics.PDFL.WordFinderConfig
A word finder configuration that customizes the way the extraction is performed. In the default configuration, all options are false.
-
Constructor Summary
ConstructorsConstructorDescriptionA word finder configuration that customizes the way the extraction is performed. In the default configuration, all options are false. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()booleanWhen true, it disables reconstructing the character orders, and the word finding algorithm is applied to the characters in the drawing order.booleanWhen true, it disables tagged PDF support and treats the document as non-tagged PDF.booleanWhen true, it disables converting large character gaps to space characters, so that the word finder reports a character space only when a space character appears in the original PDF content.booleanWhen true, it disables treating vertical movements as line breaks, so that the word finder determines a line break only when a line break character or special tag information appears in the original PDF content.booleanWhen true, it disables extracting text from text annotations.booleanWhen true, it disables guessing encoding of fonts that have unknown or custom encoding when there is no ToUnicode table.booleanWhen true, it disables generating extended character offset information to improve text extraction performance.booleanWhen true, it disables finding and removing soft hyphens in non-tagged PDF, so that the word finder trusts hard hyphens as non-soft hyphens.booleanWhen true, it disables the expansion of ligatures using the default ligatures.booleanWhen true, it disables the creation of a quad per character for skewed words, words with a horizontally-aligned, but non-rectangular, bounding region.booleanWhen true, it disables generating character style information to improve text extraction performance and memory efficiency.booleanWhen true, it disables extracting text with Text Rendering mode Tr = 3 ("Neither fill nor stroke text (invisible).").booleanWhen true, it disables generating an XY-ordered word list.booleanWhen true, the bounding box or bounding quad will be set based on actual glyph bounding box.booleanWhen true, it disables detecting and removing redundant characters.booleanWhen true, the word finder preserves space characters during word breaking.booleanWhen true, it disables treating non-breaking space characters as regular space characters in non-tagged PDF files, so that the word finder preserves the space without breaking the word.booleanWhen true, it assumes any font with unknown or custom encoding to be Standard Roman.voidsetDisableCharReordering(boolean value) When true, it disables reconstructing the character orders, and the word finding algorithm is applied to the characters in the drawing order.voidsetDisableTaggedPDF(boolean value) When true, it disables tagged PDF support and treats the document as non-tagged PDF.voidsetIgnoreCharGaps(boolean value) When true, it disables converting large character gaps to space characters, so that the word finder reports a character space only when a space character appears in the original PDF content.voidsetIgnoreLineGaps(boolean value) When true, it disables treating vertical movements as line breaks, so that the word finder determines a line break only when a line break character or special tag information appears in the original PDF content.voidsetNoAnnots(boolean value) When true, it disables extracting text from text annotations.voidsetNoEncodingGuess(boolean value) When true, it disables guessing encoding of fonts that have unknown or custom encoding when there is no ToUnicode table.voidsetNoExtCharOffset(boolean value) When true, it disables generating extended character offset information to improve text extraction performance.voidsetNoHyphenDetection(boolean value) When true, it disables finding and removing soft hyphens in non-tagged PDF, so that the word finder trusts hard hyphens as non-soft hyphens.voidsetNoLigatureExp(boolean value) When true, it disables the expansion of ligatures using the default ligatures.voidsetNoSkewedQuads(boolean value) When true, it disables the creation of a quad per character for skewed words, words with a horizontally-aligned, but non-rectangular, bounding region.voidsetNoStyleInfo(boolean value) When true, it disables generating character style information to improve text extraction performance and memory efficiency.voidsetNoTextRenderMode3(boolean value) When true, it disables extracting text with Text Rendering mode Tr = 3 ("Neither fill nor stroke text (invisible).").voidsetNoXYSort(boolean value) When true, it disables generating an XY-ordered word list.voidsetPreciseQuad(boolean value) When true, the bounding box or bounding quad will be set based on actual glyph bounding box.voidsetPreserveRedundantChars(boolean value) When true, it disables detecting and removing redundant characters.voidsetPreserveSpaces(boolean value) When true, the word finder preserves space characters during word breaking.voidsetTrustNBSpace(boolean value) When true, it disables treating non-breaking space characters as regular space characters in non-tagged PDF files, so that the word finder preserves the space without breaking the word.voidsetUnknownToStdEnc(boolean value) When true, it assumes any font with unknown or custom encoding to be Standard Roman.
-
Constructor Details
-
WordFinderConfig
public WordFinderConfig()A word finder configuration that customizes the way the extraction is performed. In the default configuration, all options are false.
-
-
Method Details
-
delete
public void delete() -
setDisableTaggedPDF
public void setDisableTaggedPDF(boolean value) When true, it disables tagged PDF support and treats the document as non-tagged PDF. Use this to keep the word finder in legacy mode when it is created with the latest algorithm version. -
getDisableTaggedPDF
public boolean getDisableTaggedPDF()When true, it disables tagged PDF support and treats the document as non-tagged PDF. Use this to keep the word finder in legacy mode when it is created with the latest algorithm version. -
setNoXYSort
public void setNoXYSort(boolean value) When true, it disables generating an XY-ordered word list. -
getNoXYSort
public boolean getNoXYSort()When true, it disables generating an XY-ordered word list. -
setPreserveSpaces
public void setPreserveSpaces(boolean value) When true, the word finder preserves space characters during word breaking. Otherwise, spaces are removed from output text. When false (the default), you can add spaces later by considering the WordAttributeFlags::AdjacentToSpace attribute, but there is no way to restore the exact number of consecutive space characters. -
getPreserveSpaces
public boolean getPreserveSpaces()When true, the word finder preserves space characters during word breaking. Otherwise, spaces are removed from output text. When false (the default), you can add spaces later by considering the WordAttributeFlags::AdjacentToSpace attribute, but there is no way to restore the exact number of consecutive space characters. -
setNoLigatureExp
public void setNoLigatureExp(boolean value) When true, it disables the expansion of ligatures using the default ligatures. The default ligatures are:-
fi
-
ff
-
fl
-
ffi
-
ffl
-
ch
-
cl
-
ct
-
ll
-
ss
-
fs
-
st
-
oe
-
OE
-
-
getNoLigatureExp
public boolean getNoLigatureExp()When true, it disables the expansion of ligatures using the default ligatures. The default ligatures are:-
fi
-
ff
-
fl
-
ffi
-
ffl
-
ch
-
cl
-
ct
-
ll
-
ss
-
fs
-
st
-
oe
-
OE
-
-
setNoEncodingGuess
public void setNoEncodingGuess(boolean value) When true, it disables guessing encoding of fonts that have unknown or custom encoding when there is no ToUnicode table. Inappropriate encoding conversions can cause the word finder to mistakenly recognize non-Roman single-byte fonts as Standard Roman encoding fonts and extract the text in an unusable format. When this option is selected, the word finder avoids such unreliable encoding conversions and tries to provide the original characters without any encoding conversion for a client with its own encoding handling. -
getNoEncodingGuess
public boolean getNoEncodingGuess()When true, it disables guessing encoding of fonts that have unknown or custom encoding when there is no ToUnicode table. Inappropriate encoding conversions can cause the word finder to mistakenly recognize non-Roman single-byte fonts as Standard Roman encoding fonts and extract the text in an unusable format. When this option is selected, the word finder avoids such unreliable encoding conversions and tries to provide the original characters without any encoding conversion for a client with its own encoding handling. -
setUnknownToStdEnc
public void setUnknownToStdEnc(boolean value) When true, it assumes any font with unknown or custom encoding to be Standard Roman. This option overrides the noEncodingGuess option. -
getUnknownToStdEnc
public boolean getUnknownToStdEnc()When true, it assumes any font with unknown or custom encoding to be Standard Roman. This option overrides the noEncodingGuess option. -
setIgnoreCharGaps
public void setIgnoreCharGaps(boolean value) When true, it disables converting large character gaps to space characters, so that the word finder reports a character space only when a space character appears in the original PDF content. This option has no effect on tagged PDF. -
getIgnoreCharGaps
public boolean getIgnoreCharGaps()When true, it disables converting large character gaps to space characters, so that the word finder reports a character space only when a space character appears in the original PDF content. This option has no effect on tagged PDF. -
setIgnoreLineGaps
public void setIgnoreLineGaps(boolean value) When true, it disables treating vertical movements as line breaks, so that the word finder determines a line break only when a line break character or special tag information appears in the original PDF content. This option has no effect on tagged PDF. -
getIgnoreLineGaps
public boolean getIgnoreLineGaps()When true, it disables treating vertical movements as line breaks, so that the word finder determines a line break only when a line break character or special tag information appears in the original PDF content. This option has no effect on tagged PDF. -
setNoAnnots
public void setNoAnnots(boolean value) When true, it disables extracting text from text annotations. Normally, the word finder extracts text from the normal appearances of text annotations that are inside the page crop box. -
getNoAnnots
public boolean getNoAnnots()When true, it disables extracting text from text annotations. Normally, the word finder extracts text from the normal appearances of text annotations that are inside the page crop box. -
setNoHyphenDetection
public void setNoHyphenDetection(boolean value) When true, it disables finding and removing soft hyphens in non-tagged PDF, so that the word finder trusts hard hyphens as non-soft hyphens. This option has no effect on tagged PDF files. Normally, the word finder does not differentiate between soft and hard hyphen characters in non-tagged PDF files, because these are often misused. -
getNoHyphenDetection
public boolean getNoHyphenDetection()When true, it disables finding and removing soft hyphens in non-tagged PDF, so that the word finder trusts hard hyphens as non-soft hyphens. This option has no effect on tagged PDF files. Normally, the word finder does not differentiate between soft and hard hyphen characters in non-tagged PDF files, because these are often misused. -
setTrustNBSpace
public void setTrustNBSpace(boolean value) When true, it disables treating non-breaking space characters as regular space characters in non-tagged PDF files, so that the word finder preserves the space without breaking the word. This option has no effect on tagged PDF files. Normally, the word finder does not differentiate between breaking and non-breaking space characters in non-tagged PDF files, because these are often misused. -
getTrustNBSpace
public boolean getTrustNBSpace()When true, it disables treating non-breaking space characters as regular space characters in non-tagged PDF files, so that the word finder preserves the space without breaking the word. This option has no effect on tagged PDF files. Normally, the word finder does not differentiate between breaking and non-breaking space characters in non-tagged PDF files, because these are often misused. -
setNoExtCharOffset
public void setNoExtCharOffset(boolean value) When true, it disables generating extended character offset information to improve text extraction performance. The extended character offset information is necessary to determine exact character offset for character-by-character text selection. The beginning character offset of each word is always available regardless of this option, and can be used for word-by-word text selection with reasonable accuracy. When a client has no need for the detailed character offset information, it can use this option to improve the text extraction efficiency. There is a minor difference in the text extraction performance, and less memory is needed for the extracted word list. -
getNoExtCharOffset
public boolean getNoExtCharOffset()When true, it disables generating extended character offset information to improve text extraction performance. The extended character offset information is necessary to determine exact character offset for character-by-character text selection. The beginning character offset of each word is always available regardless of this option, and can be used for word-by-word text selection with reasonable accuracy. When a client has no need for the detailed character offset information, it can use this option to improve the text extraction efficiency. There is a minor difference in the text extraction performance, and less memory is needed for the extracted word list. -
setNoStyleInfo
public void setNoStyleInfo(boolean value) When true, it disables generating character style information to improve text extraction performance and memory efficiency. When you select this option, you cannot access the the StyleTransition property of Word objects returned from WordFinder. -
getNoStyleInfo
public boolean getNoStyleInfo()When true, it disables generating character style information to improve text extraction performance and memory efficiency. When you select this option, you cannot access the the StyleTransition property of Word objects returned from WordFinder. -
setPreserveRedundantChars
public void setPreserveRedundantChars(boolean value) When true, it disables detecting and removing redundant characters. Some PDF pages have the same text drawn multiple times on the same spot to get a special visual effect. Normally, those redundant characters are removed from the word finder output.Since this option may leave extra characters with overlapping bounding boxes, using it together with the disableCharReordering option is recommended for more consistent text extraction results.
-
getPreserveRedundantChars
public boolean getPreserveRedundantChars()When true, it disables detecting and removing redundant characters. Some PDF pages have the same text drawn multiple times on the same spot to get a special visual effect. Normally, those redundant characters are removed from the word finder output.Since this option may leave extra characters with overlapping bounding boxes, using it together with the disableCharReordering option is recommended for more consistent text extraction results.
-
setDisableCharReordering
public void setDisableCharReordering(boolean value) When true, it disables reconstructing the character orders, and the word finding algorithm is applied to the characters in the drawing order. By default, word finder reorders characters on a single line by the relative horizontal character locations. Most of the time, the character reordering feature improves the text extraction quality. However, on a PDF page with heavily overlapped character bounding boxes, the outcome becomes somewhat unpredictable. In such case, disabling the character reordering (disableCharReordering = true) may produce a more static result. -
getDisableCharReordering
public boolean getDisableCharReordering()When true, it disables reconstructing the character orders, and the word finding algorithm is applied to the characters in the drawing order. By default, word finder reorders characters on a single line by the relative horizontal character locations. Most of the time, the character reordering feature improves the text extraction quality. However, on a PDF page with heavily overlapped character bounding boxes, the outcome becomes somewhat unpredictable. In such case, disabling the character reordering (disableCharReordering = true) may produce a more static result. -
setNoSkewedQuads
public void setNoSkewedQuads(boolean value) When true, it disables the creation of a quad per character for skewed words, words with a horizontally-aligned, but non-rectangular, bounding region. Each skewed word will, instead, be associated with a single rectangular, bounding region. -
getNoSkewedQuads
public boolean getNoSkewedQuads()When true, it disables the creation of a quad per character for skewed words, words with a horizontally-aligned, but non-rectangular, bounding region. Each skewed word will, instead, be associated with a single rectangular, bounding region. -
setNoTextRenderMode3
public void setNoTextRenderMode3(boolean value) When true, it disables extracting text with Text Rendering mode Tr = 3 ("Neither fill nor stroke text (invisible)."). Normally, the word finder extracts such text as any other. -
getNoTextRenderMode3
public boolean getNoTextRenderMode3()When true, it disables extracting text with Text Rendering mode Tr = 3 ("Neither fill nor stroke text (invisible)."). Normally, the word finder extracts such text as any other. -
setPreciseQuad
public void setPreciseQuad(boolean value) When true, the bounding box or bounding quad will be set based on actual glyph bounding box. -
getPreciseQuad
public boolean getPreciseQuad()When true, the bounding box or bounding quad will be set based on actual glyph bounding box.
-