opening PDF file in iframe on certain page
To open on specific page, add #page=[page number]
to the end of src
<iframe width="700" height="1600" src="@Url.Action("OpenPDF", new { id = 8 })#page=4"></iframe>
if page number should be from the model, do
public ActionResult Index()
{
MyViewModel m = new MyViewModel() { FilePage = 4 };
return View(m);
}
...
@model MVC.MyViewModel
<iframe width="700" height="1600" src="@Url.Action("OpenPDF", new { id = 8 })#page=@Model.FilePage"></iframe>
how to embed PDF file into iframe using php
This should do the trick.
<body>
<iframe src="http://ipaddress/file.pdf" width="1000" height="1000"></iframe>
</body>
If the file is local you can put local file URL. But the file will not be accessible on internet.
For example:
file:///D:/WebDesign/HTML/test/file.pdf
Related Topics
Custom Attributes - Yea or Nay
Get Class List For Element With Jquery
How to Move an Element into Another Element
How to Change an Element'S Text Without Changing Its Child Elements
Where to Place JavaScript in an HTML File
Html Form Readonly Select Tag/Input
Disabling Browser Print Options (Headers, Footers, Margins) from Page
Jquery Disable/Enable Submit Button
How to Implement "Select All" Check Box in Html
Browser Detection Versus Feature Detection
Determine If an HTML Element'S Content Overflows
Converting HTML String into Dom Elements
What Is the Htmlspecialchars Equivalent in JavaScript
Maximum Size of a ≪Canvas≫ Element
Make Header and Footer Files to Be Included in Multiple HTML Pages