/* pdf print form */ public string GetPdf(string id) { string mode = "SENT"; GetPdfRequest req = new GetPdfRequest(authToken, id, mode); GetPdfResponse resp; try { resp = (GetPdfResponse)Http2.post <GetPdfResponse>("https://api-service.edi.su/Api/Dixy/PrintForm/Generate", req); if (resp.intCode != 200) { throw new Exception(resp.varMessage); } } catch (Exception e) { mode = "RECIEVED"; req = new GetPdfRequest(authToken, id, mode); resp = (GetPdfResponse)Http2.post <GetPdfResponse>("https://api-service.edi.su/Api/Dixy/PrintForm/Generate", req); } if (resp.intCode != 200) { throw new Exception(resp.varMessage); } return(resp.form); }
public static void Run() { var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); var apiInstance = new AnnotateApi(configuration); try { // Set request. var request = new GetPdfRequest() { filePath = "Annotationdocs\\ten-pages.docx" }; var response = apiInstance.GetPdf(request); Console.WriteLine("Expected response type is Stream: Document Length: " + response.Length.ToString()); } catch (Exception e) { Console.WriteLine("Exception while calling Annotation AnnotateApi: " + e.Message); } }