TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 25, 2024, 09:05:29 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,173
  • Total Topics: 21,219
  • Online today: 319
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

PDF in Articles

Started by Rafferty, November 17, 2007, 12:07:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rafferty

Is there a means to display PDF documents within articles or is it not possible at the moment

Keep up the great job!!

IchBin

There's no way to do that currently, and no plans that I know of.

Xarcell

#2
over at tufat, there is a flash PDF reader that will display it right in your article.

I think the reader cost $5 though.

EDIT: I didn't see it there. I did see it somewhere though. I will see if I can find it somewhere real quick.

Xarcell

Have you tried something like:
<object data="URL TO YOUR PDF.pdf" type="application/pdf" width="900" height="750" ></object>

Xarcell

YOu may have to use an Iframe.

Apparently, the flash PDF reader isn't officially released yet.

Rafferty

The little snippet worked fine for the time being, appreciate it, thanks

bluedevil

I am looking for the same thing.

I was able to use Iframe.  I think this will do.

http://www.midwestavalancheclub.com/index.php?action=avcalendar

Ken.

#7
Looks like that works good bluedevilâ,,¢, you may want to try the auto-resizing iframe code that G6 posted some time back... I use it on some articles/iframes and it works well.

EDIT: Just happened to have a copy handy.  ;)

<script type="text/javascript">

/***********************************************
* IFrame SSI script II- ? Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids)
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids] : document.getElementById(iframeids)
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>

<iframe id="myframe" src="http://www.yoursitehere.com/page_to_display/" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="width: 100%; display: none;" frameborder="0" scrolling="no"></iframe>


" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

bluedevil

wow!  Thats one big code hehehehe..

i was using this one:

<IFRAME src="http://www.anyurl.com/" width="100%" height=1050></IFRAME>


Thanx il try that

Ken.

It helps in that for most cases it will do away with the double scroll bar effect... in most cases being the key words because a few times I've had to change the scrolling="no" to scrolling="yes" in order to get it to work correctly.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.