Copied to clipboard

Flag this post as spam?

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


  • Mike 62 posts 274 karma points
    Jan 06, 2014 @ 12:48
    Mike
    0

    Can't seem to render images using fo:external-graphic

    Does anyone know why I can't seem to render images using fo:external-graphic?  I've got the following code which loops through any images stored inside a folder:

    @{
    var mediaFolderId = Model.itemImageGallery;
    var folder = Library.MediaById(mediaFolderId);
    }

    and then:

    <fo:block font-size="10pt" margin-bottom="15mm">
    @{
    if (folder != null && folder.Children.Count() > 0)
    {
    foreach (var media in folder.Children)
    {
    <fo:block>
    <fo:external-graphic src="@media.umbracoFile"></fo:external-graphic>
    </fo:block>
    }
    }
    }
    </fo:block>

    If I remove the <fo:external-graphic> tag and just have @media.umbracoFile in the block then it renders the path to the image fine, i.e.

    /media/1012/file01.jpg
    /media/1012/file02.jpg
    /media/1012/file03.jpg
    /media/1012/file04.jpg
    etc...

    So I'm not sure why it then doesn't render anything when writing: 

    <fo:external-graphic src="@media.umbracoFile"></fo:external-graphic>

    I'm clearly missing something here. Any ideas?

    Many thanks,
    Mike

  • Mike 62 posts 274 karma points
    Jan 06, 2014 @ 13:01
    Mike
    100

    It seems that the full absolute path to the image needs to be used, so:

    src="http://www.mysite.com/@media.umbracoFile"

    which I guess makes sense for 'external-graphic'. 

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies