ContentStreamBuilder
Overview
ContentStreamBuilder is a class in Aspose.Pdf FOSS for Java.
Builds a PDF content stream as a sequence of bytes.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
fontResources | Map<String, String> | Read | Returns an unmodifiable map from base font name to resource name. |
imageResources | Map<String, String> | Read | Returns an unmodifiable map from image key to resource name. |
Methods
| Signature | Description |
|---|---|
ContentStreamBuilder() | Creates an empty ContentStreamBuilder. |
beginText() | Emits the BT (begin text object) operator. |
endText() | Emits the ET (end text object) operator. |
setFont(resourceName: String, size: double) | Emits the Tf (set text font and size) operator. |
markFontAsType0(resourceName: String, reader: org.aspose.pdf.engine.font.ttf.TrueTypeReader) | Marks {@code resourceName} as a Type0/Identity-H font. |
moveText(x: double, y: double) | Emits the Td (move text position) operator. |
showText(text: String) | Emits the Tj (show text) operator with proper PDF string escaping |
| and WinAnsiEncoding. | |
setTextMatrix(a: double, b: double, c: double, d: double, e: double, f: double) | Emits the Tm (set text matrix) operator. |
setRGBFillColor(r: double, g: double, b: double) | Emits the rg (set RGB fill color) operator. |
setRGBStrokeColor(r: double, g: double, b: double) | Emits the RG (set RGB stroke color) operator. |
setGrayFillColor(gray: double) | Emits the g (set gray fill color) operator. |
setGrayStrokeColor(gray: double) | Emits the G (set gray stroke color) operator. |
setLineWidth(width: double) | Emits the w (set line width) operator. |
saveState() | Emits the q (save graphics state) operator. |
restoreState() | Emits the Q (restore graphics state) operator. |
concatMatrix(a: double, b: double, c: double, d: double, e: double, f: double) | Emits the cm (concatenate matrix) operator. |
rectangle(x: double, y: double, w: double, h: double) | Emits the re (rectangle) operator. |
fill() | Emits the f (fill path) operator. |
stroke() | Emits the S (stroke path) operator. |
fillStroke() | Emits the B (fill then stroke path) operator. |
drawXObject(name: String) | Emits the Do (paint XObject) operator. |
registerFont(baseFont: String) → String | Registers a standard font and returns its resource name. |
registerImage(key: String) → String | Registers an image resource and returns its resource name. |
getFontResources() → Map<String, String> | Returns an unmodifiable map from base font name to resource name. |
getImageResources() → Map<String, String> | Returns an unmodifiable map from image key to resource name. |
toByteArray() → byte[] | Returns the accumulated content stream as a byte array. |