Xceed Words for .NET v5.0 Documentation
Welcome to Xceed Words for .NET v5.0 / Code Snippets / Converting to PDF
In This Topic
    Converting to PDF
    In This Topic

    The following example demonstrates how to convert a docx Document to PDF.

    • Most of the docx features will be converted to PDF.
    • You need the Xceed.Pdf.dll reference in order to convert to PDF.
    • To convert a Document with a specific font to PDF, the font (a ttf file) must be installed in "Control Panel\All Control Panel Items\Fonts", otherwise the default Arial font will be used to generate the PDF Document.
    C#
    Copy Code
        // Load a document
        using( var document = DocX.Load( "DocumentToConvert.docx" ) )
        {
          // Convert the Document to PDF.
          DocX.ConvertToPdf( document, "ConvertedDocument.pdf" );
        }