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 voidaddBox(BoxImpl parent, BoxImpl newBox)protected floatcomputeFontHeight(org.apache.pdfbox.pdmodel.font.PDFont arg0)protected ColorconvertColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor pdcolor)protected floatconvertLength(float length)protected intconvertLengthI(float length)protected BoxImplcreateBox()protected BoxImplcreateBox(int x, int y, int w, int h)protected BoxImplcreateImageBox(float x, float y, float width, float height, int pageOffset, org.fit.pdfdom.resource.ImageResource resource)protected BoxImplcreateLineBox(float x1, float y1, float x2, float y2, int pageOffset)protected BoxImplcreateRectangleBox(float x, float y, float width, float height, int pageOffset, boolean stroke, boolean fill)protected voidendDocument(org.apache.pdfbox.pdmodel.PDDocument document)List<Box>getAllBoxes()protected TextStylegetCurrentTextStyle(int contentLength)List<Integer>getPageYOffsets()BoxImplgetRoot()floatgetZoom()booleanisAcquireImages()protected ColorparseColor(String hash)voidprocessDocument(org.apache.pdfbox.pdmodel.PDDocument pdfdocument, int startPage, int endPage)protected voidprocessPDF(org.apache.pdfbox.pdmodel.PDDocument doc)protected voidrenderImage(float x, float y, float width, float height, org.fit.pdfdom.resource.ImageResource data)protected voidrenderPath(List<org.fit.pdfdom.PathSegment> path, boolean stroke, boolean fill)protected voidrenderText(String data, org.fit.pdfdom.TextMetrics metrics)static BufferedImagescaleImage(BufferedImage source, int destWidth, int destHeight)byte[]scaleImageData(byte[] srcData, int destWidth, int destHeight)voidsetAcquireImages(boolean acquireImages)voidsetZoom(float zoom)protected voidshowGlyph(org.apache.pdfbox.util.Matrix arg0, org.apache.pdfbox.pdmodel.font.PDFont arg1, int arg2, String arg3, org.apache.pdfbox.util.Vector arg4)protected voidstartDocument(org.apache.pdfbox.pdmodel.PDDocument document)protected voidstartNewPage()protected intstyleValue(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:
startDocumentin classorg.apache.pdfbox.text.PDFTextStripper- Throws:
IOException
-
endDocument
protected void endDocument(org.apache.pdfbox.pdmodel.PDDocument document) throws IOException- Overrides:
endDocumentin classorg.apache.pdfbox.text.PDFTextStripper- Throws:
IOException
-
startNewPage
protected void startNewPage()
- Specified by:
startNewPagein classorg.fit.pdfdom.PDFBoxTree
-
renderText
protected void renderText(String data, org.fit.pdfdom.TextMetrics metrics)
- Specified by:
renderTextin classorg.fit.pdfdom.PDFBoxTree
-
renderPath
protected void renderPath(List<org.fit.pdfdom.PathSegment> path, boolean stroke, boolean fill) throws IOException
- Specified by:
renderPathin 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:
renderImagein 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:
showGlyphin classorg.apache.pdfbox.contentstream.PDFStreamEngine- Throws:
IOException
-
computeFontHeight
protected float computeFontHeight(org.apache.pdfbox.pdmodel.font.PDFont arg0) throws IOException- Throws:
IOException
-
-