Printing an empty page

Hi,

I am showing print page with dotted lines on the view. When I place
a GoDiagram object too close to this dotted line(object.Right<10 pixels from dotted line), print preview shows an empty second page in addition to the first page and prints an empty second page along with original first page. Could you tell me whether this is the expected behavior or am I missing something.
Thanks/-

Is the dotted line from a GoGrid? or are you drawing it to show the edge of the page?

Hi,

The dotted line is from the GoGrid. Following code snippet was used
to draw this.

PrintDocument pd = new PrintDocument();

PageSettings ps = pd.DefaultPageSettings;

int paperw = ps.PaperSize.Width;

int paperh = ps.PaperSize.Height;

int pagew = paperw-ps.Margins.Left-ps.Margins.Right;

int pageh = paperh-ps.Margins.Top-ps.Margins.Bottom;

float viewscale = aGoView.PrintScale;

aGoView.GridCellSize = new SizeF(pagew/viewscale, pageh/viewscale);

aGoView.GridOrigin = aGoView.PrintDocumentTopLeft;

aGoView.GridStyle = GoViewGridStyle.Line;

aGoView.GridPenDashStyle = DashStyle.Dash;

aGoView.GridColor = Color.Black;

aGoView.Document.Changed += new GoChangedEventHandler(this.aDocument_Changed);

Thanks/.

Yes, expected behavior. When you aren’t using Sheets, GoView.PrintDocumentSize will call Document.ComputeBounds to get the size of the rectangle to print. ComputeBounds include a call to GoObject.ExpandPaintBounds, which can bump the painting area of a GoObject to be a few pixels more than what you see on the screen.

Hi,

I am setting
m_View.SheetStyle = GoViewSheetStyle.Sheet;
in my code. Is it possible to achive my requirement by customizing sheet/view.
Thanks/.

You could override GoView.ComputeDocumentBounds to return a slightly smaller value.