PsDocument class

PsDocument class

This class encapsulates PS/EPS documents.

Inheritance: PsDocumentDocument

The PsDocument type exposes the following members:

Constructors

ConstructorDescription
initInitializes empty PsDocument with initialized page.
initInitializes empty PsDocument.
initInitializes empty PsDocument when the number of Postscript document pages is known in advance.
initInitializes PsDocument with a stream of PS/EPS file.

Properties

PropertyDescription
number_of_pagesReturns the number of pages in resulting PDF document.

Methods

MethodDescription
saveSaves PS/EPS file to a device.
saveSaves 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.
saveSaves given PsDocument as EPS file. This method is used only when PsDocument was created from scratch.
save_image_as_epsSaves PNG/JPEG/TIFF/BMP/GIF/EMF image from input stream to EPS output stream.
save_image_as_epsSaves PNG/JPEG/TIFF/BMP/GIF/EMF image from file to EPS file.
save_image_as_epsSaves Bitmap object to EPS file.
save_image_as_epsSaves Bitmap object to EPS output stream.
open_pageCreates new page and make it current one.
open_pageCreates new page with document’s size and make it current one.
rotateAdds rotation counterclockwise about the origin to current graphics state (rotate current matrix).
rotateAdds rotation counterclockwise about the origin to current graphics state (rotate current matrix).
fill_textAdds a text string by filling interrior of glyphs.
fill_textAdds a text string by filling interrior of glyphs.
fill_textAdds a text string by filling interrior of glyphs.
fill_textAdds a text string by filling interrior of glyphs.
fill_textAdds a text string by filling interrior of glyphs.
fill_textAdds a text string by filling interrior of glyphs.
fill_textAdds a text string by filling interrior of glyphs.
fill_textAdds a text string by filling interrior of glyphs.
outline_textAdds a text string by drawing glyphs contours.
outline_textAdds a text string by drawing glyphs contours.
outline_textAdds a text string by drawing glyphs contours.
outline_textAdds a text string by drawing glyphs contours.
outline_textAdds a text string by drawing glyphs contours.
outline_textAdds a text string by drawing glyphs contours.
outline_textAdds a text string by drawing glyphs contours.
outline_textAdds a text string by drawing glyphs contours.
fill_and_stroke_textAdds a text string by filling interrior of glyphs and drawing glyphs contours.
fill_and_stroke_textAdds a text string by filling interrior of glyphs and drawing glyphs contours.
fill_and_stroke_textAdds a text string by filling interrior of glyphs and drawing glyphs contours.
fill_and_stroke_textAdds a text string by filling interrior of glyphs and drawing glyphs contours.
draw_polylineDraws a polyline.
draw_polylineDraws a polyline.
draw_polygonDraws a polygon.
draw_polygonDraws a poligone.
fill_polygonFills a poligone.
fill_polygonFills a poligone.
draw_imageDraw image.
draw_imageDraw transformed image with background.
get_xmp_metadataReads PS/EPS file and extracts XmpMetdata if it already exists or add new one if it doesn’t exist.
extract_eps_sizeReads EPS file and extracts a size of EPS image from %%BoundingBox comment or default page size (595, 842) if it doesn’t exist.
resize_epsResizes 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.
extract_eps_bounding_boxReads 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.
crop_epsCrops given PsDocument as EPS file.
It saves initial EPS file with updated existing %%BoundingBox or new one will be created.
set_page_sizeSets page size. To create pages with different sizes in one document use PsDocument.SetPageDevice
method just after this method.
close_pageComplete current page.
write_graphics_saveWrites saving of the current graphics state (See PostScript specification on operator “gsave”).
write_graphics_restoreWrites restoring of the current graphics state (See PostScript specification on operator “grestore”).
set_transformSet current transformation to this one.
transformAdds transformation to current graphics state (concatenates this matrix with current one).
translateAdds translation to current graphics state (translates current matrix).
scaleAdds scale to current graphics state (scale current matrix).
shearAdds shear transformation to current graphics state (shear current matrix).
clipAdds clip to current graphics state.
clip_textAdds clip from an outline of given text in given font.
clip_rectangleAdds clipping rectangle to current graphics state.
clip_and_new_pathAdds 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.
set_paintSets paint in current graphics state.
get_paintGets paint of current graphics state.
set_strokeSets stroke in current graphics state.
get_strokeGets stroke of current graphics state.
fillFill an arbitrary path.
drawDraw an arbitrary path.
draw_arcDraws an arc.
draw_lineDraws a line segment.
draw_ovalDraws an oval.
draw_rectDraws a rectangle.
draw_round_rectDraws a round rectangle.
fill_arcFills an arc.
fill_ovalFills an oval.
fill_rectFills a rectangle.
fill_round_rectFills a round rectangle.
draw_transparent_imageDraw transformed transparent image. If image doesn’t have Alpha channel it will be drawn as opaque image
draw_explicit_image_maskDraw masked image.
mergeMerges PS/EPS files to a device.

See Also