Forums | Mahara Community

Support /
Problems embedding PDFs in Google Apps


Don Presant's profile picture
Posts: 255

01 October 2011, 7:59

I'm trying to embed a pdf document on a Mahara page. It appears that the best way might be using the affordances of Google Docs. But I can't make it work.

If someone has an easier way of embedding pdfs, I'm all for that too. Embedly doesn't seem to work either.

 

Here is the page in a Mahara 1.4 (block in question is "Using Google Apps":

http://careerportfolio.mb.ca/view/access.php?id=1096

 

Here is the embed code from Google Docs:
(NB: I couldn't see the "Click Start publishing button" which was in Gregor's documentation for the plugin..am I blind, or did something change at the Google end?)

https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B8k4neUUAyPvMTA4Nzg1MGUtMzA2Ny00ZTYzLTg3MDYtOTBiZGEzYWI0ODMz&hl=en

Mary Cooch's profile picture
Posts: 135

01 October 2011, 14:07

Funnily enough I tried to do this too with a pdf of my own this afternoon and I couldn't do it either -neither with Google Apps or Embed.ly. I assumed I must be doing it wrong. I tried with your pdf and couldn't get it to work. (I can't see your page on your Mahara- I get the login box)

Don Presant's profile picture
Posts: 255

01 October 2011, 17:50

That's funny, it was marked aas public...I took away the other group access in cvase it was confusing things.

Anyway, the embeddded PDF thing seems to be an issue..I find that a lot of users now scan to pdf instead of jpg and it would be great to see these without having to download.

Mary Cooch's profile picture
Posts: 135

02 October 2011, 4:19

Aha! It was your URL - I added a second "view" to it and it worked fine

http://careerportfolio.mb.ca/view/view/access.php?id=1096

However - I still have no solution to the pdf embedding problem :(
We have been using Issuu  to embed pdfs and it works fine on FF but in school on IE we keep getting a warning message before opening its flash file - a real pain and I don't know how to get around that.

Don Presant's profile picture
Posts: 255

02 October 2011, 6:19

Yes, Dirk Meyer has just shown me how it could be done with Issuu in a private response to this - I wasn't aware of the Flash issue on IE, but thought that it was a long process for my adult learners to cope with.

Perhaps a native solution would be best - pdf as an alternative to jpg or png for the image block

Dirk Meyer's profile picture
Posts: 425

02 October 2011, 10:53

I would love to see native pdf embedding support.

Perhaps a first step could involve relaxing sitewide iframe and object restrictions a little bit. For example, the code below allows for nice embedding. Short of allowing <object> and <iframe> side wide, I wonder what it would take to have this available based on white listed domains maybe or perhaps just for institutions or then again maybe even a button to allow this accross a site.

<object data="filename.pdf" type="application/pdf" width="100%" height="100%"></object>

François Marier's profile picture
Posts: 411

02 October 2011, 23:02

I suppose we could create a new block like the Image block to display a PDF file inline from your files area.

It does require students to have the PDF plugin installed in their browser though.

Anyways, please feel free to file that as a feature request on the bug tracker, it looks like a pretty simple block to create.

Cheers,

Francois

Don Presant's profile picture
Posts: 255

27 October 2011, 13:44

Hi Francois:

Just picking up on the idea of a native way to display PDFs as images...I had a coder in my class who discovered the solution below on the Interenet...might it work like Scribd does, ie without the Acrobat plugin?

If it makes sense, I'll add it to the Bug tracker


http://www.daniweb.com/web-development/php/threads/238034

Code
<iframe id="myFrame" style="display:none" width="500" height="300"></iframe>
<input type="button" value="Open PDF" onclick = "openPdf()"/>
<script type="text/javascript">
function openPdf()
{
var omyFrame = document.getElementById("myFrame");
omyFrame.style.display="block";
omyFrame.src = "test.pdf";
}

François Marier's profile picture
Posts: 411

27 October 2011, 20:21

The code you have pasted here does assume that the browser is able to display PDF so it would need to have some kind of plugin installed.

Kristina Hoeppner's profile picture
Posts: 4731

02 October 2011, 13:59

Hello Don,

It's a problem on Google's end (cf. https://bugs.launchpad.net/mahara/+bug/856130). It has been changing links and stuff around lately quite a bit and it is not easy to keep up with them.

If you use the new Google interface, you have to go to "Collaborate" in the menu to choose "Publish to the web". Sharing via the Share button doesn't do the trick. I had adapted the help file and will check with Francois if we can put that in 1.4.1 and not only in 1.5.

Cheers

Kristina

15 results