Jump to:

23360 Posts in 18097 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » How to show pdf

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

Page: 1 2
Go to End
Author Topic: 3222 Views
  • kaloschke
    Avatar
    Community Member
    8 Posts

    How to show pdf Link to this post

    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

  • Howard
    Avatar
    Community Member
    215 Posts

    Re: How to show pdf Link to this post

    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 https://docs.google.com/viewer. 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

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: How to show pdf Link to this post

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

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: How to show pdf Link to this post

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

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

  • kaloschke
    Avatar
    Community Member
    8 Posts

    Re: How to show pdf Link to this post

    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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: How to show pdf Link to this post

    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).

  • kaloschke
    Avatar
    Community Member
    8 Posts

    Re: How to show pdf Link to this post

    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

  • kaloschke
    Avatar
    Community Member
    8 Posts

    Re: How to show pdf Link to this post

    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

    3222 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.