Files
Web-Printing-Toolkit/index.html
TheGreydiamond 7b45a854fe inital commit
2025-08-18 20:02:43 +02:00

45 lines
1.5 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Printing Toolkit</title>
<style>
* {
font-family: 'Noto Sans JP', sans-serif;
}
canvas {
border: 1px solid black;
}
</style>
</head>
<body>
<h1>Welcome to the Printing Toolkit Demo</h1>
<p>
This is a very minimal demo of how to print from a browser via IPP. This is used to "bypass" the browsers printing dialog in scenarios where it might cause issues (like kiosk applications).
This demo allows you to enter a text and it will be written onto a canvas of 400px by 400px.
Clicking "Print now!" will start a print job. You can check the console for more details.
A common issue you might encounter is a CORS violation, you can read more about it in the README.MD
</p>
<label for="input_text">Text:</label>
<input id="input_text" type="text">
<br>
<button id="btn_print">Print now!</button>
<br>
<hr>
<canvas id="print_canvas" width="800" height="600"></canvas>
<!-- Load the Printing Handler -->
<script type="module">
import { doIPPprint, testModule } from "./js/print_handler.js";
window.printViaIPP = doIPPprint; // Expose function to other JavaScript files using the global window
console.log("Module loaded");
testModule(); // Should show "Print Handler running" in the console
</script>
<script src="js/content_handler.js"></script>
</body>
</html>