Search code examples
imageumbracorichedit

Display Images from Umbraco Media in Document


i create a Document(PDF) and get the Content from the Umbraco nodes.

But there's a problem by displaying the images. How can i display or get the images from the Media libary of Umbraco? Is there a way, offered from Umbraco to get the Image(s)?

Thanks a lot.


Solution

  • If I understand your query correctly, you a pretty much there. You should simply be able to get the umbracoFile path (just like you are for the PDF file) and simply declare it as the img src!

    With Razor...

    <umbraco:Macro  runat="server" language="cshtml">
        <img src='@Model.MediaById(@Model.imgProperty).umbracoFile' alt="" />
    </umbraco:Macro>