Jump to content

View a php script in pdf


Go to solution Solved by Barand,

Recommended Posts

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);


 

Link to comment
https://forums.phpfreaks.com/topic/314036-view-a-php-script-in-pdf/
Share on other sites

  • Solution

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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.