-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I have to include a blank documentContent line, or an error is thrown :( it should be optional if I use documentUrl
using DocRaptor.Client;
using DocRaptor.Model;
using DocRaptor.Api;
using System;
using System.IO;
class Example
{
static void Main(string[] args)
{
DocApi docraptor = new DocApi();
// this key works in test mode!
docraptor.Configuration.Username = "YOUR_API_KEY_HERE";
try
{
Doc doc = new Doc(
name: "invoice",
test: true, // test documents are free but watermarked
documentType: Doc.DocumentTypeEnum.Pdf,
documentContent: "", // the .NET agent requires documentContent be set
documentUrl: "https://docraptor.com/samples/invoice.html"
// javascript: false,
);
byte[] pdf = docraptor.CreateDoc(doc);
File.WriteAllBytes("invoice.pdf", pdf);
Console.WriteLine("Successfully created invoice.pdf!");
} catch (DocRaptor.Client.ApiException error) {
Console.Write(error.ErrorContent);
}
}
}
Metadata
Metadata
Assignees
Labels
No labels