ICanvasSceneGraphProvider[] sgProvider = { null };
CanvasContext ctx = new CanvasContext(thread);
+ ctx.getDefaultHintContext().setHint(Hints.KEY_DISABLE_GRAPH_MODIFICATIONS, Boolean.TRUE);
try {
final Semaphore done = new Semaphore(0);
ThreadUtils.asyncExec(thread, () -> {
try {
- PDFBuilder chassis = new PDFBuilder(writer, mapper, pageSize, pageDesc, fitDiagramContentsToPageMargins || isSymbol);
+ boolean fitToContent = fitDiagramContentsToPageMargins || isSymbol;
+ if (!fitToContent) {
+ // 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.
+ ctx.getDefaultHintContext().setHint(Hints.KEY_DISPLAY_PAGE, false);
+ }
+
+ PDFBuilder chassis = new PDFBuilder(writer, mapper, pageSize, pageDesc, fitToContent);
chassis.paint(ctx, true);
} catch (Throwable e) {
exception[0] = new DatabaseException(e);