c# wrapper for PdfMake.
Note: Before accesing the site please disable add blocker while on the site or whitelist it to PdfMakeNet work properly, you won't get any output with add blocker on.
Demo live site credits to sc231997.
This wrapper implements the same methods and options as pdfmake and will help you build pdfmake object structure more faster and easier using strong datatypes and some extension methods using c#.
Take note that this library as no server side render capabilities yet (Unless integration with NodeJs or any lib on c# that parses and executes javascript, if any one want these feature please file an issue with any recommendation or pull request).
Maybe is some near future PdfMakeNet and others js libs may be posible to execute over c# using Jint after they complete the implementations of ES5 and ES6 features.
I opened this issue on Jint repository to keep track of this. Run PdfMake on Jint
Another library that maybe another alternative ChakraCore
So based on the last sentence you still need to reference pdfmake.js and vfs_fonts.js files on your client or create your own pdfmake viewer for flawless integration.
The code is already documented but if you want more documentation you can visit: https://pdfmake.github.io/docs/
https://pdfmake.github.io/docs/getting-started/client-side/supported-browsers/
Install-Package PdfMakeNet -Version 1.0.5
Install-Package PdfMakeNet.Server.Extensions -Version 1.0.5
<script src='build/pdfmake.min.js'></script>
<script src='build/vfs_fonts.js'></script>
using PdfMakeNet;
var pdfmake = new PdfMake();
pdfmake.AddText(new PdfMakeText()
{
Alignment = Alingment.Center,
BackgroundColor = "red",
Bold = true,
Color = "white",
FontSize = 18,
Italics = true,
Text = "Hello World!"
});
Console.WriteLine(pdfmake.GetDocumentDefinition());
If you find any bug or issue please file an issue I will fix it as soon as posible.
Pull requests are welcome. Please submit a pull request letting me know if is a bug fix or new feature.
MIT