How to convert multiple DOCX files into PDF?

I’ve a Web-application which has to convert various DOCX files in PDF! I’ve googled a lot and found that many .Net components support only RTF and DOC  formats, but not DOCX.

As a result, I’ve chose UseOffice .Net:

This is my example of how you can convert DOCX files to PDF at server side:

        Dim u As New SautinSoft.UseOffice()
       'Path to any local file
        Dim inputFilePath As String = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "С:\Server\DOC.docx"))
        'Path to output resulted file
        Dim outputFilePath As String = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "С:\Server\Result.pdf"))
        'Prepare UseOffice .Net, loads MS Word in memory
        Dim ret As Integer = u.InitWord()
        'Return values:
        '0 - Loading successfully
        '1 - Can't load MS Word® library in memory
        If ret = 1 Then
            Return
        End If
        'Converting
        ret = u.ConvertFile(inputFilePath, outputFilePath, SautinSoft.UseOffice.eDirection.DOCX_to_PDF)
        'Release MS Word from memory
        u.CloseWord()

Here you can find extra info about the component and get trial: www.sautinsoft.com

Share on Facebook

Leave a Comment

Your email address will not be published.