Menu ▾ ▴

#4 PDF does not display in browser but is generated correctly

open
nobody
None
7
2005-03-23
2005-03-23
No

The PDF is generated correctly but is not displayed in
the browser. Happens in any output mode.

Discussion

  • Harish Narayanan

    Logged In: YES
    user_id=121324

    I experience the same problem, in both output modes.

     
  • Harish Narayanan

    Logged In: YES
    user_id=121324

    Here are the changes to get the link to download the
    generated PDF, in case someone else is interested. The only
    changes are in the wee end of wp2pdf.php. The code is taken
    from php.net's description of the header() function.

    Assuming you've set behaviour to save, make the following
    changes to wp2pdf.php.

    [...snip...]
    if ($behaviour=="save") {
    $pdf->Output($pdffilename.'.pdf');
    header("Cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Pragma: public");
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); //
    Some date in the past

    header('Content-type: application/pdf');
    header('Content-Disposition: attachment;
    filename="actualitydotlog.pdf"');
    readfile('actualitydotlog.pdf');
    echo ('It\'s broken. Meh. For now, you can fetch it
    from <a
    href="'.$root_url.'/'.$pdffilename.'.pdf'.'">here</a>.');
    } else {
    $pdf->Output($pdffilename.'.pdf',I);
    [...snip...]

    See it functioning at http://actuality.wahgnube.org/

     

Log in to post a comment.