comp.lang.ada
 help / color / mirror / Atom feed
* convert Word to PDF via GNATCOM
@ 2006-02-12 14:21 Stephen Leake
  2006-02-12 17:21 ` Jeffrey Creem
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stephen Leake @ 2006-02-12 14:21 UTC (permalink / raw)


I have several Microsoft Word documents that are updated occasionally,
and I'd like to automate converting them to PDF for publication on a
Web page. (Yes, I'd rather they were in LaTeX or some other source,
but I'm stuck with MS Word for now).

I have Adobe Acrobat installed. It adds a button to Word that does the
conversion nicely. 

I'd like to use Gnu make to automate things, but I'm open to other
suggestions.

I don't know how to invoke a Word button (or the underlying macro)
from a command line. 

So I'm trying to use GNATCOM to generate a binding, and write a simple
Ada main that invokes the Word macro that does the PDF conversion.

I've run bindcom on MSWORD.TLB, and generated lots of Ada code, but I
don't see anything that looks like "call a macro".

Any suggestions?

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: convert Word to PDF via GNATCOM
  2006-02-12 14:21 convert Word to PDF via GNATCOM Stephen Leake
@ 2006-02-12 17:21 ` Jeffrey Creem
  2006-02-12 17:42 ` Pascal Obry
  2006-02-13  9:16 ` Rod Chapman
  2 siblings, 0 replies; 5+ messages in thread
From: Jeffrey Creem @ 2006-02-12 17:21 UTC (permalink / raw)


Stephen Leake wrote:
> I have several Microsoft Word documents that are updated occasionally,
> and I'd like to automate converting them to PDF for publication on a
> Web page. (Yes, I'd rather they were in LaTeX or some other source,
> but I'm stuck with MS Word for now).
> 
> I have Adobe Acrobat installed. It adds a button to Word that does the
> conversion nicely. 
> 
> I'd like to use Gnu make to automate things, but I'm open to other
> suggestions.
> 
> I don't know how to invoke a Word button (or the underlying macro)
> from a command line. 
> 
> So I'm trying to use GNATCOM to generate a binding, and write a simple
> Ada main that invokes the Word macro that does the PDF conversion.
> 
> I've run bindcom on MSWORD.TLB, and generated lots of Ada code, but I
> don't see anything that looks like "call a macro".
> 
> Any suggestions?
> 

May not be quite as good but it looks like it might be easier to do this 
  with http://wvware.sourceforge.net/

Since it ends up using the Acrobat Distiller for the final conversion to 
PDF the resulting PDF should be good with the exception of any possible 
misinterpretation of the word data.


If that does not work, perhaps this articule will

http://support.microsoft.com/kb/172483/




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: convert Word to PDF via GNATCOM
  2006-02-12 14:21 convert Word to PDF via GNATCOM Stephen Leake
  2006-02-12 17:21 ` Jeffrey Creem
@ 2006-02-12 17:42 ` Pascal Obry
  2006-02-13  9:16 ` Rod Chapman
  2 siblings, 0 replies; 5+ messages in thread
From: Pascal Obry @ 2006-02-12 17:42 UTC (permalink / raw)
  To: Stephen Leake

Stephen Leake a �crit :
> I have several Microsoft Word documents that are updated occasionally,
> and I'd like to automate converting them to PDF for publication on a
> Web page. (Yes, I'd rather they were in LaTeX or some other source,
> but I'm stuck with MS Word for now).

Agreed for LaTeX :)

But won't this be possible with OpenOffice, it supports natively PDF and
can import .doc files. I just don't know if it can be used in batch mode
but I'll be surprised if it was not... just a path to check...

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: convert Word to PDF via GNATCOM
  2006-02-12 14:21 convert Word to PDF via GNATCOM Stephen Leake
  2006-02-12 17:21 ` Jeffrey Creem
  2006-02-12 17:42 ` Pascal Obry
@ 2006-02-13  9:16 ` Rod Chapman
  2006-02-14  3:06   ` Stephen Leake
  2 siblings, 1 reply; 5+ messages in thread
From: Rod Chapman @ 2006-02-13  9:16 UTC (permalink / raw)


> I'd like to use Gnu make to automate things, but I'm open to other
> suggestions.

We make makefiles and Word macros to do this.  hang on...got it...
Install this in a macro file that is loaded into your global Normal.dot
template:

Sub pdfprint()
    ActivePrinter = "Acrobat PDFWriter"
    Application.PrintOut FileName:="", Range:=wdPrintAllDocument,
Item:= _
        wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
        Collate:=True, Background:=False, PrintToFile:=True,
OutputFileName:="wibble"

    ActiveDocument.Saved = True
    ActiveDocument.Close
    Application.Quit
End Sub

We then have a makefile rule that uses Word's little-documented "/m"
command-line
switch:

%.pdf : %.doc
	$(msword) /mpdfprint $<
	mv wibble.pdf $@

Or something like that...I'm sure you get the idea...
 - Rod




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: convert Word to PDF via GNATCOM
  2006-02-13  9:16 ` Rod Chapman
@ 2006-02-14  3:06   ` Stephen Leake
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Leake @ 2006-02-14  3:06 UTC (permalink / raw)


"Rod Chapman" <rod.chapman@praxis-his.com> writes:

> We make makefiles and Word macros to do this.  hang on...got it...
> Install this in a macro file that is loaded into your global Normal.dot
> template:
>
> Sub pdfprint()
>     ActivePrinter = "Acrobat PDFWriter"
>     Application.PrintOut FileName:="", Range:=wdPrintAllDocument,
> Item:= _
>         wdPrintDocumentContent, Copies:=1, Pages:="",
> PageType:=wdPrintAllPages, _
>         Collate:=True, Background:=False, PrintToFile:=True,
> OutputFileName:="wibble"
>
>     ActiveDocument.Saved = True
>     ActiveDocument.Close
>     Application.Quit
> End Sub

That's not as nice as invoking the "convert to PDF" button; you
don't get the table of contents as PDF bookmarks.

But I can't actually find the name of the macro that button invokes,
so maybe I'll just go with your approach.

> We then have a makefile rule that uses Word's little-documented "/m"
> command-line
> switch:

_That's_ what I was looking for! Why can't MS document things like
that!? Or perhaps I should ask how you found out about it?

Way easier than sorting thru thousands of lines of GNATCOM output.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-02-14  3:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-12 14:21 convert Word to PDF via GNATCOM Stephen Leake
2006-02-12 17:21 ` Jeffrey Creem
2006-02-12 17:42 ` Pascal Obry
2006-02-13  9:16 ` Rod Chapman
2006-02-14  3:06   ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox