renderanje pdfjev z pdfobject deluje

master
Kostanjevec 2022-06-03 19:13:23 +02:00
parent 418d8b2b70
commit e1295a3840
2 changed files with 16 additions and 0 deletions

View File

@ -131,4 +131,8 @@ html {
input[type=submit] {
align-self: start;
min-width: 10em;
}
#pdf-doc {
height: calc(100vh - 332px);
}

View File

@ -12,6 +12,11 @@
<header>
<h1>{{ card['title'] }}</h1>
</header>
<!--iframe src={{ card['item_location'] }} width="auto" height="auto"> </iframe-->
<div id="pdf-doc"></div>
<form method="post">
<button input type="submit" name="rate" data-cardtitle=card[title] value="Yes">Yes</button>
<button input type="submit" name="rate" value="Maybe">Maybe</button>
@ -19,4 +24,11 @@
</form>
</div>
</article>
<script type="text/javascript" src="{{ url_for('static', filename='js/pdfobject.min.js') }}"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function (){
PDFObject.embed("{{ card['item_location'] }}", "#pdf-doc");
});
</script>
{% endblock %}