Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
static void Main(string[] args)
{
Screen screen = new Screen();
screen.CookieContainer = new System.Net.CookieContainer();
screen.Timeout = 10000000;
screen.Login("admin@Demo", "123");
string invoiceNbr = "AR004916";
Content schema = screen.GetSchema();
Command[] commands = new Command[]
{
new Value { Value = "Invoice", LinkedCommand = schema.Parameters.DocumentType },
new Value { Value = invoiceNbr, LinkedCommand = schema.Parameters.ReferenceNumber },
schema.ReportResults.PdfContent
};
Content[] result = screen.Submit(commands);
if (result != null && result.Length > 0)
{
Byte[] binary = Convert.FromBase64String(result[0].ReportResults.PdfContent.Value);
File.WriteAllBytes(string.Format(@"Invoice_{0}.pdf", invoiceNbr), binary);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment