Forum Moderators: open

Message Too Old, No Replies

Is it possible to include pdf and html on the same page?

... without using frames that is

         

thempian

3:59 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



I may be putting a fairly large document on the web. For load speed, I'd be more comfortable splitting the document into 2-3 pdf files. I would like it if, on one page, I could have the pdf displayed, along with html links to go to the next and/or previous chunk of document.

But I don't think this is possible without using frames. If it *is* possible, please show how.

DrDoc

4:14 pm on Jan 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, it is not possible... and not even advisable.
Split the document up into several HTML pages.
Many people (myself included) turn off the automatic loading of PDF documents in the browser. Many others (myself included again) don't even surf with IE.

There are also several disadvantages of using PDF over HTML...

Shadows Papa

5:55 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Yeah, Doc -
A. FILE size - PDF's will be larger in almost all cases.
B. Processor load - I loaded a PDF file, this place had some jobs open and they ONLY way they posted them was in a PDF file, it loaded my processor so bad I couldn't do other work while the several meg file loaded for me to read.
(I have an AMD 1800 and half a gig of ram and an almost empty 40gig drive, so don't blame my computer!)
C. most of the world is still dial-up no matter what the techno-geeks want it to be (see A. and B. above)

Shadows Papa

choster

6:16 pm on Jan 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not accustomed to contradicting either DrDoc or ShadowsPapa, but yes, it is possible to embed a PDF in an HTML page. Any binary object can be embedded in HTML via the <object> tag-- Flash movies, RealMedia streams, VR portals. Of course, they are both right that PDF is often a terrible option.

Have a look at
www.planetpdf.com/mainpage.asp?webpageid=1682

DrDoc

8:44 pm on Jan 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, choster, you're right that it is (technically) possible to embed any file on your Web page. However, reality tells us the support is extremely quirky. There are times when it would work, and other times when it wouldn't.

Embedding Flash, Audio, or even movies, is a much easier solution... and you can get it to work in most browsers. But PDFs are a totally different story. :)

Still, the <object> tag would be the way to do it. So thanks for bringing that up, choster. Let us know what you decide to do, and how it goes, thempian

On another note, that page with embedded PDFs caused my browser to crash :)

Shadows Papa

9:34 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Just because you CAN does not mean you SHOULD.
(and Doc just mentioned one other reason - you can crash browsers.
In all cases, simple is better. I totally avoid some pages because I don't like restarting apps, let alone my OS, and those tricks can cause just that. So although it was accurately stated that you could do it....., I was intending to mention why one should not do it. I've learned a lot here, and by "observing" and now lately by listening to my son who is a major in graphic design and web design - they preach to him "simple simple simple" and they don't advocate embedding things like Flash, in fact, they won't even spend much class time on that as they believe commercial sites should avoid it.

I guess I've never seen a reason to put a PDF in as part of the page - I will link to them so the user can download them, as in a newsletter, or a form, etc.

Just my 2 cents (USD) worth, probably about .005 now with this economy.

Shadows Papa

thempian

12:33 am on Jan 28, 2004 (gmt 0)

10+ Year Member



I should clarify. I wanted to present a document that is probably around 50 pages in Microsoft Word.

Now I know Word has the option of saving in HTML, but of course the resultant HTML is bloated and ugly and inefficient and I'd never want my name associated with anything like that.

Allowing users to download the Word file would be one option, but I didn't want someone to be able to accidentally alter or delete content, and the standard viewing modes for Word (other than Print Preview) display tables differently than the actual printed output, with slightly visible lines even when the table has no visible borders.

So for reasons of presenting an unalterable, truest to life representation of what I'd started with, without having to use the horrible HTML that Word produces, or without laboriously converting 50 pages of Word to HTML, I chose pdf.

*My* browsers (IE and Netscape 7.x, both Windows and Mac) default to presenting pdf files rather than downloading them. Sorry for the dumb question, but is there a way in html to force a download rather than a view?

Anyway, I'll pass on using the <object> tag, although it's nice to know about. Of course, any time I have a link that leads to a pdf file, I say so, mentioning the size of the file.

Thanks to all for their suggestions.

encyclo

12:45 am on Jan 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is there a way in html to force a download rather than a view?

If you've got php, this should work:

Save this as a text file with a file name something.php :

<?php header('Content-Type: application/pdf'); 
header('Content-Disposition: attachment; filename=your_filename_here.pdf');
?>

And link to the PHP file. I don't know ASP, but I'm sure you can do something similar in that too.

robert adams

7:42 am on Jan 29, 2004 (gmt 0)

10+ Year Member



the choice of whether a pdf file displays in the browser or downloads is a setting in either/or the browser and/or your pdf reader (usually acrobat) . you can turn it on or off at will.

luck,
robert