{"id":1967180,"date":"2025-10-21T09:26:32","date_gmt":"2025-10-21T13:26:32","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?p=1967180"},"modified":"2026-04-10T12:05:04","modified_gmt":"2026-04-10T16:05:04","slug":"troubleshooting-pdf-tickets","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/troubleshooting-pdf-tickets\/","title":{"rendered":"Troubleshooting PDF Tickets and Ticket QR Codes"},"content":{"rendered":"\n<p>This article includes explanations and solutions for some of the more common issues encountered with PDF tickets and generating Ticket QR codes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-fixing-or-garbled-text\">Fixing \u201c???\u201d or Garbled Text<\/h2>\n\n\n\n<p>If you notice that some text in your <strong>Event Tickets Plus<\/strong> PDF tickets appears as question marks (<code>???<\/code>) or unreadable characters, it\u2019s usually caused by a <strong>font encoding issue<\/strong>. The default font used in the PDF doesn\u2019t support certain character sets, which can happen with many non-Latin languages or special symbols.Here are the steps to follow in that case.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-1-add-a-snippet-to-use-a-font-that-supports-more-characters\">1. Add a Snippet to Use a Font That Supports More Characters<\/h4>\n\n\n\n<p>Add this snippet to your site using a snippets plugin like <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets<\/a> or by placing it in your theme\u2019s <code>functions.php<\/code> file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;tec_tickets_wallet_plus_pdf_pass_get_pdf_object&#039;, function( $pdf ) {\n    \/\/ Set FreeSerif font for wider character encoding support\n    $pdf-&gt;setFont( &#039;freeserif&#039;, &#039;&#039;, 10 );\n    return $pdf;\n});\n\n<\/pre><\/div>\n\n\n<p>The <strong>FreeSerif<\/strong> font supports a broad range of Unicode characters, helping resolve most encoding or missing character problems.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-2-update-the-pdf-template-to-match-the-font-setting\">2. Update the PDF Template to Match the Font Setting<\/h4>\n\n\n\n<p>If the snippet doesn\u2019t fully fix the issue, try adjusting the template used to generate the PDFs (see <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/customizing-template-files-2\/\">Customizing Template Files)<\/a>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Copy this file from the plugin: <code>wp-content\/plugins\/event-tickets-plus\/src\/views\/tickets-wallet-plus\/pdf\/pass\/styles.php<\/code><\/li>\n\n\n\n<li>Paste it into your theme (or child theme) here: <code>wp-content\/themes\/[your-theme]\/tribe\/tickets-plus\/tickets-wallet-plus\/pdf\/pass\/styles.php<\/code><\/li>\n\n\n\n<li>Open the copied file and replace all instances of: <code>font-family: freesans<\/code> with: <code>font-family: freeserif<\/code><\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-3-test-the-changes\">3. Test the Changes<\/h4>\n\n\n\n<p>After saving your updates, regenerate a sample ticket and download the PDF. The text should now render correctly instead of showing <code>???<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-additional-tips\">Additional Tips<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Make sure your WordPress and database use <strong>UTF-8 encoding<\/strong>, which ensures proper handling of extended characters.<\/li>\n\n\n\n<li>If the issue persists, it may be caused by custom fonts or third-party plugins overriding font settings in the PDF generator.<\/li>\n<\/ul>\n\n\n\n<p><strong>Still having trouble?<\/strong><br>If characters are still not displaying correctly, please share a sample PDF and your site\u2019s <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/sharing-your-system-information\/\">system information<\/a> with our support team so we can take a closer look.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\" id=\"h-qr-code-not-generated-due-to-server\">QR Code Not Generated Due to Server<\/h2>\n\n\n\n<p>The QR code feature in <strong>Event Tickets Plus<\/strong> relies on your server\u2019s ability to dynamically generate images. To function properly, your server must have the <strong>GD PHP extension<\/strong> installed and enabled. This is a standard PHP library responsible for image processing tasks.<\/p>\n\n\n\n<p>If the GD extension is missing or disabled, QR codes will not be generated, and you may see a broken image or an error where the QR code should appear. This is a server-side requirement, not something controlled directly by WordPress or our plugin.<\/p>\n\n\n\n<p>Most hosting providers include this extension by default. However, if you experience issues with QR codes not displaying, we recommend checking your server\u2019s PHP configuration on <em>wp-admin &gt; Tools &gt; Site Health<\/em>. The Status tab shows a critical issue section if the GD library is not installed.<\/p>\n\n\n\n<p>If that&#8217;s your case, please contact your hosting provider and let them know that <strong>WordPress<\/strong> requires the <strong>GD library installed and active<\/strong>.<\/p>\n\n\n\n<p>For reference, the WordPress Hosting Team maintains a list of recommended PHP extensions here: <a class=\"\" href=\"https:\/\/make.wordpress.org\/hosting\/handbook\/handbook\/server-environment\/#php-extensions\">WordPress Server Environment Requirements<\/a><\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-resolving-the-error-during-status-transition-error\">Resolving the &#8220;Error During Status Transition&#8221; Error<\/h2>\n\n\n\n<p>When creating PDF tickets with Event Tickets and Event Tickets Plus, you may see the following error message: <code>Error during status transition. DirectoryIterator::__construct(\/tmp\/): failed to open dir: Permission denied<\/code><\/p>\n\n\n\n<p>This error message indicates that you don&#8217;t have access to the directory needed to create the PDF for your tickets. The good news is that we have a snippet to help you override these permissions and get your tickets working as expected in no time!<\/p>\n\n\n\n<p>As we mentioned, the above error indicates that you don&#8217;t have access to the&nbsp;<code>\/tmp<\/code>&nbsp;directory on your server: either the&nbsp;<code>\/tmp<\/code>&nbsp;directory doesn&#8217;t exist (it usually resides in the root folder of your server), or you don&#8217;t have privileges to write to this directory. With privileges -755, you should be able to work with this folder so the plugin can generate and save the QR codes for the ticket emails.<\/p>\n\n\n\n<p>As a first step, we recommend reaching out to your web host to see if they can provide you with access to this directory and\/or change the permissions on the directory for your website.<\/p>\n\n\n\n<p>If the issue persists, you can add the following snippet to your <code>functions.php<\/code> file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\n\nadd_filter( &#039;tribe_ext_pdf_tickets_mpdf_args&#039;, function( $args ) {\n\t$upload_dir = wp_upload_dir();\n\t$args&#x5B;&#039;tempDir&#039;] = $upload_dir&#x5B;&#039;basedir&#039;] . &#039;\/tmp\/&#039;;\n\treturn $args;\n} );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-qr-codes-missing-when-modsecurity-is-enabled\">QR Codes Missing When ModSecurity is Enabled<\/h2>\n\n\n\n<p>You may have the <a href=\"https:\/\/modsecurity.org\/\">ModSecurity<\/a> module enabled on your hosting as a preventive and security measure for your website. While this shouldn&#8217;t affect the proper functioning of our plugins, there are some cases where unexpected behavior occurs, such as the QR code not appearing on PDF-generated tickets.<\/p>\n\n\n\n<p>In cases where this issue occurs, the following code can be added to the <strong><em>qr-image.php<\/em><\/strong> file to correct this unexpected behavior. You will want to follow our guide on <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/customizing-template-files-2\/\">Template Overrides<\/a> to change this. <\/p>\n\n\n\n<p>(File Path: <code>\/wp-content\/plugins\/event-tickets-plus\/src\/views\/tickets-wallet-plus\/pdf\/pass\/body\/ticket-info\/attendee-details\/qr-image.php<\/code>)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\nif ( empty( $qr_enabled ) || empty( $qr_image_url ) ) {\n\treturn;\n}\n\n\/\/ We convert absolute URL to physical path on the server\n$upload_dir = wp_upload_dir();\n$qr_path = str_replace( $upload_dir&#x5B;&#039;baseurl&#039;], $upload_dir&#x5B;&#039;basedir&#039;], $qr_image_url );\n\nif ( file_exists( $qr_path ) ) {\n\t$qr_image_data = base64_encode( file_get_contents( $qr_path ) );\n\t$mime_type = mime_content_type( $qr_path );\n\techo &#039;&lt;td width=&quot;120&quot; rowspan=&quot;2&quot;&gt;&#039;;\n\techo &#039;&lt;img width=&quot;100&quot; src=&quot;data:&#039; . $mime_type . &#039;;base64,&#039; . $qr_image_data . &#039;&quot; \/&gt;&#039;;\n\techo &#039;&lt;\/td&gt;&#039;;\n} else {\n\techo &#039;&lt;td width=&quot;120&quot; rowspan=&quot;2&quot;&gt;&#039;;\n\techo &#039;&lt;p&gt;QR code not accessible&lt;\/p&gt;&#039;;\n\techo &#039;&lt;p&gt;&#039; . esc_html( basename( $qr_path ) ) . &#039;&lt;\/p&gt;&#039;;\n\techo &#039;&lt;\/td&gt;&#039;;\n}\n?&gt;\n<\/pre><\/div>\n\n\n<p class=\"has-kb-palette-0-background-color has-background\"><strong>\ud83d\udca1Important Notice:<\/strong> Before proceeding, we strongly recommend <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/creating-site-backups\/\" target=\"_blank\" rel=\"noreferrer noopener\">creating a full site backup<\/a> or <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/how-to-set-up-a-staging-site-for-your-wordpress-website\/\" target=\"_blank\" rel=\"noreferrer noopener\">testing this process on a staging site first<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-fixing-tcpdf-errors\">Fixing TCPDF Errors<\/h2>\n\n\n\n<p>If you encounter a critical error during checkout and are unable to complete the purchase, inspect your server&#8217;s log file. Look for an error message similar to:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nTCPDF ERROR: &#x5B;Image] Unable to get the size of the image: https:\/\/...\/qr_xxx.png\n<\/pre><\/div>\n\n\n<p>This error indicates that TCPDF, the library responsible for generating PDF tickets, cannot retrieve the QR code image from the specified URL. This is often due to server configurations that prevent functions like <code>file_get_contents()<\/code>, <code>getimagesize()<\/code>, or cURL from accessing remote resources.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-common-causes\">Common Causes<\/h4>\n\n\n\n<p>Several server settings can lead to this issue:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Disabled PHP Functions<\/strong>: The <code>allow_url_fopen<\/code> or <code>allow_url_include<\/code> directives may be turned off in your PHP configuration, preventing PHP from accessing remote files.<\/li>\n\n\n\n<li><strong>cURL Configuration Issues<\/strong>: The cURL extension might be missing, misconfigured, or blocked by server firewalls.<\/li>\n\n\n\n<li><strong>Firewall or SSL Restrictions<\/strong>: Outbound HTTP(S) requests could be blocked, or SSL certificates might be invalid or untrusted.<\/li>\n<\/ul>\n\n\n\n<p>In case of receiveing this error, reach out to your hosting provider and provide them with this information. Request that they verify the TCPDF error and implement the necessary modifications to resolve the issue.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-recommended-actions\">Recommended Actions<\/h4>\n\n\n\n<p>To resolve this issue, consider the following steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Verify Remote Image Accessibility<\/strong>: Use SSH to test if your server can access the image URL:<br><code>curl -v https:\/\/your-site.com\/path\/to\/qr.png<\/code><br>A successful response should include an HTTP 200 status code. If the request fails, it may indicate a network or firewall issue.<br><\/li>\n\n\n\n<li><strong>Check PHP Configuration<\/strong>: Ensure that the following settings are enabled in your <code>php.ini<\/code> file:<br><code>allow_url_fopen = On<br>allow_url_include = On<\/code><br>If you don&#8217;t have access to <code>php.ini<\/code>, you can try adding the following lines to your <code>.htaccess<\/code> file:<br><code>php_value allow_url_fopen On<br>php_value allow_url_include On<\/code><br><br>Note: Some hosting providers may restrict these settings for security reasons.<br><\/li>\n\n\n\n<li><strong>Contact Your Hosting Provider<\/strong>: If the above steps don&#8217;t resolve the issue, reach out to your hosting provider. Provide them with the error details and request assistance in configuring the server to allow TCPDF to access remote images.<\/li>\n<\/ol>\n\n\n\n<p>By following these steps, you should be able to resolve the TCPDF image size error and ensure that PDF tickets are generated correctly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article includes explanations and solutions for some of the more common issues encountered with PDF tickets and generating Ticket QR codes. Fixing \u201c???\u201d or Garbled Text If you notice that some text in your Event Tickets Plus PDF tickets appears as question marks (???) or unreadable characters, it\u2019s usually caused by a font encoding&#8230;<\/p>\n","protected":false},"author":64,"featured_media":1955565,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[116,24,59],"tags":[],"stellar-product-taxonomy":[155,156],"class_list":["post-1967180","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css-styling","category-customizing","category-php-function-snippets","stellar-product-taxonomy-event-tickets","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":116,"label":"CSS &amp; Styling"},{"value":24,"label":"Customizations"},{"value":59,"label":"PHP Functions &amp; Snippets"}],"stellar-product-taxonomy":[{"value":155,"label":"Event Tickets"},{"value":156,"label":"Event Tickets Plus"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Jes","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/jes\/"},"comment_info":0,"category_info":[{"term_id":116,"name":"CSS &amp; Styling","slug":"css-styling","term_group":0,"term_taxonomy_id":116,"taxonomy":"category","description":"","parent":24,"count":40,"filter":"raw","term_order":"0","cat_ID":116,"category_count":40,"category_description":"","cat_name":"CSS &amp; Styling","category_nicename":"css-styling","category_parent":24},{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":157,"filter":"raw","term_order":"0","cat_ID":24,"category_count":157,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP Functions &amp; Snippets","slug":"php-function-snippets","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":127,"filter":"raw","term_order":"0","cat_ID":59,"category_count":127,"category_description":"","cat_name":"PHP Functions &amp; Snippets","category_nicename":"php-function-snippets","category_parent":24}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1967180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1967180"}],"version-history":[{"count":8,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1967180\/revisions"}],"predecessor-version":[{"id":1968744,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1967180\/revisions\/1968744"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1967180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1967180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1967180"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1967180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}