PDF renderer: Place hidden text inside page rect

This commit is contained in:
Raphael Michel
2023-03-10 14:26:50 +01:00
parent 71e6a85c38
commit 1ff8c6f78b
2 changed files with 4 additions and 4 deletions

View File

@@ -777,16 +777,16 @@ class Renderer:
qr_y = float(o['bottom']) * mm
renderPDF.draw(d, canvas, qr_x, qr_y)
# Add QR content + PDF issuer as a hidden string (fully transparent & off page)
# Add QR content + PDF issuer as a hidden string (fully transparent & very very small)
# This helps automated processing of the PDF file by 3rd parties, e.g. when checking tickets for resale
data = {
"issuer": settings.SITE_URL,
o.get('content', 'secret'): content
}
canvas.saveState()
canvas.setFont('Open Sans', 1)
canvas.setFont('Open Sans', .01)
canvas.setFillColorRGB(0, 0, 0, 0)
canvas.drawString(-1000 * mm, -1000 * mm, json.dumps(data, sort_keys=True))
canvas.drawString(0 * mm, 0 * mm, json.dumps(data, sort_keys=True))
canvas.restoreState()
def _get_ev(self, op, order):

View File

@@ -56,7 +56,7 @@
</p>
</div>
{% else %}
<div class="table-responsive">
<span class="table-responsive">
<table class="table table-hover table-quotas">
<thead>
<tr>