decpariem Posted March 7, 2010 Share Posted March 7, 2010 hi! I have figured out some code to crete pdf documents with php but they are stored in the wrong direction. i run the php on xampp/htdocs/file and the php is stored on xamp. the thing is that i want to run it over the internet and the user must be able to get the file on his desktop. please help.the code is: <html> <head> <title>Generating PDF...</title> </head> <body bgcolor="#617C58"> Generating PDF now... <?php // create handle for new PDF document $pdf = pdf_new(); // open a file pdf_open_file($pdf, "philosophy.pdf"); // start a new page (A4) pdf_begin_page($pdf, 595, 842) // get and use a font object $arial = pdf_findfont($pdf, "Times-Roman", "host", 0); pdf_setfont($pdf, $arial, 10); // print text pdf_show_xy($pdf, "There are more things in heaven and earth, Horatio,", 50, 750); pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50, 730); // end page pdf_end_page($pdf); // close and save file pdf_close($pdf); ?> <br> <a href="philosophy.pdf">get the file</a> </body> </html> Link to comment https://forums.phpfreaks.com/topic/194416-create-pdf-file-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.