文檔金喜正規買球>>Aspose中文文檔>>擴展并貢獻于 CRM 報價生成器
擴展并貢獻于 CRM 報價生成器
Aspose.Words是一種高級Word文檔處理API,用于執行各種文檔管理和操作任務。API支持生成,修改,轉換,呈現和打印文檔,而無需在跨平臺應用程序中直接使用Microsoft Word。
Aspose技術交流群(761297826)
您可以在以下位置下載最新的源代碼:
- CodePlex。
- 知乎
下面的代碼演示了將 HTML 轉換為 word 并使用報價附加生成的報價的功能。
/// Generate Quote from Editor HTML
/// Generate Quote from Editor HTML QuoteName = (String.IsNullOrEmpty(QuoteName) ? "Aspose .NET Quote Generator" : QuoteName); Stream stream = GenerateStreamFromString(editor1.InnerText); LoadOptions loadOptions = new LoadOptions(); loadOptions.LoadFormat = LoadFormat.Html; Document myDoc = new Document(stream, loadOptions); MemoryStream memStream = new MemoryStream(); myDoc.Save(memStream, SaveOptions.CreateSaveOptions(SaveFormat.Docx)); /// Attach Generated Quotation with Quote byte[] byteData = memStream.ToArray(); // Encode the data using base64. string encodedData = System.Convert.ToBase64String(byteData); Entity NewNote = new Entity("annotation"); // Im going to add Note to entity NewNote.Attributes.Add("objectid", new EntityReference("quote", QuoteId)); NewNote.Attributes.Add("subject", QuoteName); // Set EncodedData to Document Body NewNote.Attributes.Add("documentbody", encodedData); // Set the type of attachment NewNote.Attributes.Add("mimetype", @"application/vnd.openxmlformats-officedocument.wordprocessingml.document"); NewNote.Attributes.Add("notetext", "Document Created using template"); // Set the File Name NewNote.Attributes.Add("filename", QuoteName + ".docx"); Guid NewNoteId = Service.Create(NewNote); if (NewNoteId != Guid.Empty) LBL_Message.Text = "Successfully added to Quote";
請注意:此插件是開源的。我們創建并解決問題的場景可能與最終用戶不同。您可以下載最新的源代碼,并根據您的業務需求進行更新。