We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

NullReference when execute ConvertToPdf(WordDocument)

Thread ID:

Created:

Updated:

Platform:

Replies:

121441 Dec 15,2015 12:56 PM UTC Dec 16,2015 08:47 AM UTC ASP.NET Web Forms 2
loading
Tags: DocIO
Ernane Ribas
Asked On December 15, 2015 12:56 PM UTC

When i try convert my docx in pdf file i receive the exception  NullReferenceException.

I'm importing the follow dll:

version: 13.3450.0.7

Imports Syncfusion.OfficeChart
Imports Syncfusion.DocIO
Imports Syncfusion.DocIO.DLS
Imports Syncfusion.DocToPDFConverter
Imports Syncfusion.Pdf
Imports Syncfusion.OfficeChartToImageConverter
Imports Syncfusion.Core

And my code using:

 Try

            Dim wordDocument As New WordDocument(filename, FormatType.Docx)

            'Creates an instance of the DocToPDFConverter

            Dim converter As New DocToPDFConverter()

            'Converts Word document into PDF document

            Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)

            'Saves the PDF file 

            pdfDocument.Save(filenamePdf)

            'Closes the instance of document objects

            pdfDocument.Close(True)

            wordDocument.Close()
        Catch ex As Exception

        End Try

The variable "filename" is a full path for my docx. The variable "filenamePdf" is a full path for my pdf file. 
Sample:
filename = "C:\tempFile\file.docx"
filenamePdf = "C:\tempFile\file.pdf"

What's I doing wrong??

Any help me?


Ernane Ribas
Replied On December 15, 2015 01:08 PM UTC

More Information

Exception throw:
An exception of type 'System.NullReferenceException' occurred in Syncfusion.DocIO.Base.dll but was not handled in user code

Sarathkumar V [Syncfusion]
Replied On December 16, 2015 08:47 AM UTC

Hi Ernane,

Thank you for using Syncfusion product.

We have created a support incident for the reported Null reference exception issue in Word to PDF conversion under your account.
Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents


Regards,
Sarath


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;