octomode/templates/pdf.html

31 lines
875 B
HTML
Raw Permalink Normal View History

{% extends "base.html" %}
2022-01-12 21:27:06 +01:00
{% block content %}
<iframe id="pdf" name="pdf" src="{{ url }}"></iframe>
2022-01-12 21:27:06 +01:00
{% endblock %}
{% block footer %}
<script>
function printPage(){
window.frames["pdf"].focus();
window.frames["pdf"].print();
}
window.addEventListener('load', function () {
// Load the main.css again, to load the stylesheet for the nav
var cssLink = document.createElement('link');
cssLink.rel = 'stylesheet';
cssLink.href = '{{ url_for("static", filename="main.css") }}';
2022-01-12 21:27:06 +01:00
var head = document.getElementsByTagName('head')[0];
head.insertBefore(cssLink, head.firstChild);
// Insert the SAVE button
const nav = document.getElementById('buttons');
const save = '<a href="#"><button id="save" onClick="printPage()">save</button></a>';
nav.innerHTML = nav.innerHTML + save;
})
</script>
{% endblock %}