public static void Run() { var apiInstance = new InfoApi(Constants.GetConfig()); try { var request = new GetDocumentMetadataRequest("WordProcessing/four-pages.docx", Constants.MyStorage); var response = apiInstance.GetDocumentMetadata(request); Console.WriteLine("InfoResult.Pages.Count: " + response.PageCount); } catch (Exception e) { Console.WriteLine("Exception while calling InfoApi: " + e.Message); } }
public static void Run() { var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); var apiInstance = new InfoApi(configuration); try { // get document info/metadata request var request = new GetDocumentMetadataRequest { StorageName = Common.MyStorage, FilePath = "conversions/password-protected.docx" }; // Execute api method to get response. var response = apiInstance.GetDocumentMetadata(request); Console.WriteLine("Expected response type is DocumentMetadata: " + response.ToString()); } catch (Exception e) { Console.WriteLine("Exception when calling InfoApi: " + e.Message); } }
public void GetDocumentMetadataTest() { var response = InfoApi.GetDocumentMetadata(new GetDocumentMetadataRequest(TestFiles.FourPagesDocx.FullName)); Assert.AreEqual(4, response.PageCount); }