Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll PDF embedded in HTML

Tags:

html

pdf

I have embedded a PDF file in Iframe. My html file has buttons "UP", "DOWN". When I click on these buttons, I want the pdf to scroll up or down.

Is there a way to control the pdf with javascript or any other way. I will be using Internet Explorer6 for this application and Acrobat pdf reader.

like image 822
user418836 Avatar asked Aug 12 '10 20:08

user418836


People also ask

Can you make a PDF scroll?

Or you can right click anywhere in the PDF and choose Vertical or Horizontal, Single Page or Two Page, tick Continuous Scroll and click Read Mode On or Off from the pop-up menu.

How do I display a PDF in HTML page?

The easiest way to put PDF in an HTML document is using the <a> tag with its href attribute. You need to add the URL or the reference link of your PDF file to the element.

Can you embed HTML in PDF?

The 'Insert HTML to PDF' flow action inserts the HTML data provided into the PDF document provided. The HTML data will be inserted as a new pages(s), either at the end (default) or the beginning of the PDF document.

How do I embed a PDF in iframe?

Right-click on the link in the href attribute and click Copy link address. Create a new Text content block. Click the Embed Media icon and embed the HTML code in an iframe that points to the PDF URL you noted in step 3. Click the checkmark to see the PDF displayed in the newly created iframe.


2 Answers

Hardly.

What you might be able to do is to put the iframe into a div with overflow: auto, and give the iframe a very large height value so the containing PDF is at full size. Make the surrounding div less tall than the iframe. When your buttons get clicked, scroll the surrounding div.

I haven't tested it so there may be some snag on the way, but this could work - and is probably the best you can do.

like image 84
Pekka Avatar answered Oct 12 '22 06:10

Pekka


You can read PDF Open Parameters.

Briefly you create an <object> tag such as <object type="application/pdf" data="file1.pdf" width="500" height="650" ></object> and you pass the parameters like file1.pdf#toolbar=0 &scrollbar=0. You can manage the up-down with links or images with html.

like image 31
Sotiris Avatar answered Oct 12 '22 07:10

Sotiris