Log in

View Full Version : Open PDF in a predetermined window size



steverf
12-27-2011, 05:03 PM
Hello Everyone, Happy Holidays...

Is there a way to force the opening of a PDF file (assume there is a link on the page to open the file) into a smaller window? When selecting a link on a test page to open the pdf in a new window, the file opens in a window that I would rather be much smaller.

Here is a basic link to open a pdf in a new window... Can I force that window to be smaller?

<a target="_blank" href="a_pdf_file.pdf">Open PDF File</a>

Any suggestions would be appreciated.

Steve
Perdido beach, AL

jscheuer1
12-27-2011, 07:49 PM
Not with HTML alone. You can if you add a little javascript:


<a target="_blank" href="a_pdf_file.pdf" onclick="open(this.href, this.target, 'width=600, height=450, top=200, left=250'); return false;">Open PDF File</a>

djr33
12-27-2011, 11:32 PM
You can open a window and have the browser go to the location of the PDF. However, many browsers won't have a built in PDF viewer, so it will just open in their default PDF application after they get the "save as" dialog. There's nothing you can do to control that, but if they do open PDFs in their browser, what John suggested will work.

molendijk
12-28-2011, 02:20 AM
John's solution doesn't seerm to work in Firefox. It opens the PDF in a full size window on my machine.
This wors with me:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>PDF predetemined size</title>

<script type="text/javascript">
function pdf(div)
{close_div=div
document.getElementById(div).innerHTML="<div style='position: absolute; left: 100px; top: 70px; right: 100px; bottom: 100px; border: 1px solid black'><div style='position: relative; float: right; cursor: pointer; top: 5px;z-index:1000;background:white' onclick='document.getElementById(close_div).innerHTML=&quot;&quot;'>CLOSE&nbsp;<\/div><iframe src='a_pdf_file.pdf' style='position: absolute; width: 100%; height: 100%' frameborder='0'><\/iframe><\/div>"
}
</script>

</head>

<body><div>
<div id="some_div"></div>

<a href="javascript: void(0)" onclick="pdf('some_div')">include PDF</a><br>

</div></body>

</html>


Arie Molendijk.

jscheuer1
12-28-2011, 06:03 AM
John's solution doesn't seerm to work in Firefox. It opens the PDF in a full size window on my machine.

That's browser configuration:

Tools > Options > Tabs > Open new windows in a new tab instead

I think any, certainly most can do that. If you uncheck that item, the code from my post works in Firefox.

I just tried your method. It didn't open in the iframe, it opened in the reader, no browser window at all. Even if it had opened in the iframe, it wouldn't have been in a separate browser window.

The bottom line with this sort of thing is like djr33 says, it depends upon how the browser is configured. And upon the OS - how it's configured to display PDF. The PDF file itself might have some control over where it will allow itself be loaded.

djr33
12-28-2011, 07:01 AM
The PDF file itself might have some control over where it will allow itself be loaded.
I've never heard of that.

The OS can affect it, although it's really the browser+OS. For example, on a Mac firefox has no PDF plugin (not that I'm aware of), but Safari uses a native in-browser viewer. On a PC, adobe acrobat reader works in most browsers.

jscheuer1
12-28-2011, 11:18 AM
The PDF file itself might have some control over where it will allow itself be loaded.


I've never heard of that

I haven't specifically either. I said might. The PDF format is constantly evolving and I did have a professional version of Acrobat once a long while back. It's pretty amazing, even back then the amount of control one could have over the document.

All of this sort of points to the fact that with PDF and windows (an iframe is also technically a type of window), the browser and other circumstances have more control over the presentation than the designer does.

The beauty of PDF is that almost everyone can see it and save it. It's great for manuals and other sorts of documents that need to be shared across platforms and referenced in detail. But it's not a presentational tool. You can take your best shot at its presentation. But if you want your content to look and feel a certain way, and it can be represented in HTML, that's the better way to go.

molendijk
12-28-2011, 03:48 PM
Got it!
You can use the solution I proposed above, except for the iframe's url.
You have to put:

...<iframe src='http://docs.google.com/gview?url=http://your_path/a_pdf_file.pdf&embedded=true'
Arie.
EDIT: Your should also make some changements regarding the position of the CLOSE button. Here's a working demo example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>PDF predetemined size</title>

<script type="text/javascript">
function pdf(div)
{close_div=div
document.getElementById(div).innerHTML="<div style='position: absolute; left: 100px; top: 70px; right: 100px; bottom: 100px; border: 1px solid black'><div style='position: relative; float: right; cursor: pointer; top: 30px;left:-17px; z-index:1000;background:white' onclick='document.getElementById(close_div).innerHTML=&quot;&quot;'>CLOSE&nbsp;<\/div><iframe src='http://docs.google.com/gview?url=http://mesdomaines.nu/pdf/pdf1.pdf&embedded=true' style='position: absolute; width: 100%; height: 100%' frameborder='0'><\/iframe><\/div>"
}
</script>

</head>

<body><div>
<div id="some_div"></div>

<a href="javascript: void(0)" onclick="pdf('some_div')">include PDF</a><br>

</div></body>

</html>

djr33
12-28-2011, 10:44 PM
(My comment here is a bit off topic...)

it's not a presentational tool. You can take your best shot at its presentation. But if you want your content to look and feel a certain way, and it can be represented in HTML, that's the better way to go.In my experience, PDFs actually are much more stable than HTML for presentation. If you have a PDF that looks one way on one computer, then it will almost always look the same way on another computer. Once in a while there are issues with that, but usually you can avoid that by setting certain options when creating the PDF, such as whether to embed the core fonts or use the system defaults. At least in my case when I'm used to dealing with foreign character sets (eg, Chinese or Arabic) for publishing linguistics papers, PDFs are the only reliable way to go, compared with word documents for example. On the other hand, HTML is probably a close second, but browser variations make it less stable. PDFs are limited to one resolution (paper size, usually), so HTML is a little better in that sense.
What difficulties have you had with specifying presentation properties in a PDF? Or do you mean that it's hard to create the PDF in the first place? That's generally true, unless you can export from your program directly as a PDF, in which case it usually looks identical to what you're creating the document in (such as MS Word). Or a "PDF Printer" can be added to your system so that anything you could print can also be converted to a PDF and saved; that's built in on a Mac, but available for PCs.

Of course if you're making a website, it's always best to use HTML when you can and only use PDFs when you intend for your visitors to download and print or download and save a document. It's also important when you need exact formatting so that everyone has the same document (for example, for a page count reference--- "see page 5").

jscheuer1
12-29-2011, 05:49 AM
I meant (as was the original question) the presentation of the PDF by the browser. Of course, if you embed the fonts and take other precautions, the PDF will look virtually the same to all users. You cannot control what the browser will do or if the user even has a PDF reader installed. If what Arie proposes works as advertised, that gives you more control, but you will have to be satisfied with an iframe. However, this business with iframe gave me an idea. If what Arie says works, you could launch a javascript modal window like FancyBox and have the iframed PDF in it. Browser peculiarities would be minimized and it would look like a separate window. It would be tied to the parent page though, and still relies upon the user having a PDF reader installed that the browser will use in the iframe. This last perhaps not, if the Google PDF/iframe interface obviates that requirement.

djr33
12-29-2011, 07:48 AM
PDFs are not meant to be part of the web. Some browsers make it seem like they can be using PDF reader plugins, but that won't always work. You can get close, but it won't be perfect.

If you want a true seamless PDF experience in the browser, the best option is to use a server side program to convert the PDF to images then display those in a small window (iframe, browser window, modal window, etc), which will work however you want in any browser. It's possible to convert PDFs to images automatically, although it isn't too easy. Just do a google search and you'll get some basic results, though. For example, check "php convert pdf jpeg".
For an idea of what that experience would be like, just check out google books.

molendijk
12-30-2011, 12:06 AM
I think that we can also do the job using http://docs.google.com/gview. That will dispense us from converting pdf to images and will allow us to use part of the PDF-functionality.
We could do something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>PDF predetemined size</title>

<script type="text/javascript">
function remove_from_dom(tag,className) {
var els = document.getElementsByTagName(tag)
for (i=0;i<els.length; i++) {
if (els.item(i).className == className){

els.item(i).style.border="0";
els.item(i).innerHTML="";
els.item(i).style.zIndex=-1;
els.item(i).style.position="absolute";
//while (els.item(i).firstChild)
//els.item(i).removeChild(els.item(i).firstChild);
}
}
}

function pdf(div,url,css)
{close_div=div;
remove_from_dom('div','pdf')
document.getElementById(div).innerHTML="<div class='pdf' style='"+css+"'><div style='position: relative; float: right; cursor: pointer; top: 32px;left:-17px; background:white; z-index:1' onclick='document.getElementById(close_div).innerHTML=\"\"'><button style='cursor: pointer'>CLOSE<\/button><\/div><div style='position: absolute; cursor: pointer; top: 30px;left:2px; z-index:1;background:transparent'><div style='display:none; cursor: pointer' id='embedded'><button style='cursor: pointer' onclick='document.getElementById(\"ifr\").src=\"http:\/\/docs.google.com/gview?url="+url+"&amp;embedded=true\";document.getElementById(\"embedded\").style.display=\"none\"; document.getElementById(\"chrome\").style.display=\"inline\"'>View in Basic Mode<\/button><\/div><div id='chrome' style='display: inline; cursor: pointer'><button onclick='document.getElementById(\"ifr\").src=\"http:\/\/docs.google.com/gview?url="+url+"&amp;chrome=true\"; document.getElementById(\"embedded\").style.display=\"inline\"; document.getElementById(\"chrome\").style.display=\"none\"' style='cursor: pointer'>View in Extended Mode<\/button><\/div><\/div><iframe name='ifr' id='ifr' src='http://docs.google.com/gview?url="+url+"&amp;embedded=true'"+" style='position: absolute; width: 100%; height: 100%' frameborder='0'><\/iframe><\/div>"
}
</script>


<script type="text/javascript">

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
win.focus()
}

</script>

</head>

<body style="font-family: verdana; font-size: 12px"><div>

<div id="some_div"></div>

<a href="javascript: void(0)" onclick="pdf('some_div','http://mesdomaines.nu/eendracht/include_pdf/pdf1.pdf','position: absolute; left: 100px; top: 70px; right: 100px; bottom: 100px; border: 1px solid red; ')">Load PDF in an iframe and put it in a div</a><br><br>

<a href="javascript: void(0)" onclick="pdf('some_div2','http://mesdomaines.nu/eendracht/include_pdf/pdf2.pdf','position: relative; left: 20px; top: 17px; width: 750px; height: 400px; border: 2px solid black;')">Load another PDF in an iframe and put it in another div</a><br>

<div id="some_div2"></div><br>

<a href="http://docs.google.com/gview?url=http://mesdomaines.nu/eendracht/include_pdf/pdf1.pdf&amp;embedded=true" onclick="NewWindow(this.href,'name','800','600','yes');return false;">PDF in popup (basic mode)</a><br><br>

<a href="http://docs.google.com/gview?url=http://mesdomaines.nu/eendracht/include_pdf/pdf1.pdf&amp;chrome=true" onclick="NewWindow(this.href,'name','800','600','yes');return false;">PDF in popup (extended mode)</a><br><br>

(View source for scripts and usage).

</div></body>

</html>
I made a demo HERE (http://mesdomaines.nu/eendracht/include_pdf/pdf.html).
===
Arie.

djr33
12-30-2011, 12:22 AM
I think that's a silly way to approach this. Either you want a browser document (use HTML!), or you want a document that the user can download and print (use a PDF!). If you're mixing both, it seems like you'll be doing neither one very well.
Sure, you're technically embedding the PDF into the webpage, but I'm not sure how useful that is. At the very least, you'd still want to give a direct link to the PDF so that they can download the PDF-- that is, after all, the whole point of a PDF.

The main technical reason I'd suggest avoiding google is that it's slow for the page to load because it needs to convert the PDF. Some PDFs may convert quickly but others may take a significant amount of time.

The other issue is that google likes to use the public (eg, web designers) to test their software then often changes it so that your site is broken; either you need to update to their newer version or they actually won't let you use it any more (sometimes for a fee). If this is a for-fun personal project that's fine, but if it's something you want to be reliable, then relying on google isn't the best idea. They also might block requests from your website if you overuse it.
(As an example of google doing this, just look at what happened to their Google Translate API-- it was very useful, then shut down with very little warning. Other services have had a similar fate.)

molendijk
12-30-2011, 12:51 AM
I think that's a silly way to approach this. Either you want a browser document (use HTML!), or you want a document that the user can download and print (use a PDF!). If you're mixing both, it seems like you'll be doing neither one very well.
No, I don't agree. You can download and print the file by choosing 'view in extended mode' (if you are not already in extended mode) then clicking 'download original'. This will allow you to download and/or print the file. EDIT: in extended mode, you can also click on 'File' (to the left) for downloading and/or printing.


Sure, you're technically embedding the PDF into the webpage, but I'm not sure how useful that is. At the very least, you'd still want to give a direct link to the PDF so that they can download the PDF-- that is, after all, the whole point of a PDF.
See above.


The main technical reason I'd suggest avoiding google is that it's slow for the page to load because it needs to convert the PDF. Some PDFs may convert quickly but others may take a significant amount of time.
I tested big files and they loaded rather quickly


The other issue is that google likes to use the public (eg, web designers) to test their software then often changes it so that your site is broken; either you need to update to their newer version or they actually won't let you use it any more (sometimes for a fee). If this is a for-fun personal project that's fine, but if it's something you want to be reliable, then relying on google isn't the best idea. They also might block requests from your website if you overuse it.
(As an example of google doing this, just look at what happened to their Google Translate API-- it was very useful, then shut down with very little warning. Other services have had a similar fate.)
That's something which holds for lots of things. Think of new browser versions that sometimes destroy your code.

So in the end, I don't quite agree with your comment.
===
Arie.

djr33
12-30-2011, 01:20 AM
I see your position, but I stand by what I said. At least it is true that very rarely will you need to do something like this. Either you want a document (PDF) to download, or you want a webpage. Once in a while there might be a reason to mix the two, but in each case I'd need to be convinced that 1) it's necessary (rather than just excessively fancy) and 2) it is better than alternatives, such as having a downloadable PDF with the same content as a real webpage. In fact, that's the main point here. Why not just have the same content in a .pdf and a .html file?

Having an embedded preview of the PDF on the page is fine, but the standard way to do that is by using images. That's what publishers do. For example, I download a lot of articles from academic publishers and they provide a PDF. Often on the page there is a preview which can range from 1) an image of the first page; or 2) a collection of images for the whole document; to 3) a fully converted HTML version of the document.
Those are the industry-standard options.

Using google docs on your site will also look cheap. Technically, it will work well. But it will look like you either can't afford to do it yourself (eg, PDF to image conversion), or you don't want to bother. If you have no alternative, it's reasonable. But I'd be skeptical about any "real" company that had to use google docs like this. It entirely depends on the site though. If it's just a for-fun site for family or something, obviously that's not a concern.


I tested big files and they loaded rather quicklyIt's not about file size, but about the kind of data in the PDF. If it's text, that will load fast. If it's a PDF made up of images (eg, a scanned book chapter) it will be slow. If you don't know what kind of PDFs will be used in this, it might be slow. If you can control it so that they are only text PDFs, then you can avoid the slowness. (One measure to check this would be filesize divided by page count-- if each page is 1MB, that will be slow.) Regardless, it will need to reconvert every time then load the image; even if it's not significant, it will always be faster to store these images rather than generate them each time someone loads the document.

And in the end, google docs just converts the PDF to images. So you're not gaining anything by using google docs except avoiding converting the PDF to images yourself (and the google interface if you like that). That's something to think about.


Anyway, what you're suggesting is a perfectly reasonable solution in some ways. It's just not my preference. And I don't think it's necessarily better than alternatives.

The main question is still whether there's any need to actually embed the PDF at all. If used in the standard way that PDFs are, then they're usually documents that are meant to be printed or downloaded, so that the most you'd get by embedding them is giving a preview. That might be a bonus, but the core purpose is still downloading the original file.

jscheuer1
12-30-2011, 01:43 AM
Hey Arie,

This is sort of what I was talking about awhile back when I mentioned "arguing in front of the children".

What do you think steverf (the person who originally asked the question) is going to take from all this discussion, anything? Or do you think it more likely he'll be confused and/or conclude that none of us knows what we're talking about and give up and/or go elsewhere?

In this particular case, as I don't think there is an optimal solution, and think that the original 'problem' doesn't really need one, I haven't tried to curtail things to a point where it might actually be useful to the original poster.

I'm mostly only mentioning this here and now so that hopefully you might better understand what I was talking about before about "arguing in front of the children" - that is if that was unclear before.

If this were a real problem with a real solution though, I think I'd ask you and djr33 to take your theoretical discussion elsewhere (to another thread) and leave only proven working code in this one.

djr33
12-30-2011, 02:41 AM
You have a point, but in this case I think the theoretical discussion is the point: PDFs are not part of webpages, and they are not meant to be. The original approach is wrong, so determining what to do about webpages+PDFs is the point.
But more importantly, I think the question has already been answered. If the goal is to have some code that works, we've given examples of the best code available, so following the discussion is helpful for anything more than just wanting plug-and-play code.

steverf
01-02-2012, 10:56 PM
Original Poster's Reply...
Hello everyone... I must apologize for the delayed reply. (Christmas delay)
I thank you all for your expertise.

As a general reply to all, here is the issue with a bit more detail:

I have given 2 individuals access to post a PDF file with a specific filename (ie.e newsletter.pdf) and placed into a specific location in the website structure. Access was granted by use of a system written in php that allows access to only the locations that the PDF file is to be posted. There are a total of 3 seperate access points and storage locations within the website structure.

When visitors are on the site and click on one of 3 menu items, the associated PDF is opened in a new window. Currently, I am not controlling the window size at all. That is what I wish to have some control over. Assume most folks are using the adobe reader to see the PDF. It should appear nearly identical, regardless of the browser.

What I would really like, is to be able to open the new window (showing the selected PDF) with some window size restrictions.... i.e. a bit smaller than the current browser window.

The users creating the newsletter PDF only has access to MS Word 2007 for creating a nice PDF. It does not allow sizing of the PDF, although it does allow a minimum setting for web publishing.

This method relieves me of having to deal with or publish several documents that change every couple of weeks.

This gives everyone a better idea of what I am doing.

You are all much more expert than I. I wanted you all to know how very much I appreciate every single reply and suggestion... Believe me, I am looking at every comment.

Look forward to hearing more...
Steve
Perdido Beach, AL

jscheuer1
01-03-2012, 05:01 AM
Let me try to summarize:

You cannot control what the user's browser will do. It may block the popup or force it into a tab instead of a new window. That's the situation with the current code you are using.

You can do various things, all outlined in posts throughout this thread. Some are given in great detail, some in less detail. All have pluses and minuses, most of which are outlined where they're introduced, or shortly thereafter in the thread. My first response:

http://www.dynamicdrive.com/forums/showthread.php?p=266838#post266838

Is probably the simplest, and if you're more or less happy with what you have now and just want to control the window size, that's the way to go. Some browsers can and will override it, showing the PDF in a tab or in Acrobat with no window. That part is no different than what you're already doing.

It could be elaborated upon:


<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function openPDF(file, target){
var dec = 0.7; // decimal fraction of existing window dimensions to use
var b = document.compatMode && document.compatMode === 'CSS1Compat'? document.documentElement : document.body;
var wd = typeof innerWidth === 'number'? {w: innerWidth * dec, h: innerHeight * dec} : {w: b.clientWidth * dec, h: b.clientHeight * dec};
var wp = window.opera? {t: 30, l: 30} : {t: screen.availHeight / 2 - wd.h / 2, l: screen.availWidth / 2 - wd.w / 2}, ua;
if(/safari/i.test(ua = navigator.userAgent) && !/chrome/i.test(ua)){alert('If the PDF appears blank, click twice on the blank area and attempt to scroll it.');}
open(file, target, 'width=' + wd.w + ', height=' + wd.h + ', top=' + wp.t + ', left=' + wp.l);
return false;
}
</script>

</head>
<body>
<a target="_blank" href="http://samplepdf.com/sample.pdf" onclick="return openPDF(this.href, this.target);">Open PDF File</a>
<div>For those having trouble with viewing the PDF files, make sure you have the latest <a href="http://get.adobe.com/reader/">Adobe Acrobat Reader</a> installed. If you're still having problems, right click on the link to the PDF file and choose 'Save link as' or 'Save target as'. Once you've downloaded the file, you may open it in Adobe Acrobat.
</div></body>
</html>

If you want to try to force the PDF into a popup or into an iframe that the browser cannot block as long as javascript is turned on, use one of the other methods mentioned.

But that gets complicated and can still end up other than intended if the user turns off javascript or for various reasons as mentioned in this thread

djr33
01-03-2012, 05:02 AM
Hi Steve,

Well I think we've explained the situation generally. Does any of the code work for you? (If so, which?)

If you are willing to accept that this will only work for those with PDF plugins (so that some visitors will still download a PDF as a file to their computer and view it separately), then you can accomplish what you want pretty easily. In fact, in that case all you'd need to do is use Javascript's window.open() method to create a new window of whatever dimensions you want. It won't guarantee that the browser doesn't download the file instead, but for anyone with acrobat reader (or something similar) it should follow your suggested window information. It might also be blocked by a popup blocker, but hopefully it'll work. And it is much less likely to be blocked if you use a user-initiated event, such as a click (rather than, for example, the page loading and automatically launching it).


More generally, though, I think the better solution here would be to have your colleagues create HTML webpages rather than PDFs and publish them that way. Then you'd have full control over this. Unless there is a reason that you want/need PDF, then on the web HTML is a better format.
Of course if your colleagues can't create HTML pages (if they don't know how), then the benefit of using a PDF is that, despite differences in how they view the PDF, at least they'll all view the same thing the same way; if it's badly written HTML*, then they might often get a messed up page they can't view very well.
(*For example, the automated HTML that comes from exporting an MS-Word document-- avoid using that.)



As for "sizing the PDF", I think it does. It sizes it to whatever the Word document is set to. But that doesn't stop zooming or resizing the window in which the document is viewed. And since most standard documents (eg, letters, not business cards) are larger than the dimensions of the screen, it's not surprising that you get a big window by default. Display/window size and PDF dimensions are two different things, and, no, I don't think there's any way to specify how a PDF should be viewed (in a viewing program) in the PDF itself. In short, PDF sizes are based on printed document size, not how it's viewed on the screen.

jscheuer1
01-03-2012, 02:52 PM
Original Poster's Reply...
When visitors are on the site and click on one of 3 menu items, the associated PDF is opened in a new window. Currently, I am not controlling the window size at all. That is what I wish to have some control over.

That's not really true. You are also not controlling whether or not the window opens at all. It could be blocked, it could be forced into a new tab, it could be forced into an Acrobat only window.

By using the open command as I described in post #2 in this thread and elaborated upon in post #19, you can - where a given browser will allow it, have control over the size. The same restrictions/caveats as apply to your current setup - which you seem to be unaware of - would also still apply once you get 'control' of the size.

I think this is all very acceptable. Because in most cases, regardless of what happens the user will get to see the PDF in some window that's not the current window. Most of the time it will be the window you've configured, some of the time something like it, but overridden in one or more aspects by the browser. That's about all you can be assured of. In those few cases where the user cannot even view the PDF, you should have a link to the free Adobe reader (Acrobat) and advice to download the PDF file by right clicking on its link and choosing 'save as'.

Something like:


For those having trouble with viewing the PDF files, make sure you have the latest Adobe Acrobat Reader (http://get.adobe.com/reader/) installed. If you're still having problems, right click on the link to the PDF file and choose 'Save link as' or 'Save target as'. Once you've downloaded the file, you may open it in Adobe Acrobat.

Put that somewhere on the page that has the links to the PDF files, somewhere where it can get noticed. Or have a 4rth menu item - Help Viewing PDF - that links to a page with that advice. Do Not have that link or the Adobe Acrobat Reader link open in a separate window, that (popups being blocked) may be part of the person's problem.

steverf
01-18-2012, 04:55 AM
Hello Everyone...

I want to thank everyone for all the suggestions and replies. I am still digesting all this...

As a note, you are correct. The personnel that would be posting the Newsletters, Bulletin and other pdf documents, haven't a clue what HTML means or how to use it.
I was just trying to provide them with an easy and reliable way to post a document that they are familiar with creating. One person creates a church bulletin using MS Publisher 2007. It has a built in PDF creator and renders nicely even with a few graphics. 2 other people will be posting newsletters created with Publisher or Word and exporting a PDF file to be displayed on the website. Assume all users do have adobe reader.

I am just looking for the most reliable way to display the pdf's so that the person creating the document is responsible for posting it.

and the final wish was to be able to control the pdf window ....

I am looking at all these comments and suggestions and am back on top of it now with no more delays...

What a nice bunch here in Dynamic Drive... You folks have really worked hard to give me all kinds of choices here... I am thankful to everyone ! I am trying to figure all this out and will try several ideas based on all this expertise... I'll post right back... even if I make a total mess out of it..smile

Steve
Perdido Beach, AL

Moderator's Note: This thread has become a spam magnet so I'm closing it. If you wish to continue it or ask about it, please start a new thread and refer back to this one - jscheuer1