Server side PDF generation and email

Question:This question has two parts, one regarding sending emails with attachments and one regarding server side PDF generation.I'm making a web app where the user enters data into a form. At the end I want the user to enter his/her email and then a PDF will be generated and emailed to the user.Any advice on how to generate the PDF server side? Any advice VeryPDF on how to automatically send the generated PDF attached in an email?

Answer: Based on your need, I strongly suggest you that you have a free trial of this software: VeryPDF Doc Converter COM server version. By this software, you can generate PDF and then email it directly to your client according to the email box. This software also can be used to convert files of Microsoft Word, PowerPoint, Excel, JPG, PNG, GIF, HTML and others to PDF by script together with other application like VB, VC, C# etc.  Please check more information of this software on homepage, in the following part, let us check how to use this software.

Step 1. Free download Doc Converter COM

  • This is COM version, so we have compressed it to zip file. When downloading finishes, you need to unzip it and then you can use this software normally.
  • If you download the server version, there is no problem when you generate PDF from any printable file on the sever. But if you need to convert Office file to PDF, please make sure that you have MS Office installed.

Step 2. Generate PDF and email it.

  • When you use this software, please refer to the documents of it.
  • Here are some examples for your reference.
  • When you need to generate PDF, please refer to the following code template:
  • Generate PDF file,
        For Example,
            Set PdfCreator = New PDFOUTLib.PdfCreator
            PdfCreator.HTML2PDF = "C:\sample.html"
            PdfCreator.FileName = "C:\sample.pdf"
            PdfCreator.HeadersFooters = "off"
            PdfCreator.paperType = 6 '//7 is A4 paper, 6 is A3 paper
            PdfCreator.CreatePDF
            While PdfCreator.StillRunning = 1
                DoEvents
                Call WaitMessage
            Wend
            Set PdfCreator = Nothing
            Debug.Print "C:\sample.html -->C:\sample.pdf"

  • When you need to send it by email, please refer to the following code template:
  • After create a PDF file and send it from your mail client,
        For Example,
           Set PdfCreator = New PDFOUTLib.PdfCreator
            PdfCreator.HTML2PDF = "C:\sample.html"
            PdfCreator.FileName = "C:\sample.pdf"
            PdfCreator.HeadersFooters = "off"
            PdfCreator.paperType = 6 '//7 is A4 paper, 6 is A3 paper
            PdfCreator.subject = "I can control the subject this way"
            PdfCreator.body = "And I can control the body too"
            PdfCreator.SendEmail
            While PdfCreator.StillRunning = 1
                DoEvents
                Call WaitMessage
            Wend
            Set PdfCreator = Nothing

During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in PDFcamp Printer and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!