Rhinocommon Save image of layout pageview instead of PDF

Is there a way to save out an image ( jpg, png, whatever ) from a layout pageview? I can save out the pageview to a PDF, but I need to get an image as well.

I know that I can use layout.PageView.CaptureToBitmap , but this doesn’t capture the same print area and it has the bad background color of the layout view.

Here is how I save out the pdf from my layout. Is there a way to save out an image in a similar way?

        var sheetPdf = Rhino.FileIO.FilePdf.Create();
        var size = partParams.layout.PageView.Size;
        var sheetCapture = new Rhino.Display.ViewCaptureSettings(partParams.layout.PageView, 300);
        sheetPdf.AddPage(sheetCapture);
        sheetPdf.Write(sheetPath);

Hi @jake1,

Try capturing the view to a bitmap. Then draw the bitmap onto a page.

– Dale

1 Like