Rasterex APINPM Package/docs/components/files/print-portion

Print Portion

Select an area of the current drawing, preview the crop, and choose its print size.

Select and Preview an Area

Open the sample drawing in the demo and choose Print Portion from the parent toolbar.

  • 1Drag a rectangle around the area you want to print. Releasing the pointer opens the preview.
  • 2Choose Fit to page to scale the selection to the printable area, or Selection size to use the selected area’s dimensions when they fit within the page margins. Check the printed area shown in the preview.
  • 3Choose Select again to redraw the rectangle, Cancel to return to the drawing, or Print to open your browser’s print dialog. If the browser offers Save as PDF, you can save the selection there.
A selection rectangle on the workshop floor plan with a Cancel control.
Select the part of the drawing to print
Print preview showing the selected drawing area, the Print size setting, and the printed dimensions.
Review the selection and choose the print size

Start from the Parent Toolbar

Wait for viewer.ready() and the document to open. Enable the button when viewer.getInfo().capabilities includes printPortion.

Call viewer.tools.startPrintPortion() from the button handler. Disable the button while the request is pending and display any error in the parent.

typescript
// In the parent toolbar handler, after the document opens.
if (viewer.getInfo().capabilities?.includes("printPortion")) {
  await viewer.tools.startPrintPortion();
}
Start from the Parent Toolbar

Handle the Selection Result

The method accepts optional requestId and timeoutMs. It resolves with { success: true, requestId } once Canvas starts selection. The SDK exposes no completion event for printing or cancellation.

The Export & Print page covers whole-document printing and export.