Jump to content

SOLVED How to view PDF's in browser instead of download?


Recommended Posts

Hi All,

 

Seeing if there is a way to view pdf's (like delivery receipt, etc) in the browser instead of automatically downloading them.  For our operation it is much easier to print from the browser instead of downloading each slip, opening it and then printing.

 

Any help or insight would be greatly appreciated.

 

Thank you.

Edited by ableier (see edit history)
Link to comment
Share on other sites

what browser and operating system are you using?  Also what PS version?

 

I find that some browsers handle this differently, and would also require that you have the appropriate browser plugin installed to view the PDF "in browser"

Link to comment
Share on other sites

I've tried it in Safari, Chrome and Firefox.  All only download with no option to view in browser.  I have tried other documents that work fine in the browser window.  I use Yosemite for Mac.  PS version 1.6.0.14.  From my research online it seems that it is coded that way in PS.  I have no idea what code.  Any help is appreciated.

 

Thank you.

Link to comment
Share on other sites

This requires a change to the AdminPdfController.php located in \controllers\admin.

 

You will find a function generatePDF at the bottom

    public function generatePDF($object, $template)
    {
        $pdf = new PDF($object, $template, Context::getContext()->smarty);
        $pdf->render();
    }

To get the invoice to display "inline", you need to change this function

 

From

$pdf->render();

TO

$pdf->render('I');
  • Like 4
Link to comment
Share on other sites

×
×
  • Create New...