Jump to content

FPDF Output() not working in chrome


fanboime

Recommended Posts

<?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
Share on other sites

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
Share on other sites

 

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
Share on other sites

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
Share on other sites

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
Share on other sites

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.