diff --git a/analyser.css b/analyser.css index 2395ac2..1901e87 100644 --- a/analyser.css +++ b/analyser.css @@ -118,6 +118,12 @@ } @media print { + @page { + margin-top: 0; + margin-bottom: 0; + margin-right: 0; + margin-left: 0; + } #inputArea { display: none; } diff --git a/analyser.js b/analyser.js index 49a9cdb..d3ed000 100644 --- a/analyser.js +++ b/analyser.js @@ -315,11 +315,20 @@ function printScreen() { } else { // re-format the number if it's 'wrong' i.e. "130" outputSize = outputSize / 1000; } - console.log(outputSize); var outputText = outputSize + "\" (" + toMillimetres(outputSize) + " mm)"; - + // Create and set the header subtitle.innerHTML = "For " + inputText + " to " + outputText; reductionCount.innerHTML = "Across " + numDies + " reductions"; + + // Change the name of the window to save the file with the same + var pageTitle = document.getElementById("pageTitle"); + var title = pageTitle.innerHTML; + pageTitle.innerHTML = "Draft Analysis for " + inputSize + " to " + outputSize; + + // Let the browser handle printing window.print(); + + // Reset the page title back to normal + pageTitle.innerHTML = title; } \ No newline at end of file diff --git a/index.html b/index.html index 9ae8fd1..9b0e23f 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - Wiredraw Setup Analyser + Wiredraw Setup Analyser