Script Reference : Sheet

A Sheet object represents final sheet of paper.

Data Members
Name Type Description
selected bool Sheet selection status.
front bool true for front faces and false for back ones.

 

Constructors
Name Description
  Sheet Object is the part of Layout can be retrieved or created by Layout methods only.

 

Methods
Name Return Type Description
void EnsureVisible()   Ensures that a sheet of paper is at least partially visible in the main print preview window.
bool IsAnySelected() bool Returns true in case is sheet of at least one page on the sheet is selected.
bool SaveAs(string file [, Table params]) bool Save page as image. Type of image is defined by file extension. Rect and other Extra parameters could be provided in optional table:
dpi DPI. 300 is default.
JPEGquality JPEG quality, from 0 to 1.
rect Source rectangle in mm, in paper space. Full paper sheet is default choice.
type File type. By default file extension is used but you may specify another file type. Possible types are: "JPEG" (or "JPG"), "PNG", "TGA", "BMP", "TIFF" (or "TIF")
See example
Metrics
Point GetSize()
Point Retrieves the size of the paper sheet.
Point GetAreaSize() Point Returns size of printable area.
Point GetAreaOrg() Point Returns origin of printable area.
Rect GetArea() Rect Returns rectangle of the page printable area.
Sub Pages
int GetNumPages()
int Gets the number of source pages located on  this sheet of paper.
Page GetPage(int) Page Returns the specified page in this paper sheet.
GetPageRect Rect Not implemented yet
Point GetPagePos(int i/ Page)
Point The GetPagePos method gets the offset point currently set for the page transformation.
float GetPageScale(int/Page) float The GetPageScale method gets the scaling factor currently set for the page transformation of this paper sheet. The page transformation converts page coordinates to paper coordinates. 1.0 - means 1 to 1 transformation, i.e. no rescaling.
bool SetPagePos(int index/Page, Point pos) bool The SetPagePos method sets the offset point currently set for the page transformation.
bool SetPageScale(int index/Page, float scale); bool The SetPageScale method sets the scaling factor for the page transformation.
int InsertPage(Page) int Inserts source page into this sheet of paper. Returns zero based index on inserted page.
bool DeletePage(int index/Page); bool Removes page from this sheet of paper.

Following methods are available for form pages:

GetAreaSizeF, GetAreaOrgF, GetAreaF, GetNumPagesF, GetPageF, GetPagePosF, GetPageScaleF, SetPagePosF, SetPageScaleF, InsertPageF, DeletePageF

They are fully equal to regular methods, but work with form pages or form layout.

 

Sheet::SaveAs

local paper=layout.GetSheet(0);
local r=Rect(29,21,147,68);
//local opt={dpi=150,JPEGquality=0.05,rect=r,type="jpg"};
local opt={dpi=150,rect=r};
paper.SaveAs("c:/temp/page1.png",opt);