fanboime Posted May 26, 2014 Share Posted May 26, 2014 <?PHP require("../fpdf/fpdf.php"); include("db.classes.php"); $g = new DB(); $g->connection(); class PDF extends FPDF { .....codes..... } $pdf = new PDF(); .....codes..... $pdf->SetFont('Arial','',14); $pdf->AddPage('L', 'Legal'); $pdf->SetXY(20,20); $pdf->image('../images/DCWD Watermark.png'); $pdf->SetY(35); // call the table creation method $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,$plateNo); $pdf->SetY(45); $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,$model); $pdf->SetXY(310, 45); $pdf->SetFont('Arial','B',16); $pdf->Cell(0,10,date("m/d/Y")); $pdf->SetY(55); $pdf->BuildTable($header,$data); $pdf->Output(); ?> Why is FPDF's Output not working? or is something wrong with my browser? I already tried putting paramaters on it but still no go I tried Output('foo.pdf','I') not working but if i itegrate my chrome withIDM it just downloads but when i disable integrationnothing happens. Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/ Share on other sites More sharing options...
jazzman1 Posted May 26, 2014 Share Posted May 26, 2014 Try putting the following error reporting php functions at the top of this file. Some actual errors would help. <?php ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); .....the rest of your code Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480874 Share on other sites More sharing options...
fanboime Posted May 26, 2014 Author Share Posted May 26, 2014 Try putting the following error reporting php functions at the top of this file. Some actual errors would help. <?php ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); .....the rest of your code Where can i see this errors? Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480875 Share on other sites More sharing options...
jazzman1 Posted May 26, 2014 Share Posted May 26, 2014 In your browser's window. Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480876 Share on other sites More sharing options...
fanboime Posted May 26, 2014 Author Share Posted May 26, 2014 Remote Address:127.0.0.1:80 Request URL:http://localhost/ServiceVehicle/php/report.php Request Method:POST Status Code:200 OK Request Headersview source Accept:application/json, text/javascript, */*; q=0.01 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:13 Content-Type:application/x-www-form-urlencoded; charset=UTF-8 Cookie:jtable%23-1266721797page-size=10; PHPSESSID=9ti0q877hvea3q7gdq06907ji1 Host:localhost Origin:http://localhost Referer:http://localhost/ServiceVehicle/home.php User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 X-Requested-With:XMLHttpRequest Form Dataview sourceview URL encoded name: d1: d2: Response Headersview source Cache-Control:private, max-age=0, must-revalidate Connection:Keep-Alive Content-Disposition:inline; filename="" Content-Type:application/pdf Date:Mon, 26 May 2014 11:56:34 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Keep-Alive:timeout=5, max=96 Pragma:public Server:Apache/2.4.9 (Win64) PHP/5.5.12 Transfer-Encoding:chunked X-Powered-By:PHP/5.5.12 Above is my header returning application/pdf when my parameters are Output('','I') but when i enter the first parameter Output('my.pdf','I') i get appliation/octet-stream Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480878 Share on other sites More sharing options...
fanboime Posted May 26, 2014 Author Share Posted May 26, 2014 In your browser's window. No errors showing. Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480879 Share on other sites More sharing options...
jazzman1 Posted May 26, 2014 Share Posted May 26, 2014 where is the docs of this pdf library? Maybe the foo.pdf file is not included properly, check if the file exists in this directory. Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480880 Share on other sites More sharing options...
fanboime Posted May 26, 2014 Author Share Posted May 26, 2014 where is the docs of this pdf library? http://www.fpdf.org/ here Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480881 Share on other sites More sharing options...
jazzman1 Posted May 26, 2014 Share Posted May 26, 2014 which example of the demo do you use? Tutorial 2: Header, footer, page break and image? Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480883 Share on other sites More sharing options...
fanboime Posted May 26, 2014 Author Share Posted May 26, 2014 which example of the demo do you use? Tutorial 2: Header, footer, page break and image? I'm not using any demos. But is ajax affecting this? because i am using ajax to call this method and send post data to this for the queries. Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480884 Share on other sites More sharing options...
jazzman1 Posted May 26, 2014 Share Posted May 26, 2014 Then, check the output in your js debugging tool if any errors are generated from the server using the error_reporting functions I've posted above. Link to comment https://forums.phpfreaks.com/topic/288780-fpdf-output-not-working-in-chrome/#findComment-1480885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.