Convert DOCX to PDF | C#ByteScout PDF SDK

Convert DOCX to PDF | C#

Program.cs:

C#
using System.Diagnostics;
using System.Drawing.Printing;
using Bytescout.PDF.Converters;

namespace ConvertDocxToPdf
{
    class Program
    {
        static void Main(string[] args)
        {
            using (DocxToPdfConverter converter = new DocxToPdfConverter())
            {
                converter.PageSize = PaperKind.A4;
                converter.Orientation = PaperOrientation.Portrait;
                converter.Footer = "<p style=\"color: blue;\">FOOTER TEXT</p>";

                converter.ConvertDocxToPdf("sample.docx", "result.pdf");
            }

            // Open result document in default associated application (for demo purpose)
            ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf");
            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
    }
}