Problem using FPDF

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cappieins@t-online.de

    Problem using FPDF

    Hi,

    i've got a problem using PHP FPDF library to create PDF files send
    inline to
    a browser window.

    The created PDF file opens correctly in the browser (IE 6), but if I
    want to save
    it to my local disk, there is not automatically the filename used I
    passed
    to the "Output" function of the lib.

    Instead the name of the html page is proposed in the file chooser.

    Does anyone have an idea how to get the correct filename automatically
    in teh file chooser dialog?

    Thanks in advance,
    Carsten

  • Steve

    #2
    Re: Problem using FPDF


    <cappieins@t-online.dewrote in message
    news:1194438127 .438736.243150@ 50g2000hsm.goog legroups.com...
    Hi,
    >
    i've got a problem using PHP FPDF library to create PDF files send
    inline to
    a browser window.
    >
    The created PDF file opens correctly in the browser (IE 6), but if I
    want to save
    it to my local disk, there is not automatically the filename used I
    passed
    to the "Output" function of the lib.
    >
    Instead the name of the html page is proposed in the file chooser.
    >
    Does anyone have an idea how to get the correct filename automatically
    in teh file chooser dialog?
    what fpdf version are you using? whatever the case, just look a the output
    function and check what headers it's sending out. check to make sure there
    is header line for:

    header('content-disposition: attachment; filename="' . $name . '"');

    and that $name (or whatever variable name is used for the file name param)
    is set...you also need to make sure you are passing 'D' as the $dest
    (destination) param.

    hth,

    me


    Comment

    • Tompkins

      #3
      Re: Problem using FPDF

      Hi,

      i'm using fpdf version 1.53, but passing an "I" for "inline" as
      destination, because I want the browser to open the pdf directly using
      the browser plugin. If I use "D", there appears a dialog asking me to
      save or to open the file. But thst's not what I want to have...

      The header is set corectly for "D" as you wrote, and for "I" it is

      header('Content-disposition: attachment; filename="'.$na me.'"');

      Any further idea?

      Thanks,
      Carsten


      Comment

      • Tompkins

        #4
        Re: Problem using FPDF

        Hi,

        i'm using fpdf version 1.53, but passing an "I" for "inline" as
        destination, because I want the browser to open the pdf directly
        using
        the browser plugin. If I use "D", there appears a dialog asking me to
        save or to open the file. But thst's not what I want to have...


        The header is set corectly for "D" as you wrote, and for "I" it is


        header('Content-disposition: inline; filename="'.$na me.'"');


        Any further idea?


        Thanks,
        Carsten



        Comment

        • Steve

          #5
          Re: Problem using FPDF


          "Tompkins" <cappieins@t-online.dewrote in message
          news:1194447820 .498426.198680@ d55g2000hsg.goo glegroups.com.. .
          Hi,
          >
          i'm using fpdf version 1.53, but passing an "I" for "inline" as
          destination, because I want the browser to open the pdf directly using
          the browser plugin. If I use "D", there appears a dialog asking me to
          save or to open the file. But thst's not what I want to have...
          >
          The header is set corectly for "D" as you wrote, and for "I" it is
          >
          header('Content-disposition: attachment; filename="'.$na me.'"');
          >
          Any further idea?
          well, for starters, don't switch thoughts mid-stream!

          "but if I want to save it to my local disk, there is not automatically the
          filename used I passed"

          and then:

          "because I want the browser to open the pdf directly using the browser
          plugin."

          stick with telling us EXACTLY what you are having problems with, and maybe
          we can help you.


          Comment

          • Steve

            #6
            Re: Problem using FPDF


            "Steve" <no.one@example .comwrote in message
            news:XSlYi.25$r k.2@newsfe05.lg a...
            >
            "Tompkins" <cappieins@t-online.dewrote in message
            news:1194447820 .498426.198680@ d55g2000hsg.goo glegroups.com.. .
            ok, i re-read your hodge-podge op. what you're saying is that:

            =====

            i want to display a pdf directly in the browser, and when i use the
            *browser's* file->"save as" menu option, the browser gives the default file
            name as the name of the url/web-page rather than the file name i specified
            in the header.

            =====

            if that is the case, there is nothing you can do to be consistent across all
            browsers. headers are "directives ", not "commands". the browser treats them
            like *suggestions* and nothing more. this has nothing to do with fpdf.

            to test it, put an already created pdf in your web root, use a browser to
            pull it up via its url...then file->'save as'. notice, url...not file name.


            Comment

            Working...