Exemplo n.º 1
0
        public static void Run()
        {
            // ExStart:1
            WordsApi   wordsApi   = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            string fileName       = "GetField.docx";
            int    sectionIndex   = 0;
            int    paragraphIndex = 0;
            string storage        = null;
            string folder         = null;

            try
            {
                // Upload the file
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Words Cloud SDK API to get all fields from document
                ResponseMessage apiResponse = wordsApi.GetFields(fileName, sectionIndex, paragraphIndex, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("Ok"))
                {
                    Console.WriteLine("Get all fields from document, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }