/*
i-net software provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties
of merchantability and/or fitness for a particular purpose. This programming example
assumes that you are familiar with the programming language being demonstrated and
the tools used to create and debug procedures. i-net software support professionals
can help explain the functionality of a particular procedure, but they will not modify
these examples to provide added functionality or construct procedures to meet your
specific needs.
© i-net software 1998-2013
*/
using System.Drawing.Printing;
namespace Inet.Viewer.Data
{
///
/// Orientation of the page
///
public enum PageOrientation
{
///
/// Defaul paper orientation
///
DefaultPaperOrientation = 0,
///
/// Potrait orientation
///
Portrait = 1,
///
/// Landscape orientation
///
Landscape = 2
}
///
/// Stores all status information for one page. This information is transmitted for each page.
///
public class PageInfo
{
///
/// 1 inch = 1440 twips, 1/100 inch = TWIPS_OF_INCH100 twips
///
private const float TwipsOfInch100 = 14.4F;
private int pageNr;
private int pageWidth;
private int pageHeight;
private int westBorder;
private int northBorder;
private int eastBorder;
private int southBorder;
private int pageAlign;
private long timestamp;
///
/// Gets and sets the number of this page.
///
internal virtual int PageNr
{
get
{
return pageNr;
}
set
{
this.pageNr = value;
}
}
///
/// Gets and sets the visible Page with without the border in twips.
///
internal virtual int PageWidth
{
get
{
return pageWidth;
}
set
{
this.pageWidth = value;
}
}
///
/// Gets and sets the visisble page without the border in Twips
///
internal virtual int PageHeight
{
get
{
return pageHeight;
}
set
{
this.pageHeight = value;
}
}
///
/// Gets and sets the left border in twips.
///
internal virtual int BorderLeft
{
get
{
return westBorder;
}
set
{
this.westBorder = value;
}
}
///
/// Gets and sets the top border in twips.
///
internal virtual int BorderTop
{
get
{
return northBorder;
}
set
{
this.northBorder = value;
}
}
///
/// Gets and sets the right border in twips.
///
internal virtual int BorderRight
{
get
{
return eastBorder;
}
set
{
this.eastBorder = value;
}
}
///
/// Gets and sets the bottom border in twips.
///
internal virtual int BorderBottom
{
get
{
return southBorder;
}
set
{
this.southBorder = value;
}
}
///
///
///
internal virtual int PageAlign
{
get
{
return pageAlign;
}
set
{
this.pageAlign = value;
}
}
///
/// Gets and sets the timestamp.
///
internal virtual long Timestamp
{
get
{
return timestamp;
}
set
{
this.timestamp = value;
}
}
///
/// Gets the visible PageWidth with Borders
/// + in TWIPS
///
internal int Width
{
get
{
return this.PageWidth + this.BorderLeft + this.BorderRight;
}
}
///
/// Gets the visible Page Height with Borders
/// + in TWIPS
///
internal int Height
{
get
{
return this.PageHeight + this.BorderTop + this.BorderBottom;
}
}
///
/// Gets the margins for printing.
///
public Margins PrintMargins
{
get
{
return new Margins((int)(BorderLeft / TwipsOfInch100), (int)(BorderRight / TwipsOfInch100), (int)(BorderTop / TwipsOfInch100), (int)(BorderBottom / TwipsOfInch100));
}
}
}
}