473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get the position of the scrollbar of a pdf within an iframe

Hi

I have a requirment in which there is a pdf file which gets opened within html and there is a check box after the pdf file.. Now the requirment is that user needs to scroll down till the end of the PDF file and only then the checkbox shld get enabled (simlar to a licenes agreement).. I have included the pdf file within an iframe but i am not able to get the scroll position which should be the EOF, since the scroll is that of the PDF...

how do i go abt achieveing this??? using anything will do jsp or javascript or even java.
Sep 30 '10 #1

✓ answered by acoder

Checking again, maybe there is a way to interact, but it doesn't look simple and straightforward (something to do with viewState).

Anyway, I've thought of a possible solution. Why not convert the PDF documents to Flash/SWF (free tools available) and then use SWFObject to interact with the Flash file. I think you should be able to get the underlying properties, e.g. see here.

8 6026
acoder
16,027 Expert Mod 8TB
I'm not sure about the PDF, but you could use the scrollTop property of the iframe. I've not tried this, so it may not work, but it's worth a try.
Sep 30 '10 #2
Actually i have already that but it doesnt work since the scroll which appears in the iframe is that of pdf...
Sep 30 '10 #3
acoder
16,027 Expert Mod 8TB
Could you not fix the size of the iframe so that it scrolls with the PDF, i.e. it's the same size or smaller than the PDF "window".
Oct 1 '10 #4
I am not getting here what you are getting at, when i include the pdf in the Iframe the scroll which appears is that of the PDF, not of the iframe, if the PDF doesnt have a scroll it wont appear... I think you are telling me to include an iframe within and iframe, and try to set the size of the outer iframe to that of the pdf.. well i have tried that also and doesnt work :( .
Oct 4 '10 #5
acoder
16,027 Expert Mod 8TB
Say the PDF file is 1000px in height for one page. If you keep the iframe the same size or slightly smaller, that would mean that the iframe has a scrollbar (or the user can see the whole page).

Now, one way you could get this working is to keep all pages in the PDF document as separate files and have Previous/Next buttons to load the files. Do you see how that could work?

Acrobat does have its own version of JavaScript (see here), but I don't think you'll find a solution there. It'd involve changing the PDF document, I'm not sure if there's even a scroll event or any way to check it, and even if there is I don't think there's any possibility of interacting with the HTML page.
Oct 6 '10 #6
Well what a bummer that was, actually the concept of you telling me abt previous and next buttons i already have implemented in my application, because this is a series of pdf files intended for a particular user, so after reading one file, they need to click on the next button to read the next file which is meant for them based on priorty, this has all been done, the only challenge right now is to somehow make sure that the user has actually read the file.
Oct 8 '10 #7
acoder
16,027 Expert Mod 8TB
Checking again, maybe there is a way to interact, but it doesn't look simple and straightforward (something to do with viewState).

Anyway, I've thought of a possible solution. Why not convert the PDF documents to Flash/SWF (free tools available) and then use SWFObject to interact with the Flash file. I think you should be able to get the underlying properties, e.g. see here.
Oct 10 '10 #8
Thank having a look will get back to you, incase i still need help thanks a ton..
Oct 13 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jason | last post by:
so i'm loading an external web page (i.e. google.com, espn.com) into an IFRAME on top of a web application we have running in IE running on a kiosk. the kiosk is only a touch screen and has no...
6
by: Jorge Luzarraga Castro | last post by:
Hey, hope you can help with this. I have an aspx page which contains several User Control. At the beggining there´s only one visible User Control but after working with the page additional UC...
13
by: ukrbend | last post by:
I'm new to Javascript and to html and am trying to make the following code snippet work but it doesn't. It refuses to call the getPage() function and I always get a 404 error. I know the code is...
0
by: Ben Fidge | last post by:
Hi I've got a situation where I need to direct a Response.Redirect to a new window from within a page embedded within an IFrame. Currently, we have a page embedded within an IFrame that...
3
by: Jeremy | last post by:
If we have an iframe loaded from the same domain as the parent document, how can we (is it possible) to execute a function on the parent document's page? e.g. 1) On parent page:...
3
by: dhanasekaran1980 | last post by:
Hi, I am using IFRAMES to load 3rd party domains in my website. I am facing few problems using IFRAMES in IE and Firefox. 1) I am unable to login into the 3rd party website within the IFRAME....
0
by: johnw182 | last post by:
Ok, I have a asp.net project. Everything works great. HOWEVER, this project was made to be called from within a frame or iframe. When being used within the iframe the user gets a blank frame when...
3
by: Archana | last post by:
hi all, can any one tell me how will i set scrollbar to iframe throguh javascript. please help me asap. thanks in advance
3
by: lisles | last post by:
im working with asp.net 2.0 and im using master pages.i have a link to a pdf file...when i click on the link i want the pdf to open within the contentplaceholder.im using iframe within the content...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.