Collective PDF rendering environment (work-in-progress)
https://cc.vvvvvvaria.org/wiki/Octomode
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
875 B
30 lines
875 B
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<iframe id="pdf" name="pdf" src="{{ url }}"></iframe>
|
|
{% 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") }}';
|
|
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 %}
|
|
|