TinyPortal

Development => Feedback => Topic started by: Rafferty on November 17, 2007, 12:07:39 AM

Title: PDF in Articles
Post by: Rafferty on November 17, 2007, 12:07:39 AM
Is there a means to display PDF documents within articles or is it not possible at the moment

Keep up the great job!!
Title: Re: PDF in Articles
Post by: IchBin on November 17, 2007, 12:22:22 AM
There's no way to do that currently, and no plans that I know of.
Title: Re: PDF in Articles
Post by: Xarcell on November 17, 2007, 12:41:51 AM
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.
Title: Re: PDF in Articles
Post by: Xarcell on November 17, 2007, 12:49:20 AM
Have you tried something like:
<object data="URL TO YOUR PDF.pdf" type="application/pdf" width="900" height="750" ></object>
Title: Re: PDF in Articles
Post by: Xarcell on November 17, 2007, 12:58:09 AM
YOu may have to use an Iframe.

Apparently, the flash PDF reader isn't officially released yet.
Title: Re: PDF in Articles
Post by: Rafferty on November 17, 2007, 01:26:56 AM
The little snippet worked fine for the time being, appreciate it, thanks
Title: Re: PDF in Articles
Post by: bluedevil on November 17, 2007, 02:27:16 AM
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
Title: Re: PDF in Articles
Post by: Ken. on November 17, 2007, 02:35:56 AM
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>


Title: Re: PDF in Articles
Post by: bluedevil on November 17, 2007, 03:08:48 AM
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
Title: Re: PDF in Articles
Post by: Ken. on November 17, 2007, 12:23:24 PM
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.