Questo articolo vi guida attraverso il processo di creazione del vostro Tema del biglietto FooEvents che si consiglia di leggere prima di continuare:
Diventate creativi con i temi dei biglietti FooEvents - Parte 1
Creatività con i temi dei biglietti FooEvents - Parte 2
È importante tenere presente che il modo in cui vengono generati i biglietti PDF è leggermente diverso dal normale HTML e CSS. Ci sono alcuni stili ed elementi che potrebbero funzionare bene durante il rendering di un'e-mail o di un file HTML, ma questi stili potrebbero non essere compatibili con la libreria utilizzata per generare i file PDF.
Ecco alcune cose importanti da tenere presenti quando si creano o si modificano i file PDF del tema del biglietto:
- You can use either JPG o PNG immagini. Se le immagini PNG con trasparenza non vengono visualizzate come previsto, è necessario abilitare l'estensione "imagick" in PHP. Se non si sa come fare, il proprio host potrebbe essere in grado di fornire assistenza.
- Try to avoid using
<table>ma piuttosto utilizzare<div>tag. - If you want to center images specifically avoid using the CSS declaration “margin: auto” but rather use “text-align: center”
- Don’t use Google Fonts. The built-in Carattere DejaVu supporta un'ampia gamma di caratteri, tra cui gli alfabeti greco, cirillico, ebraico e arabo.
- Try to avoid nesting elements e.g.
<div>
<div>Some content</div>
<div> - Don’t use the CSS declaration “display: block” on images as it might hide the image in some cases.
- If you don’t want an element to stretch over two pages, add the declaration “page-break-inside: avoid;”
- If you are nesting elements then apply CSS padding on the inner container and not the outer container.
- Use paths for images instead of URLs like in regular HTML.
- Add a closing </body> e non un tag di chiusura </html> per più pagine PDF
- Don’t use the CSS “float” property on a tag that is nested inside another floated tag
- If a customer is buying more than one ticket for the same event then most PDF ticket themes will display the header and event information followed by 3 tickets, per page. If the PDF ticket looks broken then it might be because all this information does not fit on one page. To fix this you can use a log and/or header image that are not as high, remove padding, margins or text or set it so that only 1 or 2 tickets are shown on one page.