Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

How to show pdf


Go to End
Reply

11 Posts   3311 Views

Avatar
kaloschke

30 September 2009 at 7:38am Community Member, 8 Posts

Hi,
I'm very new to silverstripe. Is it possible to show a pdf-file inside the content-section?
What I have to do to manage that?

Thank you,
Kaloschke

Avatar
Howard

30 September 2009 at 9:29am Community Member, 215 Posts

Hi there,

This can't be done with SilverStripe directly but you can certainly use another service to display a pdf withen a silverstripe site. One service that I have used with success is here [url]https://docs.google.com/viewer[/url]. To do this you have to upload a pdf somewhere on the internet (you could upload it through the Files and Images tab in silverstripe) then paste the location of it into the input box. Once you hit "Generate Link" the bottom block of code is an Iframe which can be pasted into the HTML code of a page in the CMS. I'm not sure if the Iframe gets stripped out by TinyMce but give it a go :)

Hope this points you in the right direction :)

Avatar
baba-papa

30 September 2009 at 9:46am Community Member, 279 Posts

The gallery module supports pdf. I don´t know how it works exactly but you could give it a try.

Avatar
dalesaurus

30 September 2009 at 4:11pm Community Member, 283 Posts

There is always a quick and dirty solution, like the above with Google Docs.

Try http://www.pdfmenot.com/ in an iframe, perhaps?

Avatar
kaloschke

1 October 2009 at 2:25am Community Member, 8 Posts

Hi all,

thank you for your replies. Howardgrigg, what do you mean with "This can't be done with SilverStripe directly "? May be I was unclear. If I habe a pdf-file in /assets/uploads, say test.pdf. Then I want to have a link in a menu to that file, so if anybody select this menuitem the pdf is shown inside the contenarea like any other page of my website.
Normally i would use the iframe tag for this problem in conjunction with some javascript code to fill the whole contentarea. Is something possible this way without the use of external helpers (google)?

Greeting
Kaloschke

Avatar
Hamish

1 October 2009 at 10:19am (Last edited: 1 October 2009 10:23am), Community Member, 712 Posts

PDF content is not something most browsers are able to display 'out of the box'.

That means that unlike an image or text (or Flash content, to a certain degree) there is no way for a browser to imbed the pdf content within your page html without some sort of a 3rd party service to convert it into something browser-readable, or an iframe to bypass the rendering of the current frame entirely.

An iframe gets around this by using whatever pdf viewer plugin your browser has installed. This makes it appear as if it were embedded within the page, but is really rendered as a separate element. This is the easiest way to do it without using a 3rd party service, but the result will depend on what the user has installed.

Personally, I'd go iframe - it is the most stable solution and reduces your reliance on 3rd party services (not to mention the habit of these 3rd party services to extract payment in the form of allowing them access to your documents).

Avatar
kaloschke

1 October 2009 at 6:51pm Community Member, 8 Posts

Hi Hamish,

of course, I need a browser plugin as you said, but how can I integrate an iframe in my pages? When I use the TinyMCE with the html-button, it only shows, e.g. the code for a link, I can't edit the html-code.

Regards

Kaloschke

Avatar
kaloschke

21 October 2009 at 4:39am Community Member, 8 Posts

Hi,

I found this
http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/17884
or this
http://www.silverstripe.org/archive/show/17884 (I don't know what link is working, because its in the archive)
to integrate an iframe modul.
I followed the install instructions, but I got no new pagetype. Does an older modul work with
Silverstripe 2.3.3?
I have the same problem with the flickrmodul. There is no new pagetype.

Can anyone help please?
Kaloschke

Go to Top