Last active
July 19, 2017 07:09
-
-
Save smarenich/0d2a78a20ab9cd4b2f2b91328b705321 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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