View Full Version : Can PDF files be opened in full page view?
mpclubfoot
01-22-2003, 06:14 PM
Hello again,
I open pdf files with the following html and JS code. The code is located in an external JS file.
//opens gpl from one of the general locations
//depth is a string such as '../../' used to indicate the directory level
function getPDF(depth, thisLoc){
switch(thisLoc){
case "location1" :
thisLoc = depth + "myPDF/location1.pdf";
break;
case "location2" :
thisLoc = depth + "myPDF/location2.pdf";
break;
case "location3" :
thisLoc = depth + "myPDF/location3.pdf";
break;
default :
}//endswitch
productWindow = window.open(thisLoc, "prodWin",
"width=750,height=650,left="+leftPos+",top="+topPos+",toolbar=no,scrollbars=yes,resizable=yes");
}
<a href="javascript:getPDF('../../../', 'location')">
<img src="myButton">
</a>
Here is my question. Is there a way to modify this code to open the PDF in "Fit in Window" mode? The default seems to be "Fit Width".
Thanks for your help...
Spookster
01-22-2003, 06:20 PM
You can if you have Adobe Acrobat and select how you want it to be displayed when it is opened. Once you have it selected the options you want then resave the file.
justame
01-22-2003, 06:47 PM
/me just a whispers® to spook...
reallly??? /me woulda just a thought® the pdf would have opened just a ccording® to /mes preferences in herrr adobereader™??? n' giggles n' guesses /me stilll isnt just a programmed® to think...lol...
whammy
01-23-2003, 01:22 AM
Actually I think both of you just said the same thing - that the ability to open a .pdf document "fullscreen" (or modify its display at all) from the web isn't an option, and would be have to be specified in the client's "Adobe Acrobat Reader" itself.
If you want your users to NOT open the .pdf file in their browser, that CAN be done (at least using ASP) with a little code trickery that will force them to either:
Open WITH Adobe Acrobat
OR
Save the file to their hard drive
...instead of being able to open the .pdf file with their browser. However, this cannot be done with javascript, since it involves sending HTTP Header information to the client (if I understand it correctly).
Let me know if that's the case, there's some easily modifiable code on asp101.com that will do the trick.
mpclubfoot
01-23-2003, 05:55 PM
Thanks for the input, everyone!
gsolu
02-06-2004, 06:56 PM
At the bottom of your quote you say there is easily modifiable code on asp101.com that will allow me to save a PDF instead of opening the PDF. I used every search string I could think of and cannot find a reference to any code that can do this task.
Can you please point me in a direction?
Gsolu
Originally posted by whammy
Actually I think both of you just said the same thing - that the ability to open a .pdf document "fullscreen" (or modify its display at all) from the web isn't an option, and would be have to be specified in the client's "Adobe Acrobat Reader" itself.
If you want your users to NOT open the .pdf file in their browser, that CAN be done (at least using ASP) with a little code trickery that will force them to either:
Open WITH Adobe Acrobat
OR
Save the file to their hard drive
...instead of being able to open the .pdf file with their browser. However, this cannot be done with javascript, since it involves sending HTTP Header information to the client (if I understand it correctly).
Let me know if that's the case, there's some easily modifiable code on asp101.com that will do the trick.
whammy
02-06-2004, 07:14 PM
http://www.asp101.com/articles/jason/filedownloadlist/default.asp
gsolu
02-06-2004, 08:58 PM
Got it. Thanks much...
whammy
02-06-2004, 09:10 PM
:cool:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.