public void TestPostAppendDocument()
        {
            var localName    = "test_multi_pages.docx";
            var remoteName   = "TestPostAppendDocument.docx";
            var fullName     = Path.Combine(this.dataFolder, remoteName);
            var destFileName = Path.Combine(BaseTestOutPath, remoteName);

            var body = new DocumentEntryList();

            System.Collections.Generic.List <DocumentEntry> docEntries = new System.Collections.Generic.List <DocumentEntry>();

            DocumentEntry docEntry = new DocumentEntry {
                Href = fullName, ImportFormatMode = "KeepSourceFormatting"
            };

            docEntries.Add(docEntry);
            body.DocumentEntries = docEntries;

            this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));

            var request = new PostAppendDocumentRequest(remoteName, body, this.dataFolder, destFileName: destFileName);
            var actual  = this.WordsApi.PostAppendDocument(request);

            Assert.AreEqual(200, actual.Code);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppendDocumentOnlineRequest"/> class.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="documentList"><see cref="DocumentEntryList"/> with a list of documents to append.</param>
 /// <param name="loadEncoding">Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.</param>
 /// <param name="password">Password for opening an encrypted document.</param>
 /// <param name="destFileName">Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.</param>
 /// <param name="revisionAuthor">Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.</param>
 /// <param name="revisionDateTime">The date and time to use for revisions.</param>
 public AppendDocumentOnlineRequest(System.IO.Stream document, DocumentEntryList documentList, string loadEncoding = null, string password = null, string destFileName = null, string revisionAuthor = null, string revisionDateTime = null)
 {
     this.Document         = document;
     this.DocumentList     = documentList;
     this.LoadEncoding     = loadEncoding;
     this.Password         = password;
     this.DestFileName     = destFileName;
     this.RevisionAuthor   = revisionAuthor;
     this.RevisionDateTime = revisionDateTime;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PostAppendDocumentRequest"/> class.
 /// </summary>
 /// <param name="name">Original document name.</param>
 /// <param name="documentList">with a list of documents to append.            </param>
 /// <param name="folder">Original document folder.</param>
 /// <param name="storage">File storage, which have to be used.</param>
 /// <param name="loadEncoding">Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.</param>
 /// <param name="password">Password for opening an encrypted document.</param>
 /// <param name="destFileName">Result name of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.</param>
 /// <param name="revisionAuthor">Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.</param>
 /// <param name="revisionDateTime">The date and time to use for revisions.</param>
 public PostAppendDocumentRequest(string name, DocumentEntryList documentList, string folder = null, string storage = null, string loadEncoding = null, string password = null, string destFileName = null, string revisionAuthor = null, string revisionDateTime = null)
 {
     this.Name             = name;
     this.DocumentList     = documentList;
     this.Folder           = folder;
     this.Storage          = storage;
     this.LoadEncoding     = loadEncoding;
     this.Password         = password;
     this.DestFileName     = destFileName;
     this.RevisionAuthor   = revisionAuthor;
     this.RevisionDateTime = revisionDateTime;
 }