Fork me on GitHub

Install the DynamicImage.Extensions.Pdf package to get this extension. There is some background information in this blog post.

@Html.DynamicImageTag(b => b.WithLayer(
	new PdfLayerBuilder().SourceFileName("~/Assets/PDFs/pdf-test.pdf").PageNumber(1)
		.WithFilter(FilterBuilder.Resize.ToWidth(500))
		.WithFilter(FilterBuilder.Border.Width(1).Fill(Colors.Black))
		.WithFilter(FilterBuilder.DropShadow)
))