Package com.helger.pdflayout.pdfbox
Class PDPageContentStreamWithCache
- java.lang.Object
-
- com.helger.pdflayout.pdfbox.PDPageContentStreamWithCache
-
public class PDPageContentStreamWithCache extends Object
A special version of PDPageContentStream with an integrated "cache" to avoid setting the same information over and over again.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description PDPageContentStreamWithCache(org.apache.pdfbox.pdmodel.PDDocument aDocument, org.apache.pdfbox.pdmodel.PDPage aSourcePage, org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode aAppendContent, boolean bCompress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRect(float fLeft, float fBottom, float fWidth, float fHeight)voidbeginText()voidclose()voiddrawLine(float xStart, float yStart, float xEnd, float yEnd)voiddrawString(String sDrawText)voiddrawXObject(org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject aImage, float fX, float fY, float fWidth, float fHeight)voidendText()voidfill()voidfillRect(float fX, float fY, float fWidth, float fHeight)PDPageContentStreamExtgetContentStream()org.apache.pdfbox.pdmodel.PDDocumentgetDocument()LineDashPatternSpecgetLastUsedLineDashPattern()floatgetLastUsedLineWidth()ColorgetLastUsedNonStrokingColor()ColorgetLastUsedStrokingColor()org.apache.pdfbox.pdmodel.PDPagegetPage()voidmoveTextPositionByAmount(float tx, float ty)voidsetCharacterSpacing(float fSpacing)voidsetFont(LoadedFont aLoadedFont, FontSpec aFontSpec)voidsetLineDashPattern(LineDashPatternSpec aLineDashPattern)voidsetLineWidth(float fLineWidth)voidsetNonStrokingColor(Color aColor)voidsetStrokingColor(Color aColor)voidstroke()
-
-
-
Constructor Detail
-
PDPageContentStreamWithCache
public PDPageContentStreamWithCache(@Nonnull org.apache.pdfbox.pdmodel.PDDocument aDocument, @Nonnull org.apache.pdfbox.pdmodel.PDPage aSourcePage, @Nonnull org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode aAppendContent, boolean bCompress) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getDocument
@Nonnull public final org.apache.pdfbox.pdmodel.PDDocument getDocument()
- Returns:
- The
PDDocumentthis stream is working on. Nevernull.
-
getPage
@Nonnull public final org.apache.pdfbox.pdmodel.PDPage getPage()
- Returns:
- The
PDPagethis stream is working on. Nevernull.
-
getContentStream
@Nonnull public final PDPageContentStreamExt getContentStream()
- Returns:
- The internal page content stream. Never
null. Handle with care. - Since:
- 6.0.2
-
setFont
public void setFont(@Nonnull LoadedFont aLoadedFont, @Nonnull FontSpec aFontSpec) throws IOException
- Throws:
IOException
-
setStrokingColor
public void setStrokingColor(@Nonnull Color aColor) throws IOException
- Throws:
IOException
-
setNonStrokingColor
public void setNonStrokingColor(@Nonnull Color aColor) throws IOException
- Throws:
IOException
-
setLineDashPattern
public void setLineDashPattern(@Nonnull LineDashPatternSpec aLineDashPattern) throws IOException
- Throws:
IOException
-
getLastUsedLineDashPattern
@Nonnull public LineDashPatternSpec getLastUsedLineDashPattern()
-
setLineWidth
public void setLineWidth(float fLineWidth) throws IOException- Throws:
IOException
-
getLastUsedLineWidth
public float getLastUsedLineWidth()
-
moveTextPositionByAmount
public void moveTextPositionByAmount(float tx, float ty) throws IOException- Throws:
IOException
-
stroke
public void stroke() throws IOException- Throws:
IOException
-
fill
public void fill() throws IOException- Throws:
IOException
-
addRect
public void addRect(float fLeft, float fBottom, float fWidth, float fHeight) throws IOException- Throws:
IOException
-
drawLine
public void drawLine(float xStart, float yStart, float xEnd, float yEnd) throws IOException- Throws:
IOException
-
fillRect
public void fillRect(float fX, float fY, float fWidth, float fHeight) throws IOException- Throws:
IOException
-
beginText
public void beginText() throws IOException- Throws:
IOException
-
endText
public void endText() throws IOException- Throws:
IOException
-
setCharacterSpacing
public void setCharacterSpacing(float fSpacing) throws IOException- Throws:
IOException
-
drawString
public void drawString(String sDrawText) throws IOException
- Throws:
IOException
-
drawXObject
public void drawXObject(org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject aImage, float fX, float fY, float fWidth, float fHeight) throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Throws:
IOException
-
-