Improved printing
This commit is contained in:
parent
98e0a1ffdb
commit
f98c616fc3
@ -118,6 +118,12 @@
|
||||
}
|
||||
|
||||
@media print {
|
||||
@page {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
#inputArea {
|
||||
display: none;
|
||||
}
|
||||
|
13
analyser.js
13
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;
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
<script src="analyser.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<link rel="stylesheet" href="analyser.css" type="text/css" />
|
||||
<title>Wiredraw Setup Analyser</title>
|
||||
<title id="pageTitle">Wiredraw Setup Analyser</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
Loading…
x
Reference in New Issue
Block a user