Skip to content

Instantly share code, notes, and snippets.

@smarenich
Last active July 19, 2017 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarenich/0d2a78a20ab9cd4b2f2b91328b705321 to your computer and use it in GitHub Desktop.
Save smarenich/0d2a78a20ab9cd4b2f2b91328b705321 to your computer and use it in GitHub Desktop.
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