PsDocument

Inheritance: java.lang.Object, com.aspose.page.Document

public final class PsDocument extends Document

This class encapsulates PS/EPS documents.

Constructors

ConstructorDescription
PsDocument(OutputStream psStream, PsSaveOptions options)Initializes empty PsDocument with initialized page.
PsDocument(OutputStream psStream, PsSaveOptions options, boolean multipaged)Initializes empty PsDocument .
PsDocument(OutputStream psStream, PsSaveOptions options, int numberOfPages)Initializes empty PsDocument when the number of Postscript document pages is known in advance.
PsDocument(InputStream psStream)Initializes PsDocument with a stream of PS/EPS file.
PsDocument(InputStream psStream, LoadOptions loadOptions)Initializes PsDocument with a stream and load options.

Methods

MethodDescription
setInputStream(InputStream is)Specifies an input stream.
save(Device device, SaveOptions options)Saves PS/EPS file to a device.
save(OutputStream epsStream)Saves given PsDocument as EPS file.
save()Saves given PsDocument as PS file.
getXmpMetadata()Reads PS/EPS file and extracts XmpMetdata if it already exists or add new one if it doesn’t exist.
extractEpsSize()Reads EPS file and extracts a size of EPS image from %%BoundingBox comment or default page size (595, 842) if it doesn’t exist.
resizeEps(OutputStream epsStream, DimensionF newSizeInUnits, Units units)Resizes given PsDocument as EPS file.
extractEpsBoundingBox()Reads EPS file and extracts bounding box of EPS image from %%BoundingBox comment or bounds for default page size (0, 0, 595, 842) if it doesn’t exist.
cropEps(OutputStream epsStream, float[] cropBox)Crops given PsDocument as EPS file.
saveImageAsEps(InputStream imageStream, OutputStream epsStream, PsSaveOptions options)Saves PNG/JPEG/BMP/GIF image from input stream to EPS output stream.
saveImageAsEps(String imageFilePath, String epsFilePath, PsSaveOptions options)Saves PNG/JPEG/BMP/GIF image from file to EPS file.
saveImageAsEps(BufferedImage image, String epsFilePath, PsSaveOptions options)Saves BufferedImage object to EPS file.
saveImageAsEps(BufferedImage image, OutputStream epsStream, PsSaveOptions options)Saves BufferedImage object to EPS file.
setPageSize(float width, float height)Sets page size.
setPageDevice(Map<String,Object> pageParams)Sets page device parameters (see operator “setpagedevice” PostScript spesification).
openPage(float width, float height)Creates new page and make it current one.
openPage(String pageName)Creates new page with document’s size and make it current one.
closePage()Complete current page.
writeGraphicsSave()Writes saving of the current graphics state (see PostScript specification on operator “gsave”).
writeGraphicsRestore()Writes restoring of the current graphics state (see PostScript specification on operator “grestore”).
setTransform(AffineTransform matrix)Set current transformation to this one.
transform(AffineTransform matrix)Adds transformation to current graphics state (concatenates this matrix with current one).
translate(float x, float y)Adds translation to current graphics state (translates current matrix).
scale(float xScale, float yScale)Adds scale to current graphics state (scale current matrix).
rotate(float angleRadians)Adds rotation counterclockwise about the origin to current graphics state (rotate current matrix).
rotate(int angleDegrees)Adds rotation counterclockwise about the origin to current graphics state (rotate current matrix).
shear(float shx, float shy)Adds shear transformation to current graphics state (shear current matrix).
clip(Shape s)Adds clip to current graphics state.
clipText(String text, Font font, float x, float y)Adds clip from an outline of given text in given font.
clipRectangle(Rectangle2D.Float rect)Adds clipping rectangle to current graphics state.
clipAndNewPath(Shape s)Adds clip to current graphics state and than writes “newpath” operator.
setPaint(Paint paint)Sets paint in current graphics state.
getPaint()Gets paint in current graphics state.
setStroke(Stroke stroke)Sets stroke in current graphics state.
getStroke()Gets stroke in current graphics state.
fillText(String text, Font font, float x, float y)Adds a text string by filling interior of glyphs.
fillText(String text, float[] advances, Font font, float x, float y)Adds a text string by filling interior of glyphs.
fillText(String text, DrFont drFont, float x, float y)Adds a text string by filling interior of glyphs.
fillText(String text, float[] advances, DrFont drFont, float x, float y)Adds a text string by filling interior of glyphs.
fillText(String text, Font font, float x, float y, Paint fill)Adds a text string by filling interior of glyphs.
fillText(String text, float[] advances, Font font, float x, float y, Paint fill)Adds a text string by filling interior of glyphs.
fillText(String text, DrFont drFont, float x, float y, Paint fill)Adds a text string by filling interior of glyphs.
fillText(String text, float[] advances, DrFont drFont, float x, float y, Paint fill)Adds a text string by filling interior of glyphs.
outlineText(String text, Font font, float x, float y)Adds a text string by drawing glyphs contours.
outlineText(String text, float[] advances, Font font, float x, float y)Adds a text string by drawing glyphs contours.
outlineText(String text, DrFont drFont, float x, float y)Adds a text string by drawing glyphs contours.
outlineText(String text, float[] advances, DrFont drFont, float x, float y)Adds a text string by drawing glyphs contours.
outlineText(String text, Font font, float x, float y, Paint outlinePaint, Stroke stroke)Adds a text string by drawing glyphs contours.
outlineText(String text, float[] advances, Font font, float x, float y, Paint outlinePaint, Stroke stroke)Adds a text string by drawing glyphs contours.
outlineText(String text, DrFont drFont, float x, float y, Paint outlinePaint, Stroke stroke)Adds a text string by drawing glyphs contours.
outlineText(String text, float[] advances, DrFont drFont, float x, float y, Paint outlinePaint, Stroke stroke)Adds a text string by drawing glyphs contours.
fillAndStrokeText(String text, Font font, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)Adds a text string by filling interior of glyphs and drawing glyphs contours.
fillAndStrokeText(String text, float[] advances, Font font, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)Adds a text string by filling interior of glyphs and drawing glyphs contours.
fillAndStrokeText(String text, DrFont drFont, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)Adds a text string by filling interior of glyphs and drawing glyphs contours.
fillAndStrokeText(String text, float[] advances, DrFont drFont, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)Adds a text string by filling interior of glyphs and drawing glyphs contours.
fill(Shape shape)Fill an arbitrary path.
draw(Shape shape)Draw an arbitrary path.
drawImage(BufferedImage image)Draw an image.
drawImage(BufferedImage image, AffineTransform transform, Color bkg)Draw transformed image with background.
drawTransparentImage(BufferedImage image, AffineTransform transform, int transparencyThreshold)Draw transformed transparent image with background.
drawExplicitImageMask(BufferedImage image24bpp, BufferedImage alphaMask1bpp, AffineTransform transform)Draw masked image.
getNumberOfPages()Gets a quantity of pages in resulting PDF document.
merge(String[] filesForMerge, Device device, SaveOptions options)Merges PS/EPS files to a device.

PsDocument(OutputStream psStream, PsSaveOptions options)

public PsDocument(OutputStream psStream, PsSaveOptions options)

Initializes empty PsDocument with initialized page.

Parameters:

ParameterTypeDescription
psStreamjava.io.OutputStreamStream where to save PS/EPS file.
optionsPsSaveOptionsA set of parameters controlling saving of PostScript file.

PsDocument(OutputStream psStream, PsSaveOptions options, boolean multipaged)

public PsDocument(OutputStream psStream, PsSaveOptions options, boolean multipaged)

Initializes empty PsDocument .

Parameters:

ParameterTypeDescription
psStreamjava.io.OutputStreamStream where to save PS/EPS file.
optionsPsSaveOptionsA set of parameters controlling saving of PostScript file.
multipagedbooleanIf false page will not be initialized. In this case page initialization should be performed via explicit “openPage(width, height) call.”

PsDocument(OutputStream psStream, PsSaveOptions options, int numberOfPages)

public PsDocument(OutputStream psStream, PsSaveOptions options, int numberOfPages)

Initializes empty PsDocument when the number of Postscript document pages is known in advance.

Parameters:

ParameterTypeDescription
psStreamjava.io.OutputStreamStream where to save PS/EPS file.
optionsPsSaveOptionsA set of parameters controlling saving of PostScript file.
numberOfPagesintThe number of pages in the PostScript document.

PsDocument(InputStream psStream)

public PsDocument(InputStream psStream)

Initializes PsDocument with a stream of PS/EPS file.

Parameters:

ParameterTypeDescription
psStreamjava.io.InputStreamStream of PS/EPS file.

PsDocument(InputStream psStream, LoadOptions loadOptions)

public PsDocument(InputStream psStream, LoadOptions loadOptions)

Initializes PsDocument with a stream and load options.

Parameters:

ParameterTypeDescription
psStreamjava.io.InputStreamStream of PS/EPS file.
loadOptionsLoadOptionsSet of parameters controlling loading of PS file.

setInputStream(InputStream is)

public void setInputStream(InputStream is)

Specifies an input stream.

Parameters:

ParameterTypeDescription
isjava.io.InputStreamInput stream of PS/EPS file.

save(Device device, SaveOptions options)

public void save(Device device, SaveOptions options)

Saves PS/EPS file to a device.

Parameters:

ParameterTypeDescription
deviceDeviceAn output device.
optionsSaveOptionsContains flags that specify output of errors thrown during conversion.

save(OutputStream epsStream)

public void save(OutputStream epsStream)

Saves given PsDocument as EPS file. This method is used only after updating XMP metadata. It saves initial EPS file with updated existing metadata or new one created while calling getMetadata method. In the last case all necessary PostScript code and EPS comments are added.

Parameters:

ParameterTypeDescription
epsStreamjava.io.OutputStreamStream of output EPS file.

save()

public void save()

Saves given PsDocument as PS file. This method is used only when PsDocument was created from scratch.

getXmpMetadata()

public XmpMetadata getXmpMetadata()

Reads PS/EPS file and extracts XmpMetdata if it already exists or add new one if it doesn’t exist.

Returns: XmpMetadata - existing or new instance of XMP metadata.

extractEpsSize()

public Dimension extractEpsSize()

Reads EPS file and extracts a size of EPS image from %%BoundingBox comment or default page size (595, 842) if it doesn’t exist.

Returns: java.awt.Dimension - The size of the EPS image.

resizeEps(OutputStream epsStream, DimensionF newSizeInUnits, Units units)

public void resizeEps(OutputStream epsStream, DimensionF newSizeInUnits, Units units)

Resizes given PsDocument as EPS file. This method is used only after extracting EPS size. It saves initial EPS file with updated existing %%BoundingBox or new one will be created. Page transformation matrix also will be set.

Parameters:

ParameterTypeDescription
epsStreamjava.io.OutputStream
newSizeInUnitsDimensionFNew size of EPS image in assigned units.
unitsUnitsThe units of the new size. Can be points, inches, millimeters, centimeters and percents of initial size.

extractEpsBoundingBox()

public int[] extractEpsBoundingBox()

Reads EPS file and extracts bounding box of EPS image from %%BoundingBox comment or bounds for default page size (0, 0, 595, 842) if it doesn’t exist.

Returns: int[] - The bounding box of the EPS image.

cropEps(OutputStream epsStream, float[] cropBox)

public void cropEps(OutputStream epsStream, float[] cropBox)

Crops given PsDocument as EPS file. It saves initial EPS file with updated existing %%BoundingBox or new one will be created.

Parameters:

ParameterTypeDescription
epsStreamjava.io.OutputStream
cropBoxfloat[]The crop box (x0, y0, x, y).

saveImageAsEps(InputStream imageStream, OutputStream epsStream, PsSaveOptions options)

public static void saveImageAsEps(InputStream imageStream, OutputStream epsStream, PsSaveOptions options)

Saves PNG/JPEG/BMP/GIF image from input stream to EPS output stream.

Parameters:

ParameterTypeDescription
imageStreamjava.io.InputStreamImage input stream.
epsStreamjava.io.OutputStreamEPS output stream.
optionsPsSaveOptionsContains parameters that specify output of errors thrown during conversion.

saveImageAsEps(String imageFilePath, String epsFilePath, PsSaveOptions options)

public static void saveImageAsEps(String imageFilePath, String epsFilePath, PsSaveOptions options)

Saves PNG/JPEG/BMP/GIF image from file to EPS file.

Parameters:

ParameterTypeDescription
imageFilePathjava.lang.StringImage file path.
epsFilePathjava.lang.StringEPS file path.
optionsPsSaveOptionsContains parameters that specify output of errors thrown during conversion.

saveImageAsEps(BufferedImage image, String epsFilePath, PsSaveOptions options)

public static void saveImageAsEps(BufferedImage image, String epsFilePath, PsSaveOptions options)

Saves BufferedImage object to EPS file.

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageThe Image.
epsFilePathjava.lang.StringEPS file path.
optionsPsSaveOptionsContains parameters that specify output of errors thrown during conversion.

saveImageAsEps(BufferedImage image, OutputStream epsStream, PsSaveOptions options)

public static void saveImageAsEps(BufferedImage image, OutputStream epsStream, PsSaveOptions options)

Saves BufferedImage object to EPS file.

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageThe Image.
epsStreamjava.io.OutputStreamEPS output stream.
optionsPsSaveOptionsContains parameters that specify output of errors thrown during conversion.

setPageSize(float width, float height)

public void setPageSize(float width, float height)

Sets page size. To create pages with different sizes in one document use setPageDevice method just after this method.

Parameters:

ParameterTypeDescription
widthfloatThe width of page in resulting PostScript file.
heightfloatThe height of page in resulting PostScript file.

setPageDevice(Map<String,Object> pageParams)

public void setPageDevice(Map<String,Object> pageParams)

Sets page device parameters (see operator “setpagedevice” PostScript spesification). Among these can be page size and color etc.

Parameters:

ParameterTypeDescription
pageParamsjava.util.Map<java.lang.String,java.lang.Object>Parameters of the page. In this dictionary can be page size and color etc.

openPage(float width, float height)

public void openPage(float width, float height)

Creates new page and make it current one.

Parameters:

ParameterTypeDescription
widthfloatThe width of new page.
heightfloatThe height of new page.

openPage(String pageName)

public void openPage(String pageName)

Creates new page with document’s size and make it current one.

Parameters:

ParameterTypeDescription
pageNamejava.lang.StringThe name of new page. If it is null the name o the page will be an order number of the page.

closePage()

public void closePage()

Complete current page.

writeGraphicsSave()

public void writeGraphicsSave()

Writes saving of the current graphics state (see PostScript specification on operator “gsave”).

writeGraphicsRestore()

public void writeGraphicsRestore()

Writes restoring of the current graphics state (see PostScript specification on operator “grestore”).

setTransform(AffineTransform matrix)

public void setTransform(AffineTransform matrix)

Set current transformation to this one.

Parameters:

ParameterTypeDescription
matrixjava.awt.geom.AffineTransformThe transformation.

transform(AffineTransform matrix)

public void transform(AffineTransform matrix)

Adds transformation to current graphics state (concatenates this matrix with current one).

Parameters:

ParameterTypeDescription
matrixjava.awt.geom.AffineTransformThe transformation.

translate(float x, float y)

public void translate(float x, float y)

Adds translation to current graphics state (translates current matrix).

Parameters:

ParameterTypeDescription
xfloatThe translation in X direction.
yfloatThe translation in Y direction.

scale(float xScale, float yScale)

public void scale(float xScale, float yScale)

Adds scale to current graphics state (scale current matrix).

Parameters:

ParameterTypeDescription
xScalefloatThe scale in X axis.
yScalefloatThe scale in Y axis.

rotate(float angleRadians)

public void rotate(float angleRadians)

Adds rotation counterclockwise about the origin to current graphics state (rotate current matrix).

Parameters:

ParameterTypeDescription
angleRadiansfloatThe angle of rotation in radians.

rotate(int angleDegrees)

public void rotate(int angleDegrees)

Adds rotation counterclockwise about the origin to current graphics state (rotate current matrix).

Parameters:

ParameterTypeDescription
angleDegreesintThe angle of rotation in degrees.

shear(float shx, float shy)

public void shear(float shx, float shy)

Adds shear transformation to current graphics state (shear current matrix).

Parameters:

ParameterTypeDescription
shxfloatThe shear in X axis.
shyfloatThe shear in Y axis.

clip(Shape s)

public void clip(Shape s)

Adds clip to current graphics state.

Parameters:

ParameterTypeDescription
sjava.awt.ShapeThe clipping path.

clipText(String text, Font font, float x, float y)

public void clipText(String text, Font font, float x, float y)

Adds clip from an outline of given text in given font.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text.
fontjava.awt.FontThe font.
xfloatAn X coordinate of the text position.
yfloat

clipRectangle(Rectangle2D.Float rect)

public void clipRectangle(Rectangle2D.Float rect)

Adds clipping rectangle to current graphics state.

Parameters:

ParameterTypeDescription
rectjava.awt.geom.Rectangle2D.FloatThe clipping rectangle.

clipAndNewPath(Shape s)

public void clipAndNewPath(Shape s)

Adds clip to current graphics state and than writes “newpath” operator. It is necessary to do to escape of confluence of this clipping path and some subsequent pathes such as glyphs outlined with “charpath” operator.

Parameters:

ParameterTypeDescription
sjava.awt.ShapeThe clipping path.

setPaint(Paint paint)

public void setPaint(Paint paint)

Sets paint in current graphics state.

Parameters:

ParameterTypeDescription
paintjava.awt.PaintThe paint. It can be any subclass of Paint class existed in JDK.

getPaint()

public Paint getPaint()

Gets paint in current graphics state.

Returns: java.awt.Paint - Current paint.

setStroke(Stroke stroke)

public void setStroke(Stroke stroke)

Sets stroke in current graphics state.

Parameters:

ParameterTypeDescription
strokejava.awt.StrokeThe stroke.

getStroke()

public Stroke getStroke()

Gets stroke in current graphics state.

Returns: java.awt.Stroke - Current stroke.

fillText(String text, Font font, float x, float y)

public void fillText(String text, Font font, float x, float y)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
fontjava.awt.FontSystem font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

fillText(String text, float[] advances, Font font, float x, float y)

public void fillText(String text, float[] advances, Font font, float x, float y)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
fontjava.awt.FontSystem font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

fillText(String text, DrFont drFont, float x, float y)

public void fillText(String text, DrFont drFont, float x, float y)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

fillText(String text, float[] advances, DrFont drFont, float x, float y)

public void fillText(String text, float[] advances, DrFont drFont, float x, float y)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

fillText(String text, Font font, float x, float y, Paint fill)

public void fillText(String text, Font font, float x, float y, Paint fill)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
fontjava.awt.FontThe font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
filljava.awt.PaintThe fill used for painting glyphs.

fillText(String text, float[] advances, Font font, float x, float y, Paint fill)

public void fillText(String text, float[] advances, Font font, float x, float y, Paint fill)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
fontjava.awt.FontThe font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
filljava.awt.PaintThe fill used for painting glyphs.

fillText(String text, DrFont drFont, float x, float y, Paint fill)

public void fillText(String text, DrFont drFont, float x, float y, Paint fill)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
filljava.awt.PaintThe fill used for painting glyphs.

fillText(String text, float[] advances, DrFont drFont, float x, float y, Paint fill)

public void fillText(String text, float[] advances, DrFont drFont, float x, float y, Paint fill)

Adds a text string by filling interior of glyphs.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
filljava.awt.PaintThe fill used for painting glyphs.

outlineText(String text, Font font, float x, float y)

public void outlineText(String text, Font font, float x, float y)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
fontjava.awt.FontSystem font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

outlineText(String text, float[] advances, Font font, float x, float y)

public void outlineText(String text, float[] advances, Font font, float x, float y)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
fontjava.awt.FontSystem font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

outlineText(String text, DrFont drFont, float x, float y)

public void outlineText(String text, DrFont drFont, float x, float y)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

outlineText(String text, float[] advances, DrFont drFont, float x, float y)

public void outlineText(String text, float[] advances, DrFont drFont, float x, float y)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.

outlineText(String text, Font font, float x, float y, Paint outlinePaint, Stroke stroke)

public void outlineText(String text, Font font, float x, float y, Paint outlinePaint, Stroke stroke)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
fontjava.awt.FontThe font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
outlinePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

outlineText(String text, float[] advances, Font font, float x, float y, Paint outlinePaint, Stroke stroke)

public void outlineText(String text, float[] advances, Font font, float x, float y, Paint outlinePaint, Stroke stroke)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
fontjava.awt.FontThe font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
outlinePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

outlineText(String text, DrFont drFont, float x, float y, Paint outlinePaint, Stroke stroke)

public void outlineText(String text, DrFont drFont, float x, float y, Paint outlinePaint, Stroke stroke)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
outlinePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

outlineText(String text, float[] advances, DrFont drFont, float x, float y, Paint outlinePaint, Stroke stroke)

public void outlineText(String text, float[] advances, DrFont drFont, float x, float y, Paint outlinePaint, Stroke stroke)

Adds a text string by drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
outlinePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

fillAndStrokeText(String text, Font font, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

public void fillAndStrokeText(String text, Font font, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

Adds a text string by filling interior of glyphs and drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
fontjava.awt.FontSystem font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
fillPaintjava.awt.PaintThe fill used for painting glyphs interior.
strokePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

fillAndStrokeText(String text, float[] advances, Font font, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

public void fillAndStrokeText(String text, float[] advances, Font font, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

Adds a text string by filling interior of glyphs and drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add. advances An array of glyphs width. It’s length must comply with the number of glyphs in the string.
advancesfloat[]
fontjava.awt.FontSystem font that will be used to draw text.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
fillPaintjava.awt.PaintThe fill used for painting glyphs interior.
strokePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

fillAndStrokeText(String text, DrFont drFont, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

public void fillAndStrokeText(String text, DrFont drFont, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

Adds a text string by filling interior of glyphs and drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
fillPaintjava.awt.PaintThe fill used for painting glyphs interior.
strokePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

fillAndStrokeText(String text, float[] advances, DrFont drFont, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

public void fillAndStrokeText(String text, float[] advances, DrFont drFont, float x, float y, Paint fillPaint, Paint strokePaint, Stroke stroke)

Adds a text string by filling interior of glyphs and drawing glyphs contours.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text to add.
advancesfloat[]An array of glyphs width. It’s length must comply with the number of glyphs in the string.
drFontcom.aspose.foundation.drawing.DrFontDrFont that will be used to draw text. It can be used with custom font that is located in custom folder.
xfloatX coordinate for text origin.
yfloatY coordinate for text origin.
fillPaintjava.awt.PaintThe fill used for painting glyphs interior.
strokePaintjava.awt.PaintThe java.awt.Paint used for painting glyphs outlines. Can be any subclass of java.awt.Paint class in JDK.
strokejava.awt.StrokeThe stroke used for drawing glyphs contours.

fill(Shape shape)

public void fill(Shape shape)

Fill an arbitrary path.

Parameters:

ParameterTypeDescription
shapejava.awt.ShapeThe path to fill.

draw(Shape shape)

public void draw(Shape shape)

Draw an arbitrary path.

Parameters:

ParameterTypeDescription
shapejava.awt.ShapeThe path to fill.

drawImage(BufferedImage image)

public void drawImage(BufferedImage image)

Draw an image.

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageThe image to draw.

drawImage(BufferedImage image, AffineTransform transform, Color bkg)

public void drawImage(BufferedImage image, AffineTransform transform, Color bkg)

Draw transformed image with background.

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageThe image to draw.
transformjava.awt.geom.AffineTransformThe matrix to transform image.
bkgjava.awt.ColorThe background for the image.

drawTransparentImage(BufferedImage image, AffineTransform transform, int transparencyThreshold)

public void drawTransparentImage(BufferedImage image, AffineTransform transform, int transparencyThreshold)

Draw transformed transparent image with background. If image doesn’t have Alpha channel it will be drawn as opaque image.

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageThe image to draw.
transformjava.awt.geom.AffineTransformThe matrix to transform image.
transparencyThresholdintA threshold that defines from which value of transparency pixel will be interpreted as fully transparent. All values below this threshold will be interpreted as fully opaque.

drawExplicitImageMask(BufferedImage image24bpp, BufferedImage alphaMask1bpp, AffineTransform transform)

public void drawExplicitImageMask(BufferedImage image24bpp, BufferedImage alphaMask1bpp, AffineTransform transform)

Draw masked image.

Parameters:

ParameterTypeDescription
image24bppjava.awt.image.BufferedImageThe image to draw. Must be in 24bpp RGB image format
alphaMask1bppjava.awt.image.BufferedImageThe image mask. Must be in 1bpp image format.
transformjava.awt.geom.AffineTransformThe matrix to transform image.

getNumberOfPages()

public int getNumberOfPages()

Gets a quantity of pages in resulting PDF document.

Returns: int - the number of pages.

merge(String[] filesForMerge, Device device, SaveOptions options)

public void merge(String[] filesForMerge, Device device, SaveOptions options)

Merges PS/EPS files to a device.

Parameters:

ParameterTypeDescription
filesForMergejava.lang.String[]PS/EPS files for merging with this file to an output device.
deviceDeviceAn output device.
optionsSaveOptionsContains flags that specify output of errors thrown during conversion.