Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-18-2013, 02:42 PM   PM User | #1
EricMatthews
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
EricMatthews is an unknown quantity at this point
Embedding PDFs using HTML5

Hello, everyone! I'd like to embed PDF files in the browser (mostly mobile). We'd like to avoid solutions that first must go through Google or what have you for privacy reasons. I know this is possible by way of various services like FlexPaper or PDFTron, but FlexPaper doesn't work so well for a lot of our mobile devices and other services are quite expensive. Is there a simple way to just display the PDFs even forgoing a lot of the additional functionality those other services provide? Or perhaps a nice simple open-source version?
EricMatthews is offline   Reply With Quote
Old 01-18-2013, 08:18 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,468
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
The simplest way to embed a PDF into a web page using any version of HTML is

<img src="mydoc.pdf">

Those solutions you mention are for generating PDFs and not for simply embedding them in a web page.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Users who have thanked felgall for this post:
EricMatthews (01-22-2013)
Old 01-22-2013, 03:41 PM   PM User | #3
EricMatthews
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
EricMatthews is an unknown quantity at this point
Thank you. That seems to work okay for the iOS side except it doesn't seem possible to scroll through the content (whereas on the desktop it lets you scroll within the allotted area). Our Android tablets won't render it at all. The main devices accessing the PDFs are Android tablets. Not sure what else to try really.
EricMatthews is offline   Reply With Quote
Old 01-22-2013, 06:20 PM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,615
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Have you tried the <object> element?
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
EricMatthews (01-22-2013)
Old 01-22-2013, 08:02 PM   PM User | #5
EricMatthews
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
EricMatthews is an unknown quantity at this point
Quote:
Originally Posted by VIPStephan View Post
Have you tried the <object> element?
Yes indeed. And it works great on desktop or iOS, but the browsers (default and Maxthon) on the Android tablet won't show anything but the "alt :" option.
EricMatthews is offline   Reply With Quote
Old 01-22-2013, 09:08 PM   PM User | #6
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,468
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Are you sure that the browser has a PDF plugin installed so that it can display the PDF inside the browser?
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Users who have thanked felgall for this post:
EricMatthews (01-23-2013)
Old 01-22-2013, 09:33 PM   PM User | #7
EricMatthews
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
EricMatthews is an unknown quantity at this point
You know, I had to borrow someone else's tablet since mine is being returned at the moment and probably made the mistake of assuming they had one on there too. I will surely try this tomorrow.
EricMatthews is offline   Reply With Quote
Old 01-23-2013, 03:05 PM   PM User | #8
EricMatthews
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
EricMatthews is an unknown quantity at this point
I have the Adobe Reader on the tablet but the <img src="theurl.pdf"> and <object> methods don't seem to be working.

Code:
<img src="theurl.pdf">
<object data="theurl.pdf" type="application/pdf" 
  width="100%" height="1200">
  alt : <a href="theurl">Feeney</a>
</object>
EricMatthews is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:41 AM.


Advertisement
Log in to turn off these ads.