[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Converting Word Document to PDF file.

Akshit Shah

10/15/2007 8:50:00 AM

Hi friz,

I want to convert word document (with all formatings & images) to a PDF file.

How i can achive this.

Please Help.
5 Answers

jacky kwok

10/16/2007 2:08:00 AM

0

Akshit Shah wrote:
> Hi friz,
>
> I want to convert word document (with all formatings & images) to a PDF file.
>
> How i can achive this.
>
> Please Help.

I do not sure winword itself to have such function or not. I do not use
winword since winword2000.

Several methods you can change a word document to PDF:

1. install Adobe Acrobat.

2. using Open Office. Use Open office to open winword document, then
export to PDF (export to PDF is built function of Open Office writer).


--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk

Mads Bondo Dydensborg

10/17/2007 10:15:00 AM

0

jacky kwok wrote:

> 2. using Open Office. Use Open office to open winword document, then
> export to PDF (export to PDF is built function of Open Office writer).

Yes, and if you use open offices UNO interface (
http://wiki.services.openoffice.or... ) you can drive it from within
your programs.

Regards

Mads

--
Med venlig hilsen/Regards

Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo
Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77
34

adaandeve

11/29/2007 6:32:00 PM

0



"Akshit Shah" wrote:

> Hi friz,
>
> I want to convert word document (with all formatings & images) to a PDF file.
>
> How i can achive this.
>
> Please Help.
>

adaandeve

11/29/2007 6:35:00 PM

0

How did you end up doing it? I'd like to do it too.
Laura

"Akshit Shah" wrote:

> Hi friz,
>
> I want to convert word document (with all formatings & images) to a PDF file.
>
> How i can achive this.
>
> Please Help.
>

Bob Eaton

11/30/2007 3:35:00 AM

0

"Akshit Shah" <akshit.shah@rediffmail.com> wrote in message
news:06e677e35607477380a4449b9bdea98d@ureader.com...
> I want to convert word document (with all formatings & images) to a PDF
> file.

If you have Office/Word 2007, you can install the PDF plug-in and save
directly from within Word.

Below is a snippet of VB.Net code that will do the conversion using the Word
(2007) PIAs.

Bob

+------------------cut here------------------+

Imports System.Windows.Forms
Imports Word = Microsoft.Office.Interop.Word

Imports System.Runtime.InteropServices ' for Marshal

Imports System.IO ' Path

Module ConvertDocToPdf

Sub Main()

Dim openFileDialog As New OpenFileDialog

openFileDialog.Multiselect = True

openFileDialog.Filter = "All Word Documents
(*.docx;*.docm;*.dotx;*.dotm;*.doc;*.dot;*.htm;*.html;*.rtf;*.mht;*.mhtml;*.xml)|*.docx;
*.docm; *.dotx; *.dotm; *.doc; *.dot; *.htm; *.html; *.rtf; *.mht; *.mhtml;
*.xml|All files (*.*)|*.*"

If (openFileDialog.ShowDialog() = DialogResult.OK) Then

Dim wdSaveFormat As Word.WdSaveFormat =
Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF

Dim wrdApp As New Word.Application

Try

Dim oDocFilename As Object

For Each oDocFilename In openFileDialog.FileNames

Dim wrdDoc As Word.Document = wrdApp.Documents.Open(oDocFilename)

Dim oToFilename As Object = String.Format("{0}\{1}",
Path.GetDirectoryName(oDocFilename), _

Path.GetFileNameWithoutExtension(oDocFilename) + ".pdf")

wrdDoc.SaveAs(oToFilename, wdSaveFormat)

wrdDoc.Close()

Next

Catch ex As Exception

MessageBox.Show(ex.Message)

Finally

wrdApp.Quit()

Marshal.ReleaseComObject(wrdApp)

End Try

End If

End Sub

End Module