+ if (!fitDiagramContentsToPageMargins) {
+ // Prevent PDF printing from drawing page borders if the
+ // print area is fitted directly to the page size.
+ // This avoids unwanted black half-visible edges.
+ cctx.getDefaultHintContext().setHint(Hints.KEY_DISPLAY_PAGE, false);
+ }