Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthortclemmer
    • CommentTimeSep 28th 2009
     
    mPDF is doing a great job when I use IE version 8.  If I use IE version 6 (Which unfortunately is the majority of users I have) the program runs and I get the Open Save dialog.  If I select Open, I get an error that says:

    There was an error opening this document. This file cannot be found.

    If I save the file then browse to it and open it, it is fine.  I guess the file is being saved to a location that is not the same location that adobe expects.  I hope someone will know of an answer.  Maybe there is a setting in IE 6 that I need to set.

    Tom
    • CommentAuthorIanBack
    • CommentTimeSep 28th 2009
     
    Googling the subject I came across: http://schroepl.net/projekte/mod_gzip/browser.htm#Microsoft and http://schroepl.net/projekte/mod_gzip/browser.htm#Acrobat . It looks as the though the problem may be IE6 dealing with compressed data.

    I seem to remember using IE6 when I was first developing mPDF and not having a problem, so it may be specific to your set up of IE6 (i.e. the way it requests compression in the HTTP request), or your setup of php - do you have zlib.output_compression ON or use ob_gzhandler?

    • CommentAuthortclemmer
    • CommentTimeSep 29th 2009 edited
     

    It appears that I have the following set in the php.ini file:

    ZLib Support enabled Stream Wrapper support compress.zlib:// Stream Filter support zlib.inflate, zlib.deflate Compiled Version 1.2.3 Linked Version 1.2.3
    DirectiveLocal ValueMaster Value zlib.output_compressionOffOff zlib.output_compression_level-1-1 zlib.output_handlerno valueno value

    So, should zlib.output_compression be on? My gut feeling is no based on how I read your response above. I am going to do some searching as well.

    Upon some searching, I seem to find a lot of people with this issue for various applications. Most of the solutions appear to be in the headers being sent. It also appears specific to IE6.


    http://forums.knowledgetree.com/viewtopic.php?t=4601&postdays=0&postorder=asc&highlight=download&start=15

    http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=15400

    Can you tell me where the headers are defined for output? I found stuff in the mpdfi.php file but I can not tell if that is the actual place as I can not seem to make changes that seem to affect the output.

    Back again:
    Found it!

    If I add (For the output option of "D", which is what I am using)

    case 'D':
    //Download file
    if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))
    header('Content-Type: application/force-download');
    else
    header('Content-Type: application/octet-stream');
    if(headers_sent())
    $this->Error('Some data has already been output to browser, can\'t send PDF file');
    header('Content-Length: '.strlen($this->buffer));
    header('Content-disposition: attachment; filename='.$name);
    header('Cache-Control: private');
    echo $this->buffer;
    break;


    It works in both IE6 and IE8, and Firefox 2.  It appears that not caching the output prevented IE6 and Adobe from being able to open the content.

    Tom
    • CommentAuthorIanBack
    • CommentTimeSep 30th 2009
     
    Tom,

    Tthanks for that. I now have a problem! Another user was having problems with an https connection and has suggested changes to this section which I was intending to implement in the next version. I cannot test as I don't have acces to IE6, so would you test this for me?

    case 'D':
    //Download file
    // mPDF 3.2
    if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) {
    if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') {
    header('HTTP/1.1 200 OK');
    header('Status: 200 OK');
    header('Pragma: anytextexeptno-cache', true);
    header("Cache-Control: public, must-revalidate");
    }
    else {
    header('Cache-Control: public, must-revalidate');
    header('Pragma: public');
    }
    header('Content-Type: application/force-download');
    }
    else {
    header('Content-Type: application/octet-stream');
    }
    if(headers_sent())
    $this->Error('Some data has already been output to browser, can\'t send PDF file');
    header('Content-Length: '.strlen($this->buffer));
    header('Content-disposition: attachment; filename='.$name);
    echo $this->buffer;
    break;


    Many thanks,

    Ian
    • CommentAuthortclemmer
    • CommentTimeSep 30th 2009
     
    Ian,

    The above works for me on IE6, IE8 and Firefox 2.  At least for the ways that I use mPDF.

    Later,

    Tom
    • CommentAuthorIanBack
    • CommentTimeSep 30th 2009
     
    Thanks again. I shall put the above code into next version.

    Ian
    • CommentAuthormax
    • CommentTimeMar 2nd 2010
     

    Hi all,
    Not sure if this will help anyone. 
    The following seemed to work for me in IE 7 with mPDF 4.2

    case 'D':
       //Download file
       // mPDF 4.0
       if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) {
          if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') {
            header('HTTP/1.1 200 OK');
            header('Status: 200 OK');
            header('Pragma: anytextexeptno-cache', true);
            header("Cache-Control: public, must-revalidate");
          }
          else {
             header('Pragma: no-cache');
             //header('Cache-Control: public, must-revalidate');
             header('Cache-Control: maxage=3600');
           }
           header('Content-Type: application/force-download');
       }
       else {
           header('Content-Type: application/octet-stream');
       }
       if(headers_sent())
       $this->Error('Some data has already been output to browser, can\'t send PDF file');
       header('Content-Length: '.strlen($this->buffer));
       header('Content-disposition: attachment; filename='.$name);
       echo $this->buffer;
       break;


    Cheers,
    Max

    • CommentAuthorremi
    • CommentTimeMar 9th 2010
     
    Hi,

    We had a similar issue here with IE6 and MPDF 4.3. IE6 couldn't open directly the pdf file (we got the Open Save dialog). To get it working we had to modify the Cache-Control header(see code above extracted from Output method with $dest = 'I').


    case 'I':
    // mPDF 3.0 // Edited mPDF 3.1
    if ($this->debug && !$this->allow_output_buffering && ob_get_contents()) { echo "<p>Output has already been sent from the script - PDF file generation aborted.</p>"; exit; }
    //Send to standard output
    if(isset($_SERVER['SERVER_NAME']))
    {
    //We send to a browser
    header('Content-Type: application/pdf');
    if(headers_sent())
    $this->Error('Some data has already been output to browser, can\'t send PDF file');
    header('Content-Length: '.strlen($this->buffer));
    header('Content-disposition: inline; filename='.$name);
    // mPDF 4.2

    header('Pragma: no-cache');
    // IE6 : this header avoid IE6 to open directly the pdf file
    //header('Cache-Control: no-cache, must-revalidate');
    header('Cache-Control: maxage=0');


    }
    • CommentAuthorIanBack
    • CommentTimeMar 9th 2010
     
    Hi,

    I will try changing in next version - it works OK for me in Firefox and IE8. Just hope it doesn't mess it up for other browser set-ups!