|
Tutorial: Only for Ticketmaster 1.0.13 or higher Author: Robert Dam Difficulty: High, a little PHP knowledge is needed.
We get this question often, we will make a description below on how to change the ticket layout. First of all, make sure you have a backup. (Can be created with Akeeba Backup very easy!)
Now let's start with creating a proper file.
- Open Photoshop or another favorit program that can create PDF files.
- Click "New" and set the height to 29 cm and the width to 21 cm, the color mode must be CYMK for the best resolution.
- Design your ticket, you can have tickets in A4 format.
- Save a copy of the ticket as PSB first before exporting as PDF as your layers will be deleted after setting the file to PDF.When using the PSB file it will keep the layers and you can fall back to make changes later on.
- We do have a ticket now in PDF format, exactly what you need!
Information Functionality Override e-PDF file;
You do now have the ability to have class overrides, this means you can have your changed (PDF creator). In earlier versions it was hard to upgrade because your ticket was lost if you had no copy of the ticket creator. We have now created a folder:[ADMINISTRATOR]/components/com_ticketmaster/classes/override/
Now upload the new created PDF file to: [ADMINISTRATOR]/components/com_ticketmaster/classes/override/eTicket.pdf During our upgrades, we’re not using the override folder, so every file this folder is being untouched.
Let's take a look on what I have created for a client to have an example. [DOWNLOAD] The example above is copyrighted and may not be used for your website! Now open your favorit editor, we're using Dreamweaver in this case.
Information Functionality Overriding Ticketcreator Classes;
Note: We had already the classes from version 1.0.12 and we have added this to prevent site crashes.
- Open file: [ADMINISTRATOR]/components/com_ticketmaster/classes/createtickets.class.php
- We're going to change function doPDF that starts at line 17.
- You do now have the ability to have class overrides, this means you can have your changed (PDF creator). In earlier versions it was hard to upgrade because your ticket was lost if you had no copy of the ticket creator.
We have now created a folder:[ADMINISTRATOR]/components/com_ticketmaster/classes/override/ During our upgrades, we’re not using the override folder, so every file this folder is being untouched.
$pdf->SetFont('Arial', 'B', $order->ticket_fontsize); $pdf->SetTextColor($order->ticket_fontcolor_r,$order->ticket_fontcolor_g,$order->ticket_fontcolor_b); $pdf->SetXY(8, 42); $pdf->Write(0, JText::_( 'PDF TICKETEVENT' ).'');
We want to change this textures, the PDF ends at line 1039. All the same textures as above, let's describe them so you can do the edits yourself.
Setting the font:
$pdf->SetFont('Arial', 'B', $order->ticket_fontsize);
Explanation: First we want define the font, in this case "Arial" (There not so much fonts available, so choose a simple one) Then we're choosing Bold or if it is normal text, just remove the B. The order $order->ticket_fontsize is set in the configuration, but you can choose a number also. Lets create a Tahoma font in normal weight and 12px, your line should look like this:
$pdf->SetFont('Tahoma', '', 12);
Setting the color:
$pdf->SetTextColor($order->ticket_fontcolor_r,$order->ticket_fontcolor_g,$order->ticket_fontcolor_b);
Explanation: All these settings can be set in the configuration also, but if you want to choose your own without the configuration settings. You can edit the line like you want. The color scheme is in RGB. Let's see how it looks in black.
$pdf->SetTextColor(0,0,0);
Setting the position:
$pdf->SetXY(8, 42);
You have to play around with these numbers, as the logical hasn't found by myself either... This is a disadvantage of FPDF and I can't find how to make the calculation, so playing around is the best.
8 pt's from the top and in this case 42 pt's from the left. You can also use points to work more specific, example: 42.2 is also possible. (do NOT use a comma!).
Writing the text on the PDF file:
$pdf->Write(0, JText::_( 'PDF TICKETEVENT' ).'');
You can write what you like, when you want addons in text just add a new word here: JText::_( 'PDF TICKETEVENT' ). Make sure if you use other words, that you also add these words in the language files.
Removing/moving the Barcode from the ticket:
As you can see below, the barcode contains the number for the position, just play around to move it to another place.. When you want to delete or remove the barcode, just change line 1043:
$pdf->EAN13(150,72,$code);
into:
// $pdf->EAN13(150,72,$code);
|