public class PdfManipulatorBuilder
extends java.lang.Object
Constructor and Description |
---|
PdfManipulatorBuilder() |
Modifier and Type | Method and Description |
---|---|
PdfManipulator |
build()
Builds the manipulator based on the input set on the builder
|
PdfManipulatorBuilder |
setBlockMergeChecker(PdfBlockMergeChecker blockMergeChecker)
Used to determine if two adjacent blocks should be merged or not
|
PdfManipulatorBuilder |
setColumnDeterminer(PdfColumnDeterminer columnDeterminer)
Used to determine the column number for an element (if a column split was requested)
|
PdfManipulatorBuilder |
setConvertFontStylesToAttributes(boolean convertFontStylesToAttributes)
Flag to indicate stripping bold and italic tags and placing attributes on the element for them (also removing them from the element)
|
PdfManipulatorBuilder |
setConvertPageBlockToAttribute(boolean convertPageBlockToAttribute)
Flag to indicate removing pages and instead putting a page number attribute on each element
|
PdfManipulatorBuilder |
setLocationTolerance(int locationTolerance)
The amount of tolerance for the location of elements.
|
PdfManipulatorBuilder |
setMaxColumnSpan(int maxColumnSpan)
Maximum number of columns an element is allowed to be in before being stripped from the output as a bad element (default value is 1 meaning just the one
cell).
|
PdfManipulatorBuilder |
setPageValidator(PdfPageValidator pageValidator)
Used to determine if the current page should be discarded or kept.
|
PdfManipulatorBuilder |
setPostColumnsPageValidator(PdfPageValidator postColumnsPageValidator)
Used to determine if the current page should be discarded or kept.
|
PdfManipulatorBuilder |
setPredeterminedColumnLocations(java.util.Collection<java.lang.Integer> predeterminedColumnLocations)
Collection of the left value for each column.
|
PdfManipulatorBuilder |
setPredeterminedColumnLocations(int[] predeterminedColumnLocations)
Array of the left value for each column.
|
PdfManipulatorBuilder |
setPredeterminedColumnLocationsAndWidths(java.util.Map<java.lang.Integer,java.lang.Integer> predeterminedColumnLocationsAndWidths)
Map of column locations and widths to use (don't try to calculate them)
|
PdfManipulatorBuilder |
setPreserveFontFaceInformation(boolean preserveFontFaceInformation)
Flag to indicate the desire to preserve font face information as additional tag attributes on each element
|
PdfManipulatorBuilder |
setPreserveImages(boolean preserveImages)
Sets whether or not image tags should be preserved in the output
|
PdfManipulatorBuilder |
setPreSortElementsBeforePageAndTextValidation(boolean sortBeforePageAndTextValidation)
Flag to indicate if sorting of elements should occur before the page and text validation code is run.
|
PdfManipulatorBuilder |
setRemoveEmptyTextElements(boolean removeEmptyTextElements)
Flag to indicate whether empty (and whitespace only) text elements should be removed automatically
|
PdfManipulatorBuilder |
setRemoveItemsNotInColumns(boolean removeItemsNotInColumns)
Flag to indicate to remove text elements that don't fit into a column (when column splitting is enabled)
|
PdfManipulatorBuilder |
setResortBlocksRowOrder(java.lang.Boolean resortBlocksRowOrder)
Flag to indicate that after whitespace has separated things into blocks, and the block merger has run, elements inside the block should be resorted.
|
PdfManipulatorBuilder |
setSortElements(boolean sortElements)
Flag to indicate if sorting of elements should occur
|
PdfManipulatorBuilder |
setSortRowOrder(boolean sortRowOrder)
Flag to indicate sorting rows over columns if split into columns.
|
PdfManipulatorBuilder |
setSplitIntoColumns(boolean splitIntoColumns)
Flag to indicate trying to split into columns (and add a column attribute)
|
PdfManipulatorBuilder |
setTextValidator(PdfTextValidator textValidator)
Used to determine if a given text element should be saved or not.
|
PdfManipulatorBuilder |
setWhiteSpaceDividerHeightAmount(int whiteSpaceDividerHeightAmount)
Amount to consider as white space between elements (height wise).
|
@NotNull public PdfManipulatorBuilder setResortBlocksRowOrder(@Nullable java.lang.Boolean resortBlocksRowOrder)
resortBlocksRowOrder
- Flag to indicate that after whitespace has separated things into blocks, and the block merger has run, elements inside the block should be resorted. True to resort block elements into row order, false to resort them to column order, or null to leave unchanged from the order they were in when put into a block@NotNull public PdfManipulatorBuilder setPreserveFontFaceInformation(boolean preserveFontFaceInformation)
preserveFontFaceInformation
- Flag to indicate the desire to preserve font face information as additional tag attributes on each element@NotNull public PdfManipulatorBuilder setRemoveEmptyTextElements(boolean removeEmptyTextElements)
removeEmptyTextElements
- Flag to indicate whether empty (and whitespace only) text elements should be removed automatically@NotNull public PdfManipulatorBuilder setConvertPageBlockToAttribute(boolean convertPageBlockToAttribute)
convertPageBlockToAttribute
- Flag to indicate removing pages and instead putting a page number attribute on each element@NotNull public PdfManipulatorBuilder setConvertFontStylesToAttributes(boolean convertFontStylesToAttributes)
convertFontStylesToAttributes
- Flag to indicate stripping bold and italic tags and placing attributes on the element for them (also removing them
from the element)@NotNull public PdfManipulatorBuilder setPreSortElementsBeforePageAndTextValidation(boolean sortBeforePageAndTextValidation)
sortBeforePageAndTextValidation
- Flag to indicate if sorting of elements should occur before the page and text validation code is run. Regardless
of this setting the sort will be called after it is run@NotNull public PdfManipulatorBuilder setSortElements(boolean sortElements)
sortElements
- Flag to indicate if sorting of elements should occur@NotNull public PdfManipulatorBuilder setSortRowOrder(boolean sortRowOrder)
sortRowOrder
- Flag to indicate sorting rows over columns if split into columns. Otherwise this is the default sort order anyway. True to sort by
row, false to sort by column@NotNull public PdfManipulatorBuilder setSplitIntoColumns(boolean splitIntoColumns)
splitIntoColumns
- Flag to indicate trying to split into columns (and add a column attribute)@NotNull public PdfManipulatorBuilder setRemoveItemsNotInColumns(boolean removeItemsNotInColumns)
removeItemsNotInColumns
- Flag to indicate to remove text elements that don't fit into a column (when column splitting is enabled)@NotNull public PdfManipulatorBuilder setWhiteSpaceDividerHeightAmount(int whiteSpaceDividerHeightAmount)
whiteSpaceDividerHeightAmount
- Amount to consider as white space between elements (height wise). If set to greater than Integer.MIN_VALUE this
indicates we should break into blocks@NotNull public PdfManipulatorBuilder setLocationTolerance(int locationTolerance)
locationTolerance
- The amount of tolerance for the location of elements. For example, if most of your elements are at 200, but you set tolerance to
2, then elements at 202 would also be included in the same location@NotNull public PdfManipulatorBuilder setPreserveImages(boolean preserveImages)
preserveImages
- True iff image tags should be preserved, false otherwise@NotNull public PdfManipulatorBuilder setPageValidator(@Nullable PdfPageValidator pageValidator)
pageValidator
- Used to determine if the current page should be discarded or kept@NotNull public PdfManipulatorBuilder setPostColumnsPageValidator(@Nullable PdfPageValidator postColumnsPageValidator)
postColumnsPageValidator
- Used to determine if the current page should be discarded or kept@NotNull public PdfManipulatorBuilder setTextValidator(@Nullable PdfTextValidator textValidator)
textValidator
- Used to determine if a given element should be saved or not@NotNull public PdfManipulatorBuilder setBlockMergeChecker(@Nullable PdfBlockMergeChecker blockMergeChecker)
blockMergeChecker
- The checker that will be called to potentially merge blocks after they've been separated@NotNull public PdfManipulatorBuilder setColumnDeterminer(@Nullable PdfColumnDeterminer columnDeterminer)
columnDeterminer
- Used to determine the column number for an element (if a column split was requested)@NotNull public PdfManipulatorBuilder setPredeterminedColumnLocations(@NotNull int[] predeterminedColumnLocations)
predeterminedColumnLocations
- Collection of the left value for each column@NotNull public PdfManipulatorBuilder setPredeterminedColumnLocations(@NotNull java.util.Collection<java.lang.Integer> predeterminedColumnLocations)
predeterminedColumnLocations
- Collection of the left value for each column@NotNull public PdfManipulatorBuilder setPredeterminedColumnLocationsAndWidths(java.util.Map<java.lang.Integer,java.lang.Integer> predeterminedColumnLocationsAndWidths)
predeterminedColumnLocationsAndWidths
- Map of column locations and widths to use (don't try to calculate them)@NotNull public PdfManipulatorBuilder setMaxColumnSpan(int maxColumnSpan)
maxColumnSpan
- Maximum number of columns an element is allowed to be in before being stripped from the output as a bad element (default value is 1
meaning just the one cell). Must be greater than 0@Nullable public PdfManipulator build()