diff --git a/src/component/plotly-dash-preview/parse.js b/src/component/plotly-dash-preview/parse.js index 454ee64c..83a62bf2 100644 --- a/src/component/plotly-dash-preview/parse.js +++ b/src/component/plotly-dash-preview/parse.js @@ -44,6 +44,10 @@ function parse (body, req, opts, sendToRenderer) { width: body.pageSize.width * cst.pixelsInMicron, height: body.pageSize.height * cst.pixelsInMicron } + result.pdfOptions.pageSize = { + width: Math.ceil(body.pageSize.width), + height: Math.ceil(body.pageSize.height) + } } else { return errorOut( 400, diff --git a/test/unit/plotly-dash-preview_test.js b/test/unit/plotly-dash-preview_test.js index 90230dd7..30756d25 100644 --- a/test/unit/plotly-dash-preview_test.js +++ b/test/unit/plotly-dash-preview_test.js @@ -54,6 +54,10 @@ tap.test('parse:', t => { height: 3.779527559055118, width: 3.779527559055118 }) + t.same(result.pdfOptions.pageSize, { + height: 1000, + width: 1000 + }) t.end() }) })