Ik heb een scriptje gemaakt dat een PDF file moet produceren. PDF lib staat aan en de directory heeft read/write acces. Toch krijg ik de volgende error, die normaal betekent dat er een read/write error is. Terwijl dat dus niet het geval is. Iemand enig idee hoe dit kan?
Fatal error: Uncaught exception 'PDFlibException' with message 'Function must not be called in 'object' scope' in C:\Inetpub\vhosts\kickoff-ak.nl\httpdocs\tickets\pdf.php:17 Stack trace: #0 C:\Inetpub\vhosts\kickoff-ak.nl\httpdocs\tickets\pdf.php(17): pdf_begin_page(Resource id #2, 595, 842) #1 {main} thrown in C:\Inetpub\vhosts\kickoff-ak.nl\httpdocs\tickets\pdf.php on line 17
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php // create handle for new PDF document $pdf = pdf_new(); // open a file pdf_open_file($pdf, "ticket-kickoff-party.pdf"); // start a new page (A4) pdf_begin_page($pdf, 595, 842); // set document information pdf_set_info_author($pdf, "KICKOFF-AK.NL"); pdf_set_info_creator($pdf, "KICKOF-AK.NL"); // get and use a font object $verdana = pdf_findfont($pdf, "Verdana", "host", 1); pdf_setfont($pdf, $verdana, 10); // print text pdf_show_xy($pdf, "Ticket-id:",50, 750); pdf_show_xy($pdf, "Achternaam:", 50, 730); pdf_show_xy($pdf, "Voornaam:", 50, 710); pdf_show_xy($pdf, "Studentnummer:", 50, 680); pdf_show_xy($pdf, "Leerjaar", 50, 650); //image bg $image = pdf_open_image_file($pdf, "jpeg", "_style/img/ticket.jpg"); pdf_place_image($pdf, $image, 50, 650, 0.25); // end page pdf_end_page($pdf); // close and save file pdf_close($pdf); ?> </body> </html> |