Word - PDF


#1

Hi,

Is there anyway to generate a PDF from MS Word doc. I have already purchased Aspose Word before we decided to make the download read-only. The following is the code. Anyway to convert in the background?

Dim license As License = New License()

license.SetLicense(“Aspose.Word.lic”)

Dim doc As New Document(Request.MapPath(Request.ApplicationPath) & “\QoutationSamples” & txtTemplate.Text)

Dim DS As DataSet

Dim MyCommand As OleDb.OleDbDataAdapter

— SQL statement blah blah

Dim CUSTCODE, CUST_NAME, CONTACT_NAME, DEPT, Add1, CITY, STATE, COUNTRY, ZIPCODE, PHONE, TELEFAX

While myReader.Read

CUST_NAME = myReader(1)

CONTACT_NAME = myReader(2)

DEPT = myReader(3)

Add1 = myReader(4)

CITY = myReader(5)

STATE = myReader(6)

COUNTRY = myReader(7)

ZIPCODE = myReader(8)

PHONE = myReader(9)

TELEFAX = myReader(10)

End While

MyConnection.Close()

Dim fieldNames() As String = {“CUST_NAME”, “CONTACT_NAME”, “DEPT”, “Add1”, “CITY”, “STATE”, “COUNTRY”, “ZIPCODE”, “PHONE”, “TELEFAX”}

Dim fieldValues() As Object = {CUST_NAME, CONTACT_NAME, DEPT, Add1, CITY, STATE, COUNTRY, ZIPCODE, PHONE, TELEFAX}

doc.MailMerge.Execute(fieldNames, fieldValues)

doc.Save(“myDoc1.doc”, SaveFormat.FormatDocument, SaveType.OpenInBrowser, Response)

Thanx!

Pavan


#2

Hi,

Thank you for considering Aspose.

Sure, producing PDF files in cooperation with Aspose.Pdf is one of the general usage scenarios of Aspose.Word. Please read this topic of our Programmers Guide to learn how to perform this and obtain code samples:

http://www.aspose.com/wiki/default.aspx/Aspose.Word/SavingDocuments.html