ssoto26 Posted October 18, 2021 Share Posted October 18, 2021 I have a scrip that i want to display it in PDF. This display a graph i want to know how can i display it in PDF. If anyone can help here!! Thank you!! in Advance! Code: <? require("../includes/class_graph.php"); $defaultValues=array( 'from'=>$from=(time()-7*3600-60*date("i",time())-date("s",time())), 'to'=>$from+8*3600, 'y_min'=>0, // Default y-min value 'y_max'=>30, // Default y-max value 'graph_width'=>750, // Default Graph width 'graph_height'=>300, // Default Graph height 'graph_indent_x'=>50, // If long values are display on the y-axis (215434 Degree), and the number is cropped, you might want to increase this number 'graph_indent_y'=>30, 'intervall'=>30, // This should always be intervall time 'overallunit'=>'psi', // This is the unit display on the y-axis 'pdfReportable'=>true ); $lines=array( new Line("#0CAB46","Juice Out Trim Cooler","pet_juice_press",'psi',true,'Div10','Div10'), new Line("#FF0000","Hot Water Loop","pet_hot_water_press",'psi',true,'Div10','Div10'), new Line("#FF6215","Juice Out Pre-Heater","pet_juice_out_preheat_press",'psi',true,'Div10','Div10'), new Line("#0000FF","Pre-Heater Water In","pet_waste_water_press",'psi',true,'Div10','Div10'), ); $g=new Graph( $defaultValues, // Table + comma 'pet_juice_pressure', // Page Title in quotes + comma after 'PET Line Differential Pressure', // Graph Title in quotes 'Pressure' ); $g->Display($lines); Quote Link to comment https://forums.phpfreaks.com/topic/314036-view-a-php-script-in-pdf/ Share on other sites More sharing options...
gw1500se Posted October 18, 2021 Share Posted October 18, 2021 There is a PHP library for that called TCPPDF. Quote Link to comment https://forums.phpfreaks.com/topic/314036-view-a-php-script-in-pdf/#findComment-1591181 Share on other sites More sharing options...
Solution Barand Posted October 18, 2021 Solution Share Posted October 18, 2021 You could save the output as an image file and import that into the PDF file. FPDF supports png, jpeg, gif TCPDF supports the above plus SVG images (and you can also embed SVG script into the PDF) Quote Link to comment https://forums.phpfreaks.com/topic/314036-view-a-php-script-in-pdf/#findComment-1591182 Share on other sites More sharing options...
ginerjm Posted October 18, 2021 Share Posted October 18, 2021 Or you could just print out the script and scan it in on your printer if that produces pdfs.... Quote Link to comment https://forums.phpfreaks.com/topic/314036-view-a-php-script-in-pdf/#findComment-1591183 Share on other sites More sharing options...
ssoto26 Posted October 18, 2021 Author Share Posted October 18, 2021 I need to do some coding and i think I'm getting there!!! Thank you all!! Quote Link to comment https://forums.phpfreaks.com/topic/314036-view-a-php-script-in-pdf/#findComment-1591187 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.