convert word document to pdf programmatically in vb.net

M

Mark

Hi, I want to convert mailmerged documents to pdf's in vb.net. I have Acrobat
5 installed, but do not know how to make it all work. what do I need to do?
Are there any code samples available? I've seen lots of replies to questions
similar to this that merely state that the distiller is needed....that isn't
of any help....if anyone has info a little deeper than that, it would be most
appreciated. Thanks!
 
P

Peter Huang [MSFT]

Hi

Since the PDF format is developped by Adobe. So Word has no idea how to
convert word doc format to pdf format.
The distiller or PDF Writer is similar with a printer. Word just print the
word document to the special printer, and the PDF Writer or distiller has
the responsibility to convert the printer recognized data into PDF format.
For Word side, it just know that it has printed a word document to the
printer.
Then the PDF Writer or Distiller which is installed by Adobe Acrobat will
get the printer recognize data into PDF file.

For Word, we have object modal to print a word document to a printer via
Automation.
Imports Word = Microsoft.Office.Interop.Word
Module Module1
Sub Main()
Dim wdApp As New Word.Application
Dim wdDoc As Word.Document = wdApp.Documents.Open("C:\test.doc")
wdDoc.PrintOut(True)
wdDoc.Close()
wdApp.Quit()
End Sub
End Module

For the problem about how Distiller or PDF Writer handle the Printer issue,
I think you may try to contact Adobe for detailed information.
Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steve Rindsberg

Hi, I want to convert mailmerged documents to pdf's in vb.net. I have Acrobat
5 installed, but do not know how to make it all work. what do I need to do?
Are there any code samples available? I've seen lots of replies to questions
similar to this that merely state that the distiller is needed....that isn't
of any help....if anyone has info a little deeper than that, it would be most
appreciated. Thanks!

As Peter's mentioned, in some cases you can simply print to the Distiller
instance (manually or via VBA) to get a PDF. Problem is that this either pops
up a dialog box asking the user to name the file or it puts the file wherever
Distiller pleases under the name it chooses.

To get around this you need to automate printing to file on a PS printer driver
then automate Distiller to process the file.

A google on "automate distiller" should get you started.

The details may change with each version of Distiller. Caution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top