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(String psFilePath)Initializes PsDocument with an input PS/EPS file.
PsDocument(InputStream psStream)Initializes PsDocument with a stream of PS/EPS file.

Methods

MethodDescription
clip(Shape s)Adds clip to current graphics state.
clipAndNewPath(Shape s)Adds clip to current graphics state and than writes “newpath” operator.
clipRectangle(Rectangle2D.Float rect)Adds clipping rectangle to current graphics state.
clipText(String text, Font font, float x, float y)Adds clip from an outline of given text in given font.
closePage()Complete current page.
cropEps(OutputStream epsStream, float[] cropBox)Crops given PsDocument as EPS file.
draw(Shape shape)Draw an arbitrary path.
drawExplicitImageMask(BufferedImage image24bpp, BufferedImage alphaMask1bpp, AffineTransform transform)Draw masked image.
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.
equals(Object arg0)
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.
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.
extractText(SaveOptions options, int startPage, int endPage)Extracts text from PS file.
fill(Shape shape)Fill an arbitrary path.
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.
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, 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.
fillText(String text, DrFont drFont, float x, float y)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)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.
fillText(String text, float[] advances, 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, Paint fill)Adds a text string by filling interior of glyphs.
fillText(String text, Font font, 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.
getClass()
getInputStream()
getNumberOfPages()Gets a quantity of pages in resulting PDF document.
getPaint()Gets paint in current graphics state.
getStroke()Gets stroke in current graphics state.
getXmpMetadata()Reads PS/EPS file and extracts XmpMetdata if it already exists or add new one if it doesn’t exist.
hashCode()
isLicensed()Indicates whether Aspose.Page for Java product license is accessed and valid.
merge(String[] filesForMerge, Device device, SaveOptions options)Merges PS/EPS files to a device.
mergeToPdf(OutputStream pdfStream, String[] filesForMerge, SaveOptions options)Merges PS/EPS files to a device.
mergeToPdf(String outPdfFilePath, String[] filesForMerge, SaveOptions options)Merges PS/EPS files to a device.
notify()
notifyAll()
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.
outlineText(String text, DrFont drFont, float x, float y)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)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.
outlineText(String text, float[] advances, 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, Paint outlinePaint, Stroke stroke)Adds a text string by drawing glyphs contours.
outlineText(String text, Font font, 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.
resizeEps(OutputStream epsStream, DimensionF newSizeInUnits, Units units)Resizes given PsDocument as EPS file.
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).
save()Saves given PsDocument as PS file.
save(Device device, SaveOptions options)Saves PS/EPS file to a device.
save(OutputStream epsStream)Saves given PsDocument as EPS file.
saveAsImage(ImageSaveOptions options)Saves PS/EPS file to images bytes arrays.
saveAsPdf(OutputStream pdfStream, PdfSaveOptions options)Saves PS/EPS file to an output PDF stream.
saveAsPdf(String outPdfFilePath, PdfSaveOptions options)Saves PS/EPS file to PDF file.
saveImageAsEps(BufferedImage image, OutputStream epsStream, PsSaveOptions options)Saves BufferedImage object to EPS file.
saveImageAsEps(BufferedImage image, String epsFilePath, PsSaveOptions options)Saves BufferedImage object to 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.
scale(float xScale, float yScale)Adds scale to current graphics state (scale current matrix).
setInputStream(InputStream is)Specifies an input stream.
setPageDevice(Map<String,Object> pageParams)Sets page device parameters (see operator “setpagedevice” PostScript spesification).
setPageSize(float width, float height)Sets page size.
setPaint(Paint paint)Sets paint in current graphics state.
setStroke(Stroke stroke)Sets stroke in current graphics state.
setTransform(AffineTransform matrix)Set current transformation to this one.
shear(float shx, float shy)Adds shear transformation to current graphics state (shear current matrix).
toString()
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).
wait()
wait(long arg0)
wait(long arg0, int arg1)
writeGraphicsRestore()Writes restoring of the current graphics state (see PostScript specification on operator “grestore”).
writeGraphicsSave()Writes saving of the current graphics state (see PostScript specification on operator “gsave”).

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(String psFilePath)

public PsDocument(String psFilePath)

Initializes PsDocument with an input PS/EPS file.

Parameters:

ParameterTypeDescription
psFilePathjava.lang.StringPS/EPS file path.

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.

clip(Shape s)

public void clip(Shape s)

Adds clip to current graphics state.

Parameters:

ParameterTypeDescription
sjava.awt.ShapeThe clipping path.

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.

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.

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

closePage()

public void closePage()

Complete current page.

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).

draw(Shape shape)

public void draw(Shape shape)

Draw an arbitrary path.

Parameters:

ParameterTypeDescription
shapejava.awt.ShapeThe path to fill.

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.

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.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

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.

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.

extractText(SaveOptions options, int startPage, int endPage)

public String extractText(SaveOptions options, int startPage, int endPage)

Extracts text from PS file. It works only for text that is written with TrueType fonts (Type 42) or composite fonts (Type 0) that consists of TrueType fonts.

Parameters:

ParameterTypeDescription
optionsSaveOptionsThe save options.
startPageintThe page from which inclusively to start to extract text.
endPageintThe page to which inclusively to extract text.

Returns: java.lang.String - The text contained in the selected pages of PS file.

fill(Shape shape)

public void fill(Shape shape)

Fill an arbitrary path.

Parameters:

ParameterTypeDescription
shapejava.awt.ShapeThe path to fill.

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.

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, 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.

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, 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)

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, 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.

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, 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, 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, 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.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getInputStream()

public InputStream getInputStream()

Returns: java.io.InputStream

getNumberOfPages()

public int getNumberOfPages()

Gets a quantity of pages in resulting PDF document.

Returns: int - the number of pages.

getPaint()

public Paint getPaint()

Gets paint in current graphics state.

Returns: java.awt.Paint - Current paint.

getStroke()

public Stroke getStroke()

Gets stroke in current graphics state.

Returns: java.awt.Stroke - Current stroke.

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.

hashCode()

public native int hashCode()

Returns: int

isLicensed()

public boolean isLicensed()

Indicates whether Aspose.Page for Java product license is accessed and valid.

Returns: boolean - boolean value

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.

mergeToPdf(OutputStream pdfStream, String[] filesForMerge, SaveOptions options)

public void mergeToPdf(OutputStream pdfStream, String[] filesForMerge, SaveOptions options)

Merges PS/EPS files to a device.

Parameters:

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

mergeToPdf(String outPdfFilePath, String[] filesForMerge, SaveOptions options)

public void mergeToPdf(String outPdfFilePath, String[] filesForMerge, SaveOptions options)

Merges PS/EPS files to a device.

Parameters:

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

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

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.

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, 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)

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, 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.

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, 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, 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, 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.

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.

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.

save()

public void save()

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

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.

saveAsImage(ImageSaveOptions options)

public byte[][] saveAsImage(ImageSaveOptions options)

Saves PS/EPS file to images bytes arrays.

Parameters:

ParameterTypeDescription
optionsImageSaveOptionsContains necessary parameters for saving image and flags that specify output of errors thrown during conversion.

Returns: byte[][] - Images bytes. One byte array for one page.

saveAsPdf(OutputStream pdfStream, PdfSaveOptions options)

public void saveAsPdf(OutputStream pdfStream, PdfSaveOptions options)

Saves PS/EPS file to an output PDF stream.

Parameters:

ParameterTypeDescription
pdfStreamjava.io.OutputStreamAn output PDF stream.
optionsPdfSaveOptionsContains flags that specify output of errors thrown during conversion.

saveAsPdf(String outPdfFilePath, PdfSaveOptions options)

public void saveAsPdf(String outPdfFilePath, PdfSaveOptions options)

Saves PS/EPS file to PDF file.

Parameters:

ParameterTypeDescription
outPdfFilePathjava.lang.StringAn output PDF file path.
optionsPdfSaveOptionsContains flags 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.

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(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.

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.

setInputStream(InputStream is)

public void setInputStream(InputStream is)

Specifies an input stream.

Parameters:

ParameterTypeDescription
isjava.io.InputStreamInput stream of PS/EPS 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.

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.

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.

setStroke(Stroke stroke)

public void setStroke(Stroke stroke)

Sets stroke in current graphics state.

Parameters:

ParameterTypeDescription
strokejava.awt.StrokeThe stroke.

setTransform(AffineTransform matrix)

public void setTransform(AffineTransform matrix)

Set current transformation to this one.

Parameters:

ParameterTypeDescription
matrixjava.awt.geom.AffineTransformThe transformation.

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.

toString()

public String toString()

Returns: java.lang.String

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.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int

writeGraphicsRestore()

public void writeGraphicsRestore()

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

writeGraphicsSave()

public void writeGraphicsSave()

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