tgjones / dynamic-image

DynamicImage is a high-performance image manipulation library for ASP.NET
http://dynamicimage.apphb.com/
Other
145 stars 34 forks source link

Image is not displaying for PDF thumbs #27

Open venkatbaggu opened 8 years ago

venkatbaggu commented 8 years ago
``@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