ContentStreamBuilder

ContentStreamBuilder

Vue de l’ensemble

‘ContentStreamBuilder’ est une classe dans Aspose.PDF FOSS pour Java.

Il crée un flux de contenu PDF en tant que séquence de bytes.

Cette classe fournit 27 méthodes pour travailler avec les objets de ContentStreamBuilder dans des programmes Java. Les méthodologies disponibles comprennent: ContentStreumBuilders, beginText , ‘concatMatrix ; 'drawXObject; ’endTeXT : ‘fill: ‘fillStroke et 'getFontResources .

Propriétés

NameTypeAccessDescription
fontResourcesMap<String, String>ReadReturns an unmodifiable map from base font name to resource name.
imageResourcesMap<String, String>ReadReturns an unmodifiable map from image key to resource name.

méthodes

SignatureDescription
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)StringRegisters a standard font and returns its resource name.
registerImage(key: String)StringRegisters 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.
unicodeToWinAnsi(ch: char)intConverts a Unicode character to its WinAnsiEncoding byte value.

Voir aussi

  • Aspose.PDF pour Java — API d’entreprise
 Français