Skip to content
This repository has been archived by the owner on May 2, 2018. It is now read-only.

Image is not displaying for PDF thumbs #27

Open
venkatbaggu opened this issue Nov 2, 2016 · 0 comments
Open

Image is not displaying for PDF thumbs #27

venkatbaggu opened this issue Nov 2, 2016 · 0 comments

Comments

@venkatbaggu
Copy link

venkatbaggu commented Nov 2, 2016

``@Html.DynamicImageTag(b => b.WithLayer(
        new PdfLayerBuilder().SourceFileName("~/Content/1.pdf").PageNumber(1)
            .WithFilter(FilterBuilder.Resize.ToWidth(500))
            //.WithFilter(FilterBuilder.Border.Width(1).Fill(Colors.Black))
            .WithFilter(FilterBuilder.DropShadow)
    ))`
public static class HtmlHelperExtensions
    {
        public static HtmlString DynamicImageTag(this HtmlHelper html, Action<CompositionBuilder> callback)
        {
            var tagBuilder = new TagBuilder("img");

            var compositionBuilder = new CompositionBuilder();
            callback(compositionBuilder);
            tagBuilder.Attributes["src"] = compositionBuilder.Url;

            return MvcHtmlString.Create(tagBuilder.ToString(TagRenderMode.SelfClosing));
        }
    }
`

The image url generating is http://localhost:56861/Assets/Images/DynamicImages/1bac431a5fbcacba541c34a24407dbdd94f13506c99074008c3fe5a9ca1ad3cf.jpg

But the image is not displaying

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant