文檔半島外圍網(wǎng)上直營>>Aspose中文文檔>>擴(kuò)展并貢獻(xiàn)于 CRM 報價生成器
                擴(kuò)展并貢獻(xiàn)于 CRM 報價生成器
Aspose.Words是一種高級Word文檔處理API,用于執(zhí)行各種文檔管理和操作任務(wù)。API支持生成,修改,轉(zhuǎn)換,呈現(xiàn)和打印文檔,而無需在跨平臺應(yīng)用程序中直接使用Microsoft Word。
Aspose技術(shù)交流群(761297826)
您可以在以下位置下載最新的源代碼:
- CodePlex。
- 知乎
	下面的代碼演示了將 HTML 轉(zhuǎn)換為 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";
	
請注意:此插件是開源的。我們創(chuàng)建并解決問題的場景可能與最終用戶不同。您可以下載最新的源代碼,并根據(jù)您的業(yè)務(wù)需求進(jìn)行更新。

 QQ交談
QQ交談 在線咨詢
在線咨詢 
                 
                
 渝公網(wǎng)安備
            50010702500608號
渝公網(wǎng)安備
            50010702500608號
             
            
 客服熱線
客服熱線