Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Connie DeCinko 95 posts 248 karma points
    Apr 25, 2019 @ 18:45
    Connie DeCinko
    0

    How to display PDFs

    What is the recommended way to allow content authors to upload PDFs which can then be displayed embeded in the web page?

  • Jonathan Distenfeld 105 posts 618 karma points
    Apr 26, 2019 @ 06:09
    Jonathan Distenfeld
    0

    I would recommend to allow editors to upload files in the media section (maybe add a folder "Embedded PDF's" or something for organization) by editing the user groups.

    Then, in the DocumentTypes you want to display the pdf, you can add a property with the "media picker" editor, so they can choose a pdf-file. You can also add a start folder for the media section.

    In your template, you can then use a iFrame to display the pdf:

    // check for file and make sure its a pdf
    if (Model.File != null && Model.File.UmbracoExtension == "pdf")
    {
        // display pdf in iframe
        <iframe src="@Model.File.Url" />
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft