Improved printing
This commit is contained in:
parent
98e0a1ffdb
commit
f98c616fc3
@ -118,6 +118,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
|
@page {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
#inputArea {
|
#inputArea {
|
||||||
display: none;
|
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"
|
} else { // re-format the number if it's 'wrong' i.e. "130"
|
||||||
outputSize = outputSize / 1000;
|
outputSize = outputSize / 1000;
|
||||||
}
|
}
|
||||||
console.log(outputSize);
|
|
||||||
var outputText = outputSize + "\" (" + toMillimetres(outputSize) + " mm)";
|
var outputText = outputSize + "\" (" + toMillimetres(outputSize) + " mm)";
|
||||||
|
|
||||||
|
// Create and set the header
|
||||||
subtitle.innerHTML = "For " + inputText + " to " + outputText;
|
subtitle.innerHTML = "For " + inputText + " to " + outputText;
|
||||||
reductionCount.innerHTML = "Across " + numDies + " reductions";
|
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();
|
window.print();
|
||||||
|
|
||||||
|
// Reset the page title back to normal
|
||||||
|
pageTitle.innerHTML = title;
|
||||||
}
|
}
|
@ -7,7 +7,7 @@
|
|||||||
<script src="analyser.js"></script>
|
<script src="analyser.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
<link rel="stylesheet" href="analyser.css" type="text/css" />
|
<link rel="stylesheet" href="analyser.css" type="text/css" />
|
||||||
<title>Wiredraw Setup Analyser</title>
|
<title id="pageTitle">Wiredraw Setup Analyser</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user