How to convert multiple DOCX files into PDF using VB.NET?
Article from our customer
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 SautinSoft.UseOffice
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 SautinSoft.UseOffice, 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()
Если вам нужен пример кода или у вас есть вопрос: напишите нам по адресу support@sautinsoft.ru или спросите в онлайн-чате (правый нижний угол этой страницы) или используйте форму ниже: