diff --git a/lib/widgets/blocks/print.js b/lib/widgets/blocks/print.js index c02bfd59..c5e05a1c 100644 --- a/lib/widgets/blocks/print.js +++ b/lib/widgets/blocks/print.js @@ -113,7 +113,9 @@ var ExecutePrintInstance = function (props) { }, []); // Create printable element var printElem = react_1.useMemo(function () { - return printCtx.renderChildBlock(printCtx, props.blockDef.content); + // Create element at 96 dpi (usual for browsers) and 7.5" across (letter - 0.5" each side). 1440 is double, so scale down + return React.createElement("div", { style: { transform: "scale(0.5)", transformOrigin: "top left" } }, + React.createElement("div", { style: { width: 1440 } }, printCtx.renderChildBlock(printCtx, props.blockDef.content))); }, [printCtx]); // Perform print after delay of waiting for no queries react_1.useEffect(function () { diff --git a/lib/widgets/blocks/toc/TOCInstanceComp.js b/lib/widgets/blocks/toc/TOCInstanceComp.js index 5d9529ef..e7f0b604 100644 --- a/lib/widgets/blocks/toc/TOCInstanceComp.js +++ b/lib/widgets/blocks/toc/TOCInstanceComp.js @@ -50,10 +50,10 @@ function TOCInstanceComp(props) { if (item.id === selectedId) { itemLabelStyle.backgroundColor = "#DDD"; } - return react_2.default.createElement("div", null, - react_2.default.createElement("div", { onClick: handleItemClick.bind(null, item), style: itemLabelStyle }, localization_1.localize(item.label, instanceCtx.locale)), + return react_2.default.createElement("div", { key: item.id }, + react_2.default.createElement("div", { key: "label", onClick: handleItemClick.bind(null, item), style: itemLabelStyle }, localization_1.localize(item.label, instanceCtx.locale)), item.children.length > 0 ? - react_2.default.createElement("div", { style: { marginLeft: 10 } }, item.children.map(function (child, index) { return renderItem(item.children, index, depth + 1); })) + react_2.default.createElement("div", { key: "children", style: { marginLeft: 10 } }, item.children.map(function (child, index) { return renderItem(item.children, index, depth + 1); })) : null); }; var renderLeft = function () { diff --git a/src/widgets/blocks/print.tsx b/src/widgets/blocks/print.tsx index 4cd3d0f7..295d387f 100644 --- a/src/widgets/blocks/print.tsx +++ b/src/widgets/blocks/print.tsx @@ -116,7 +116,12 @@ const ExecutePrintInstance = (props: { // Create printable element const printElem = useMemo(() => { - return printCtx.renderChildBlock(printCtx, props.blockDef.content) + // Create element at 96 dpi (usual for browsers) and 7.5" across (letter - 0.5" each side). 1440 is double, so scale down + return