- Sign up for an account at https://prexview.com/
- Install the Nuget package OR Download the library.
- Create your design on Prexview
- Use the library like this:
public async Task GenerateInvoice()
{
var prex = new PrexView("--YOUR-API-KEY--");
string data = @"{ xml-data-here }";
string design = "new-9999"; // Design name on Prexview
Enums.PrexViewOutput output = Enums.PrexViewOutput.pdf;
Enums.PrexViewFormat format = Enums.PrexViewFormat.json;
var fileBytes = await prex.Transform(format, data, design, output);
System.IO.File.WriteAllBytes(@"C:\temp\invoice." + output, fileBytes);
}
Output can be one of the following
- html
- png
- jpg
Input format can be one of two:
- json
- xml