ByteScout PDF SDK – C# – Convert – DOCX to PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – C# – Convert – DOCX to PDF

ByteScout PDF SDK – C# – Convert – DOCX to PDF

Program.cs

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);
        }
    }
}


  Click here to get your Free Trial version of the SDK

prev
next