class Eps (View source)

This Class is EPS Library and helps in developing structure of EPS Schema Export

Properties

string $font
int $fontSize
string $stringCommands

Methods

__construct()

Upon instantiation This starts writing the EPS Document.

void
setTitle(string $value)

Set document title

void
setAuthor(string $value)

Set document author

void
setDate(string $value)

Set document creation date

void
setOrientation(string $orientation)

Set document orientation

void
setFont(string $value, int $size)

Set the font and size

string
getFont()

Get the font

int
getFontSize()

Get the font Size

void
line(int $x_from = 0, int $y_from = 0, int $x_to = 0, int $y_to = 0, int $lineWidth = 0)

Draw the line

void
rect(int $x_from, int $y_from, int $x_to, int $y_to, int $lineWidth)

Draw the rectangle

void
moveTo(int $x, int $y)

Set the current point

void
show(string $text)

Output/Display the text

void
showXY(string $text, int $x, int $y)

Output the text at specified co-ordinates

void
endEpsDoc()

Ends EPS Document

void
showOutput(string $fileName)

Output EPS Document for download

Details

__construct()

Upon instantiation This starts writing the EPS Document.

%!PS-Adobe-3.0 EPSF-3.0 This is the MUST first comment to include it shows/tells that the Post Script document is purely under Document Structuring Convention [DSC] and is Compliant Encapsulated Post Script Document

void setTitle(string $value)

Set document title

Parameters

string $value

sets the title text

Return Value

void

void setAuthor(string $value)

Set document author

Parameters

string $value

sets the author

Return Value

void

void setDate(string $value)

Set document creation date

Parameters

string $value

sets the date

Return Value

void

void setOrientation(string $orientation)

Set document orientation

Parameters

string $orientation

sets the orientation

Return Value

void

void setFont(string $value, int $size)

Set the font and size

font can be set whenever needed in EPS

Parameters

string $value

sets the font name e.g Arial

int $size

sets the size of the font e.g 10

Return Value

void

string getFont()

Get the font

Return Value

string

return the font name e.g Arial

int getFontSize()

Get the font Size

Return Value

int

return the size of the font e.g 10

void line(int $x_from = 0, int $y_from = 0, int $x_to = 0, int $y_to = 0, int $lineWidth = 0)

Draw the line

drawing the lines from x,y source to x,y destination and set the width of the line. lines helps in showing relationships of tables

Parameters

int $x_from

The x_from attribute defines the start left position of the element

int $y_from

The y_from attribute defines the start right position of the element

int $x_to

The x_to attribute defines the end left position of the element

int $y_to

The y_to attribute defines the end right position of the element

int $lineWidth

Sets the width of the line e.g 2

Return Value

void

void rect(int $x_from, int $y_from, int $x_to, int $y_to, int $lineWidth)

Draw the rectangle

drawing the rectangle from x,y source to x,y destination and set the width of the line. rectangles drawn around the text shown of fields

Parameters

int $x_from

The x_from attribute defines the start left position of the element

int $y_from

The y_from attribute defines the start right position of the element

int $x_to

The x_to attribute defines the end left position of the element

int $y_to

The y_to attribute defines the end right position of the element

int $lineWidth

Sets the width of the line e.g 2

Return Value

void

void moveTo(int $x, int $y)

Set the current point

The moveto operator takes two numbers off the stack and treats them as x and y coordinates to which to move. The coordinates specified become the current point.

Parameters

int $x

The x attribute defines the left position of the element

int $y

The y attribute defines the right position of the element

Return Value

void

void show(string $text)

Output/Display the text

Parameters

string $text

The string to be displayed

Return Value

void

void showXY(string $text, int $x, int $y)

Output the text at specified co-ordinates

Parameters

string $text

String to be displayed

int $x

X attribute defines the left position of the element

int $y

Y attribute defines the right position of the element

Return Value

void

void endEpsDoc()

Ends EPS Document

Return Value

void

void showOutput(string $fileName)

Output EPS Document for download

Parameters

string $fileName

name of the eps document

Return Value

void