khhalid Posted May 7, 2010 Share Posted May 7, 2010 hi guys, I'm need to create Declaration form in PDF format. I manage to create the PDF function which create the PDF file and set front etc. Now I need the following: Task1 Create three tables in newly created PDF; Task2 Add some text in those tables; Task3 select option box at the top which allow user to display one table and remove other tables Here are the codes for creating PDF: <?php Function CreatePDF($Path) { //Resource create for PDF library $pdf = PDF_new(); pdf_open_file($pdf, $Path); //Page diemention (A4) pdf_begin_page($pdf, 595, 842); //path of your TTF font directory $fontdir = "C:\WINDOWS\Fonts"; pdf_set_parameter($pdf, "FontOutline", "arialMyName=$fontdir\arial.ttf"); $arial = PDF_findfont($pdf,"arialMyName","host",0 ); //Set font size and font name pdf_setfont($pdf, $arial, 10); //print text pdf_show_xy($pdf, "HBLB PDF",50, 750); pdf_show_xy($pdf, "New PDF created.", 50,730); pdf_end_page($pdf); pdf_close($pdf); $status = "PDF created in: " . $Path; return $status; } echo CreatePDF("C:\Projects\HBLB\FOD\htdocs\kh\php\HBLB.pdf"); ?> Many thanks for your help, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.