Alan Norris

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromAlan Norris
ToMe
SubjectDisplay pdf in browser on any Mac web browser
Date23 February 2005 11:50
Hi 

Have long been an admirer of your work. 
Wondered if you could offer any assistance with an issue that we I am
currently experiencing only with Mac based browsers.  I help support a web
service where briefings and standards in pdf format may be viewed and
downloaded.

When the required pdf is selected from the site, it works pretty seamlessly
with any Windows OS, using IE 5.5 or 6 - together with Acrobat Reader 5, 6
or 7 (display pdf in browser enabled).   But with Mac's, a new browser
window will open, the download manager downloads the object to the desktop
- not as a pdf - but as documentaccess.asp.  I then have to manually
associate the object with an application to get it either to Preview or
Open in Acrobat Reader.

Mac is either OS IX or X (Panther) - Browser any including IE 5.2.3 -
Safari etc. 

I am desperately trying to encourage the powers that be to conduct further
development across further platforms and browsers but they are so blinkered.
Is it possible that I may use some of your excellent testing results in
order to further my argument?

Kind Regards 

Alan Norris
FromMe
ToAlan Norris
SubjectRe: Display pdf in browser on any Mac web browser
Date23 February 2005 13:27
Alan,

Not entirely sure which test results will relate to this, but you are
welcome to use whatever test results you want.

As for your PDFs, it sounds like your server is sending the wrong headers.
There are two headers that should be sent to make it save correctly.
Firstly, the content-type header, and the content disposition, which
actually specifies the filename (sounds like this is the one that is
missing). Setting it as inline allows the browser to use a plugin if it has
one (there is one available in the latest adobe reader for Mac as well), or
prompt the user to download it if there is not. Internet Explorer will also
expect Content-Length.

Content-Type: application/pdf
Content-Length: 50345
Content-Disposition: inline; filename=yourfile.pdf

Most browsers can use the plugin if it is installed. On Windows, Acrobat
installs the ActiveX plugin for Internet Explorer, and will provide a dll
to use for other browsers. In most cases you would need to copy this to the
browser's plugin directory yourself - the Opera instuctions are here:
http://www.opera.com/support/search/supsearch.dml?index=155
the same would apply to most other browsers, including Mozilla/Firefox and
related browsers.

On Mac, I can't remember exactly what needs to be done, but I know the
plugin is there, and most Mac browsers (Safari, Opera, Mozilla/Firefox, etc)
should be able to use it. On linux, you're on your own ;)


Hope this solves your problems.

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.