Package com.helger.pdflayout.pdfbox
Class PDPageContentStreamWithCache
java.lang.Object
com.helger.pdflayout.pdfbox.PDPageContentStreamWithCache
A special version of PDPageContentStream with an integrated "cache" to avoid
setting the same information over and over again.
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionPDPageContentStreamWithCache(org.apache.pdfbox.pdmodel.PDDocument aDocument, org.apache.pdfbox.pdmodel.PDPage aSourcePage, org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode aAppendContent, boolean bCompress) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRect(float fLeft, float fBottom, float fWidth, float fHeight) voidvoidclose()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) final PDPageContentStreamExtfinal org.apache.pdfbox.pdmodel.PDDocumentfloatfinal 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(PLColor aColor) voidsetStrokingColor(PLColor aColor) voidstroke()
-
Constructor Details
-
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 Details
-
getDocument
- Returns:
- The
PDDocumentthis stream is working on. Nevernull.
-
getPage
- Returns:
- The
PDPagethis stream is working on. Nevernull.
-
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
- Throws:
IOException
-
getLastUsedStrokingColor
-
setNonStrokingColor
- Throws:
IOException
-
getLastUsedNonStrokingColor
-
setLineDashPattern
- Throws:
IOException
-
getLastUsedLineDashPattern
-
setLineWidth
- Throws:
IOException
-
getLastUsedLineWidth
public float getLastUsedLineWidth() -
moveTextPositionByAmount
- Throws:
IOException
-
stroke
- Throws:
IOException
-
fill
- Throws:
IOException
-
addRect
- Throws:
IOException
-
drawLine
- Throws:
IOException
-
fillRect
- Throws:
IOException
-
beginText
- Throws:
IOException
-
endText
- Throws:
IOException
-
setCharacterSpacing
- Throws:
IOException
-
drawString
- 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
- Throws:
IOException
-