// /// <summary> /// Merge a list of documents. /// </summary> /// <param name="name">Resulting documen name.</param> /// <param name="storage">The document storage.</param> /// <param name="folder">The document folder.</param> public void MergeAListOfDocuments(string name, string folder, PDFDocumentsList list, string storage = "") { // PUT pdf/{name}/merge?appSid={appSid}&storage={storage}&folder={folder} string apiUrl = string.Format(@"pdf/{0}/merge?storage={1}&folder={2}", name, storage, folder); ServiceController.Put(apiUrl, AppSid, AppKey, JsonConvert.SerializeObject(list)); }
public void Pdf_AppendMerge_Tests() { try { storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/pdf-sample.pdf", Utils.CloudStorage_Output_Folder + "/pdf-merge1.pdf"); storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/pdf-sample.pdf", Utils.CloudStorage_Output_Folder + "/pdf-merge2.pdf"); PDFDocumentsList list = new PDFDocumentsList(); list.List.Add(Utils.CloudStorage_Output_Folder + "/pdf-merge1.pdf"); list.List.Add(Utils.CloudStorage_Output_Folder + "/pdf-merge2.pdf"); list.List.Add(Utils.CloudStorage_Output_Folder + "/pdf-merge1.pdf"); pdfService.AppendMerge.MergeAListOfDocuments("pdf-merged.pdf", Utils.CloudStorage_Output_Folder, list); storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/pdf-merged.pdf", Utils.Local_Output_Path + "/pdf-merged.pdf"); } catch (Exception ex) { Assert.Fail(ex.Message); } }