Package cz.vutbr.fit.layout.pdf.impl
Class FLBoxTree
- java.lang.Object
-
- org.apache.pdfbox.contentstream.PDFStreamEngine
-
- org.apache.pdfbox.text.PDFTextStripper
-
- org.fit.pdfdom.PDFBoxTree
-
- cz.vutbr.fit.layout.pdf.impl.FLBoxTree
-
public class FLBoxTree extends org.fit.pdfdom.PDFBoxTree
- Author:
- burgetr
-
-
Field Summary
-
Fields inherited from class org.fit.pdfdom.PDFBoxTree
cssFontFamily, cssFontStyle, cssFontWeight, cur_x, cur_y, curstyle, disableGraphics, disableImageData, disableImages, endPage, fontTable, graphicsPath, lastDia, lastText, path_start_x, path_start_y, path_x, path_y, pdFontType, pdpage, startPage, style, textLine, textMetrics, UNIT
-
-
Constructor Summary
Constructors Constructor Description FLBoxTree()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addBox(BoxImpl parent, BoxImpl newBox)
protected float
computeFontHeight(org.apache.pdfbox.pdmodel.font.PDFont arg0)
protected Color
convertColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor pdcolor)
protected float
convertLength(float length)
protected int
convertLengthI(float length)
protected BoxImpl
createBox()
protected BoxImpl
createBox(int x, int y, int w, int h)
protected BoxImpl
createImageBox(float x, float y, float width, float height, int pageOffset, org.fit.pdfdom.resource.ImageResource resource)
protected BoxImpl
createLineBox(float x1, float y1, float x2, float y2, int pageOffset)
protected BoxImpl
createRectangleBox(float x, float y, float width, float height, int pageOffset, boolean stroke, boolean fill)
protected void
endDocument(org.apache.pdfbox.pdmodel.PDDocument document)
List<Box>
getAllBoxes()
protected TextStyle
getCurrentTextStyle(int contentLength)
List<Integer>
getPageYOffsets()
BoxImpl
getRoot()
float
getZoom()
boolean
isAcquireImages()
protected Color
parseColor(String hash)
void
processDocument(org.apache.pdfbox.pdmodel.PDDocument pdfdocument, int startPage, int endPage)
protected void
processPDF(org.apache.pdfbox.pdmodel.PDDocument doc)
protected void
renderImage(float x, float y, float width, float height, org.fit.pdfdom.resource.ImageResource data)
protected void
renderPath(List<org.fit.pdfdom.PathSegment> path, boolean stroke, boolean fill)
protected void
renderText(String data, org.fit.pdfdom.TextMetrics metrics)
static BufferedImage
scaleImage(BufferedImage source, int destWidth, int destHeight)
byte[]
scaleImageData(byte[] srcData, int destWidth, int destHeight)
void
setAcquireImages(boolean acquireImages)
void
setZoom(float zoom)
protected void
showGlyph(org.apache.pdfbox.util.Matrix arg0, org.apache.pdfbox.pdmodel.font.PDFont arg1, int arg2, String arg3, org.apache.pdfbox.util.Vector arg4)
protected void
startDocument(org.apache.pdfbox.pdmodel.PDDocument document)
protected void
startNewPage()
protected int
styleValue(String val, String oneval)
-
Methods inherited from class org.fit.pdfdom.PDFBoxTree
colorString, colorString, colorString, createCurrentPageTransformation, finishBox, floatValue, getCurrentMediaBox, getDisableGraphics, getDisableImageData, getDisableImages, getEndPage, getLength, getStartPage, getTextDirectionality, getTextDirectionality, getTitle, intValue, isReversed, processImageOperation, processOperator, processPage, processTextPosition, setDisableGraphics, setDisableImageData, setDisableImages, setEndPage, setStartPage, stringValue, toRectangle, transformLength, transformPosition, updateFontTable, updateStyle
-
Methods inherited from class org.apache.pdfbox.text.PDFTextStripper
endArticle, endPage, getAddMoreFormatting, getArticleEnd, getArticleStart, getAverageCharTolerance, getCurrentPageNo, getDropThreshold, getEndBookmark, getCharactersByArticle, getIndentThreshold, getLineSeparator, getListItemPatterns, getOutput, getPageEnd, getPageStart, getParagraphEnd, getParagraphStart, getSeparateByBeads, getSortByPosition, getSpacingTolerance, getStartBookmark, getSuppressDuplicateOverlappingText, getText, getWordSeparator, matchPattern, processPages, setAddMoreFormatting, setArticleEnd, setArticleStart, setAverageCharTolerance, setDropThreshold, setEndBookmark, setIndentThreshold, setLineSeparator, setListItemPatterns, setPageEnd, setPageStart, setParagraphEnd, setParagraphStart, setShouldSeparateByBeads, setSortByPosition, setSpacingTolerance, setStartBookmark, setSuppressDuplicateOverlappingText, setWordSeparator, startArticle, startArticle, startPage, writeCharacters, writeLineSeparator, writePage, writePageEnd, writePageStart, writeParagraphEnd, writeParagraphSeparator, writeParagraphStart, writeString, writeString, writeText, writeWordSeparator
-
Methods inherited from class org.apache.pdfbox.contentstream.PDFStreamEngine
addOperator, applyTextAdjustment, beginMarkedContentSequence, beginText, decreaseLevel, endMarkedContentSequence, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, operatorException, processAnnotation, processChildStream, processOperator, processSoftMask, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, registerOperatorProcessor, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showFontGlyph, showForm, showGlyph, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator
-
-
-
-
Constructor Detail
-
FLBoxTree
public FLBoxTree() throws IOException
- Throws:
IOException
-
-
Method Detail
-
isAcquireImages
public boolean isAcquireImages()
-
setAcquireImages
public void setAcquireImages(boolean acquireImages)
-
getZoom
public float getZoom()
-
setZoom
public void setZoom(float zoom)
-
getRoot
public BoxImpl getRoot()
-
processDocument
public void processDocument(org.apache.pdfbox.pdmodel.PDDocument pdfdocument, int startPage, int endPage) throws IOException
- Throws:
IOException
-
processPDF
protected void processPDF(org.apache.pdfbox.pdmodel.PDDocument doc) throws IOException
- Throws:
IOException
-
startDocument
protected void startDocument(org.apache.pdfbox.pdmodel.PDDocument document) throws IOException
- Overrides:
startDocument
in classorg.apache.pdfbox.text.PDFTextStripper
- Throws:
IOException
-
endDocument
protected void endDocument(org.apache.pdfbox.pdmodel.PDDocument document) throws IOException
- Overrides:
endDocument
in classorg.apache.pdfbox.text.PDFTextStripper
- Throws:
IOException
-
startNewPage
protected void startNewPage()
- Specified by:
startNewPage
in classorg.fit.pdfdom.PDFBoxTree
-
renderText
protected void renderText(String data, org.fit.pdfdom.TextMetrics metrics)
- Specified by:
renderText
in classorg.fit.pdfdom.PDFBoxTree
-
renderPath
protected void renderPath(List<org.fit.pdfdom.PathSegment> path, boolean stroke, boolean fill) throws IOException
- Specified by:
renderPath
in classorg.fit.pdfdom.PDFBoxTree
- Throws:
IOException
-
renderImage
protected void renderImage(float x, float y, float width, float height, org.fit.pdfdom.resource.ImageResource data) throws IOException
- Specified by:
renderImage
in classorg.fit.pdfdom.PDFBoxTree
- Throws:
IOException
-
createBox
protected BoxImpl createBox()
-
createBox
protected BoxImpl createBox(int x, int y, int w, int h)
-
createRectangleBox
protected BoxImpl createRectangleBox(float x, float y, float width, float height, int pageOffset, boolean stroke, boolean fill)
-
createLineBox
protected BoxImpl createLineBox(float x1, float y1, float x2, float y2, int pageOffset)
-
createImageBox
protected BoxImpl createImageBox(float x, float y, float width, float height, int pageOffset, org.fit.pdfdom.resource.ImageResource resource) throws IOException
- Throws:
IOException
-
convertLength
protected float convertLength(float length)
-
convertLengthI
protected int convertLengthI(float length)
-
getCurrentTextStyle
protected TextStyle getCurrentTextStyle(int contentLength)
-
convertColor
protected Color convertColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor pdcolor)
-
scaleImageData
public byte[] scaleImageData(byte[] srcData, int destWidth, int destHeight) throws IOException
- Throws:
IOException
-
scaleImage
public static BufferedImage scaleImage(BufferedImage source, int destWidth, int destHeight)
-
showGlyph
protected void showGlyph(org.apache.pdfbox.util.Matrix arg0, org.apache.pdfbox.pdmodel.font.PDFont arg1, int arg2, String arg3, org.apache.pdfbox.util.Vector arg4) throws IOException
- Overrides:
showGlyph
in classorg.apache.pdfbox.contentstream.PDFStreamEngine
- Throws:
IOException
-
computeFontHeight
protected float computeFontHeight(org.apache.pdfbox.pdmodel.font.PDFont arg0) throws IOException
- Throws:
IOException
-
-