public void TestPostLoadWebDocument() { var body = new LoadWebDocumentData(); var saveOptions = new SaveOptionsData { FileName = "google.doc", SaveFormat = "doc", ColorMode = "1", DmlEffectsRenderingMode = "1", DmlRenderingMode = "1", UpdateSdtContent = false, ZipOutput = false }; body.LoadingDocumentUrl = "http://google.com"; body.SaveOptions = saveOptions; var request = new PostLoadWebDocumentRequest(body); var actual = this.WordsApi.PostLoadWebDocument(request); Assert.AreEqual(200, actual.Code); }
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); // Set input file name LoadWebDocumentData body = new LoadWebDocumentData(); var soptions = new SaveOptionsData(); soptions.FileName = "google.doc"; soptions.SaveFormat = "doc"; soptions.ColorMode = "1"; soptions.DmlEffectsRenderingMode = "1"; soptions.DmlRenderingMode = "1"; soptions.UpdateSdtContent = false; soptions.ZipOutput = false; body.LoadingDocumentUrl = "http://google.com"; body.SaveOptions = soptions; try { // Invoke Aspose.Words Cloud SDK API to convert web pages to word documents SaveResponse apiResponse = wordsApi.PostLoadWebDocument(body); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Document " + apiResponse.SaveResult.DestDocument.Href + " has been generated successfully"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
/// <summary> /// Initializes a new instance of the <see cref="PostLoadWebDocumentRequest"/> class. /// </summary> /// <param name="data">Parameters of loading.</param> /// <param name="storage">File storage, which have to be used.</param> public PostLoadWebDocumentRequest(LoadWebDocumentData data, string storage = null) { this.Data = data; this.Storage = storage; }