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.
Unfortunately, activation email could not send to your email. Please try again.

ConvertDocToPDF

Thread ID:

Created:

Updated:

Platform:

Replies:

82670 Jun 18,2009 10:30 AM Dec 19,2009 11:38 AM Windows Forms 2
loading
Tags: DocIO
Carl Davidson
Asked On June 18, 2009 10:30 AM

Hi everyone,

Here is my problem. When I try to create a new WordDocument, an exception "System.ArgumentOutOfRangeException : Non-negative number required" occurs.

Here is my code :

Public Function ConvertDocToPDF(ByVal v_strDocFileName As String, ByVal v_strPassword As String, ByVal v_strPDFFileName As String) As Boolean
Dim blnReturn As Boolean = False
Dim objConverter As DocToPDFConverter = Nothing
Dim objWordDocument As WordDocument = Nothing
Dim objPDFDocument As Pdf.PdfDocument = Nothing

Try
objWordDocument = New WordDocument(v_strDocFileName, v_strPassword)
objConverter = New DocToPDFConverter
objPDFDocument = objConverter.ConvertToPDF(objWordDocument)
objPDFDocument.Save(v_strPDFFileName)
blnReturn = True
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString)
Throw ex
Finally
If Not IsNothing(objWordDocument) Then objWordDocument.Close()
If Not IsNothing(objPDFDocument) Then objPDFDocument.Close()
If Not IsNothing(objConverter) Then objConverter.Dispose()
End Try

Return blnReturn
End Function

Can anybody help me...

Thanks in advance

Carl Davidson

Bhuvaneswari P [Syncfusion]
Replied On June 20, 2009 01:52 AM

Hi Carl.

Thank you for your interest in Syncfusion products.

Could you please provide your word document in which you want to convert to PDF document? This would be very helpful for us to reproduce and investigate the issue further.

Best Regards,
Bhuvana

Mitch Arias
Replied On December 19, 2009 11:38 AM

Carl,

Could you please tell me what assemblies you are using in order to get to the DocToPDFConverter class? I cannot find it anywhere.

Thanks,

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.

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.

;