Pogodoc Quickstart
Generate documents in seconds using Pogodoc with .NET.
Prerequisites
Before getting started with Pogodoc, make sure you have:
- .NET 8.0 or higher
- A Pogodoc account - Sign up here if you don't have one
- A Pogodoc API token - Generate one from your API tokens page
1. Installing the package
Before using the Pogodoc SDK, you can install the required package:
- dotnet CLI
dotnet add package Pogodoc.SDK
2. Create a client
Before creating a pogodoc client you need to generate POGODOC API token.
using Pogodoc;
var pogodoc = new PogodocSDK(
Env.GetString("POGODOC_API_TOKEN")
);
⚠️ Don’t forget to set your
POGODOC_API_TOKEN
in your.env
file.
3. Generate a document
var props = new GenerateDocumentProps
{
RenderConfig = new InitializeRenderJobRequest
{
Type = InitializeRenderJobRequestType.Ejs,
Target = InitializeRenderJobRequestTarget.Pdf,
Data = new Dictionary<string, object> { { "name", "John Doe" } },
},
Template = "<h1>Hello <%= name %></h1>",
};
var result = await pogodoc.GenerateDocumentAsync(props);
_output.WriteLine("STRING TEMPLATE RESULT: " + result.Output.Data.Url);