Follow us

Made in the U.S.A.

Ticket Images

Using Ticket Images: #

The Raffle Ticket Generator supports generating ticket images with the ticket numbers embedded into the image, PROVIDED that your web host supports the proper versions of the gdlibrary function of php.

The silver version allows you to select from a handful of stock images. Gold and Platinum editions also allow you to upload a PNG file of a custom ticket image.

When the order is processed, the order confirmation page and email will include a server generated image with the ticket number embedded into the image like below.

Regular Ticket Image Format and Size: #

The dimensions of the .PNG file that we use is 300 x 147 and you need to have white space for the ticket number to be inserted. The file uploaded MUST BE PNG and 300×147. Platinum also offers a large format ticket image and that documentation is covered in another section. Here are the dimensions showing the padding.

The most common issue with custom tickets images is not having them the correct pixel and file format.


Large Ticket Image Format – Platinum: #

With the Platinum Edition we now offer the ability to create Large Format Ticket Images. You can create your own custom 1200×400 pixel PNG image. You will need to leave a white space for the name and ticket number to be printed on it. We suggest an open area of about 300×50. We will print the name and ticket number HORIZONTALLY based on an X-Y coordinate starting point. For those jurisdictions that need specific info on each ticket such as a permit, drawing date, address, ticket prices, etc. This is a great way to handle these requirements.

You have the option to include the ticket image in the order confirmation page and email or simply put a link to your server. Just like the normal ticket images that are in Silver and Gold Editions, the ability to print images, required specific gdimage libraries on your server. We cannot provide server support. We strongly recommend that you get your raffle setup per our quick start guide and working without printing ticket images and then adding the images. This will significantly cut down on debugging the problem should you have an issue with your php libraries on your server. Here is an example of a demo ticket image we used – note the white space on the lower left corner. When designing your ticket you can put the ticket area anywhere as long as you leave a horizontal area open.

Here is an example of the ticket displayed in the order confirmation page with the customer name and ticket number generated.

Large Format Ticket Configuration: #

On the raffle configuration page after you click expand on the appropriate category, scroll down until you find the Do you want ticket images? section. If you select YES, you will then have the option for the Normal (small 300x147px) image or the Large ticket. You will need to create your own 1200x400px PNG file with an open area for the ticket name and number to be printed. We displayed a demo example above. It must be 1200×400 and it must be in PNG format. If you do not know how to make that image, then you need to consult with a graphic designer.  If you upload a pdf or jpg it will not work.

To upload your custom image, click browse and select your image. You will need to scroll to the bottom and SAVE the configuration for the ticket to show in the selection area.

To set the location for the Customer Name and Ticket Number to be printed on the image – put in the distance from the left and from the top. In the example image above, we set the area from the left at 50px and 270 from the top. Use only whole numbers. If you are unsure of where exactly your open space is, please run a handful of tests using a long name. This should be common sense, but I cannot tell you how many people get upset because they tested with “john doe” and then they get an order from Hubert Blaine Wolfeschlegelsteinhausenbergerdorff and they call us screaming that the name doesn’t fit on the open area.

Trouble Shooting Images and GD Library: #

The most common problem with the ticket images is that many hosts are not compatible or they have the wrong versions. When the hosting or security settings have an issue, the images will show up as a broken image icon in the email and order confirmation page.  The second most common issue is that you uploaded a jpg or some other file type.  If you are having issues printing your custom image, try with our standard images first.  If those print, your image is not per the documentation.

If the raffle ticket images are not being displayed in the confirmation email and the backend, the problem is most likely that your hosting is not supporting the current gdlibrary function, security is blocking something or the custom image is the wrong format and size.

  • First  check that normal tickets are generated.  Uncheck to use images and process a test order.  Look for ticket numbers.  If not, it is another issue and please contact support.
  • Second – if using a custom ticket image, test to see if a default image is working.  Just over half the support requests about ticket images are custom images in the wrong format.
  • Third – double check the format of ticket image if using a custom image.
  • Fourth – look at the url of the broken image icon – it will take you to a url like – /wp-content/plugins/raffle-ticket-generator-xxxxx/includes/l_image.php?xxxxxxxxxxxx  If the url gives you a 403 or forbidden error, then something in your security settings is blocking that.  It is rare, but we have seen some advance firewall settings block that execution.  You will need to adjust settings or whitelist that php execution for it work.

If ticket numbers are generated normally but not the images, then the problem is your gdlibrary and or php settings.

The php option of allow_url_fopen must be set to allow to create the ticket images.

We use gdlibrary to generate the images –

If you are responsible for your hosting, make sure that version 2.2.3 is installed and working properly. If you are on shared hosting, your host might not support gdlibrary or the version is an older version. We are known to work with the current version, but do not have enough info about older versions. There are also grouped/bundled versions. We do know that this configuration of bundled gdlibrary versions 2.2.1 compatible works.

If your host does not support the current version of gdlibrary, there is nothing we can do about the issue and you need to use regular tickets.

Several people have asked which hosts support gdlibrary, unfortunately, we do not have enough information as many hosts have different versions on different servers.

For example. We have seen it work properly on some hostgator servers, but others do not. When we look at the different servers, they have various versions so there is not a lot of consistency on the same hosting providers.

Issues with All In One WP Security Plugin: #

All In One WP Security is a great security plugin.  It has many configurable options.  On the additional firewall rules, you cannot use the Advanced Character String Filter and Deny Bad Query Strings.  These 2 options will stop our script from creating the url to generate the ticket images.









Obviously there are a wide selection of security and firewall plugins.  We routinely use 3 with sites we develop depending on the circumstances.  There are probably many other firewall settings that conflict with the script to make the ticket images, so if you have issues with generating ticket images, we suggest you disable all the security on your development site, test ticket images, once they are working perfectly, then add back in security and adjust the settings accordingly so that images are generated.

With Sucuri Security Plugin – you have to make sure you do not apply hardening to the Block PHP Files in WP-CONTENT Directory and Block PHP Files in WP-INCLUDES Directory or the images will not be allowed to generate.

We have not seen this happen with Wordfence at the time this documentation was written, but plugins change daily.  Follow normal WordPress best practices for troubleshooting conflicts with other plugins.

If your site needs this level of security, then images simply are not available.