Print WYSIWYG

I would like to print what is currently displayed in the view. Therefore depending on my zoom factor, the contents on the print output will vary. How can I accomplish this? I read about GoView.PrintView but I am not sure how to use it.

Just before you call GoView.Print() or GoView.PrintPreview(), set GoView.PrintScale to the current value of GoView.DocScale.

Thanks for the suggestion. I experimented a bit and it’s not what I have in mind because I want to Print and PrintPreview only what I see on the screen (true wysiwyg). Sizing the print scale would give me multi-page that I have to flip through. In addition, the “cut” lines don’t necessarily match up with what I see on the screen.
Incidently I was able to exactly this by dumping it to a bit map using the following code snipets. Now I just need to be able to print with nice border and everything hence I am thinking using GoView’s builtin support.
public Bitmap GetBitmapRegion()
{
Rectangle dispRect = this.DisplayRectangle;
Bitmap buf = new Bitmap(dispRect.Width, dispRect.Height);
Graphics gbuf = Graphics.FromImage(buf);
gbuf.ScaleTransform(this.DocScale, this.DocScale);
PointF viewLoc = this.DocPosition;
gbuf.TranslateTransform(-viewLoc.X, -viewLoc.Y);
PaintView(gbuf, new RectangleF(viewLoc, ConvertViewToDoc(dispRect.Size)));
gbuf.Dispose();
return buf;
}
Any help would be greatly appreciated.
Tuan

Oh, I see what you mean.
The problem with using bitmaps is that they will not print with the higher resolution that printers usually offer.
Instead you should override GoView.PrintDocumentTopLeft to return GoView.DocPosition and override GoView.PrintDocumentSize to return GoView.DocExtentSize. That way the printer will only print the portion of the document that is visible in the GoView.
public override PointF PrintDocumentTopLeft {
get { return this.DocPosition; }
}
public override SizeF PrintDocumentSize {
get { return this.DocExtentSize; }
}
You can still set (or override) GoView.PrintScale to make sure it fits on the page within the margins, in case the GoView is fairly large or in case the page is fairly small.