用于将数据库行转换为pdf并作为电子邮件发送的代码 [英] code for convert a database row into pdf and send it as an email

查看:58
本文介绍了用于将数据库行转换为pdf并作为电子邮件发送的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我需要帮助将数据库中的一行转换为pdf,并将该pdf发送至该行中的电子邮件地址.

Hi friends,

I want help to convert a row in the database into pdf and send that pdf into email address which is in that row.

推荐答案

您可以从数据库行,然后可以通过PdfConverter(wnvhtmlconvert.dll)将html文件转换为pdf

You can make a html file from the database row then you can convert the html file to the pdf by PdfConverter(wnvhtmlconvert.dll)

using Winnovative.WnvHtmlConvert;

public void Convert()
        {
            PdfConverter pdfConverter = new PdfConverter();
            pdfConverter.LicenseKey = "your license key";
            pdfConverter.PdfDocumentOptions.EmbedFonts = false;
            pdfConverter.PdfDocumentOptions.ShowFooter = false;
            pdfConverter.PdfDocumentOptions.ShowHeader = false;
            pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = true;
            pdfConverter.SavePdfFromHtmlFileToFile("1.html", "1.pdf");
        }



然后,您可以将pdf随邮件附上.为此,您可以看到此链接->

点击

点击

单击



Then you can attach the pdf with the mail. For this you can see this links->

Click

Click

Click


您的方案尚不十分清楚,但实现这一目标的可行方法之一可能是:
1.使用Windows服务将选择所需的行
2.根据值创建一个PDF
3.通过电子邮件发送PDF

现在,这三个步骤都相当长,您需要逐步进行操作.您将在代码项目本身的所有三个步骤中找到单独的文章.

试试吧!
Your scenario is not quite clear but one of the feasible ways to achieve it could be:
1. Use Windows service that will pick the desired row
2. Create a PDF based on the values
3. Emails the PDF

Now, all the 3 steps are quite long and you need to move step by step. You will find separate articles on all the 3 steps here at code project itself.

Try!


这篇关于用于将数据库行转换为pdf并作为电子邮件发送的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆