By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,977 Members | 1,352 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,977 IT Pros & Developers. It's quick & easy.

Problem using FPDF

P: n/a
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

Nov 7 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a

<ca*******@t-online.dewrote in message
news:11**********************@50g2000hsm.googlegro ups.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
Nov 7 '07 #2

P: n/a
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="'.$name.'"');

Any further idea?

Thanks,
Carsten
Nov 7 '07 #3

P: n/a
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="'.$name.'"');
Any further idea?
Thanks,
Carsten

Nov 7 '07 #4

P: n/a

"Tompkins" <ca*******@t-online.dewrote in message
news:11**********************@d55g2000hsg.googlegr oups.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="'.$name.'"');

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.
Nov 7 '07 #5

P: n/a

"Steve" <no****@example.comwrote in message
news:XS***********@newsfe05.lga...
>
"Tompkins" <ca*******@t-online.dewrote in message
news:11**********************@d55g2000hsg.googlegr oups.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.
Nov 7 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.