繁体   English   中英

使用 SyncFusion C#.net 在不保存文档的情况下附加 PDF

[英]Attaching PDF without saving document using SyncFusion C#.net

Can someone help me or give me a link on how to attach a PDF to email using syncfusion html to pdf converter without saving the document?

这是我的代码:

//Convert URL to PDF
PdfDocument doc = htmlConverter.Convert(render_to_html(Panel_preview_attachment), baseUrl);

doc.Save(path + "Attachments\\" + file_name); //I need to remove this

string empPdf = path + "Attachments\\" + file_name;

LinkedResource linkedresource = new LinkedResource(empPdf, "application/pdf");
linkedresource.ContentId = "empPdf";
linkedresource.ContentType.Name = file_name;
htmlView.LinkedResources.Add(linkedresource);

我们可以将 HTML 转换为 PDF 并在邮件中发送 PDF 文档而不将其保存到文件系统。 我们可以将 PDF 文档保存到 memory stream 中,然后我们可以将其发送到邮件中。 请参阅以下链接以获取更多信息,

HTML 到 PDFhttps://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit

Email output PDF : https://www.syncfusion.com/kb/6064/how-to-create-pdf-dynamically-and-email-as-attachment

注意:我为 Syncfusion 工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM