
Have existing PDF forms? Simply upload them to Anvil to create templates. With our RESTful endpoint, you'll be ready to receive data over API and fill your PDF.
It's that simple. Take your structured data, develop against it with C# & .NET, make the request, and save the response.
class FillPDF: RunnableBaseExample {
private Anvil.Payloads.Request.FillPdf GetFillData() {
return new Anvil.Payloads.Request.FillPdf {
Title = "My PDF Title",
FontSize = 10,
TextColor = "#333333",
Data = new Dictionary < string, dynamic > () {
{ "shortText", "HELLOOW"},
{ "date", "2022-07-08" },
{ "name", new Dictionary < string, object > () {
{ "firstName", "Robin" },
{ "mi", "W" },
{ "lastName", "Smith" }
}
},
{ "email", "testy@example.com" }
}
};
}
public override async Task Run(string apiKey) {
var pdfTemplateEid = "f9eQzbUgCCRVDrd4gt8b";
var payload = GetFillData();
var client = new RestClient(apiKey);
var wasWritten = await client.FillPdf(pdfTemplateEid, payload, "./output/fill-output.pdf");
}
}