Hi,

I am trying to automatically convert a word file to PDF. I have a Adobe PDF
print driver which when you print to it asks for a PDF filename and then
generates a PDF file as a print image. Is there anyway to automate this
process in VFP - to be able to print directly to this print driver and
supply a predefined filename for the PDF file?

Thanks

Zoom

Re: Any way to convert Word document to PDF in VFP with OLE Automation? by Big

Big
Fri Apr 18 10:55:12 CDT 2008

Zoom:

I use WIN2PDF and this my code:

SET PRINTER TO NAME "WIN2PDF"
TempFile = SYS(2015) + '.pdf'
REPORT FORM reportname NOCONSOLE TO FILE &TempFile

Look at your printers in your control and replace WIN2PDF with the name of
the Adobe driver.

BR

"Zoom" <keashdoc@hotmail.com> wrote in message
news:3vednTmRasMiAJXVnZ2dnUVZ_s2tnZ2d@comcast.com...
> Hi,
>
> I am trying to automatically convert a word file to PDF. I have a Adobe
> PDF print driver which when you print to it asks for a PDF filename and
> then generates a PDF file as a print image. Is there anyway to automate
> this process in VFP - to be able to print directly to this print driver
> and supply a predefined filename for the PDF file?
>
> Thanks
>
> Zoom
>
>



Re: Any way to convert Word document to PDF in VFP with OLE Automation? by Dan

Dan
Fri Apr 18 11:05:19 CDT 2008

There's a white paper on Rick Stahl's website (www.west-wind.com) that
explains how to do this.

Dan

Zoom wrote:
> Hi,
>
> I am trying to automatically convert a word file to PDF. I have a
> Adobe PDF print driver which when you print to it asks for a PDF
> filename and then generates a PDF file as a print image. Is there
> anyway to automate this process in VFP - to be able to print directly
> to this print driver and supply a predefined filename for the PDF
> file?
> Thanks
>
> Zoom



Re: Any way to convert Word document to PDF in VFP with OLE Automation? by tim_witort

tim_witort
Fri Apr 18 11:25:29 CDT 2008

Zoom seemed to utter in
news:3vednTmRasMiAJXVnZ2dnUVZ_s2tnZ2d@comcast.com:

> Hi,
>
> I am trying to automatically convert a word file to PDF. I have a
> Adobe PDF print driver which when you print to it asks for a PDF
> filename and then generates a PDF file as a print image. Is there
> anyway to automate this process in VFP - to be able to print directly
> to this print driver and supply a predefined filename for the PDF file?

I do this, but I'm not using Acrobat's PDF printer. I use
Amyuni's PDF printer:

*
* Set PDF output file name:
*
This.PDFWriter.FileNameOptions = 1 + 2
This.PDFWriter.DefaultFileName = lcSomeFileName

*
* Direct Word to print to the PDF Writer:
*
This.WordObj.ActivePrinter = "PDF Writer"

This.WordObj.Application.PrintOut(.F., .F., wdPrintAllDocument, "", , , ;
wdPrintDocumentContent, 1, , wdPrintAllPages, .F., .T., "", , , 0, 0, 0,
0)

We used to use Acrobat, but were running into problems when
user's weren't running the same version of Acrobat. Switched
to Amyuni and now all the PDF functions are built into our
application - no need for Acrobat at all.

When we used to use Acrobat, we would need to set a registry
entry for the file name to print to, then print to the
Acrobat PDF Writer. With Amyuni, we just set properties on
the Amyuni PDF writer object as shown in the first two
code lines above.

-- TRW
_______________________________________
t i m . w i t o r t
_______________________________________

Re: Any way to convert Word document to PDF in VFP with OLE Automation? by Zoom

Zoom
Sat Apr 19 17:23:33 CDT 2008

Appreciate the info. Do you have specific examples with the Adobe Print
Driver?

Thanks


"Tim Witort" <tim_witort@hotmail.com> wrote in message
news:Xns9A84600E4BDBCtimwitortwrotethis@216.196.97.131...
> Zoom seemed to utter in
> news:3vednTmRasMiAJXVnZ2dnUVZ_s2tnZ2d@comcast.com:
>
>> Hi,
>>
>> I am trying to automatically convert a word file to PDF. I have a
>> Adobe PDF print driver which when you print to it asks for a PDF
>> filename and then generates a PDF file as a print image. Is there
>> anyway to automate this process in VFP - to be able to print directly
>> to this print driver and supply a predefined filename for the PDF file?
>
> I do this, but I'm not using Acrobat's PDF printer. I use
> Amyuni's PDF printer:
>
> *
> * Set PDF output file name:
> *
> This.PDFWriter.FileNameOptions = 1 + 2
> This.PDFWriter.DefaultFileName = lcSomeFileName
>
> *
> * Direct Word to print to the PDF Writer:
> *
> This.WordObj.ActivePrinter = "PDF Writer"
>
> This.WordObj.Application.PrintOut(.F., .F., wdPrintAllDocument, "", , , ;
> wdPrintDocumentContent, 1, , wdPrintAllPages, .F., .T., "", , , 0, 0,
> 0,
> 0)
>
> We used to use Acrobat, but were running into problems when
> user's weren't running the same version of Acrobat. Switched
> to Amyuni and now all the PDF functions are built into our
> application - no need for Acrobat at all.
>
> When we used to use Acrobat, we would need to set a registry
> entry for the file name to print to, then print to the
> Acrobat PDF Writer. With Amyuni, we just set properties on
> the Amyuni PDF writer object as shown in the first two
> code lines above.
>
> -- TRW
> _______________________________________
> t i m . w i t o r t
> _______________________________________



Re: Any way to convert Word document to PDF in VFP with OLE Automation? by Paul

Paul
Wed Apr 23 11:42:01 CDT 2008

Open Office Writer can save documents as PDF. I haven't looked into it, but
it might be possible to automate that.

http://udk.openoffice.org/common/man/tutorial/office_automation.html

http://www.tedroche.com/Present/VFPOOoAutomation.htm




"Zoom" <keashdoc@hotmail.com> wrote in message
news:3vednTmRasMiAJXVnZ2dnUVZ_s2tnZ2d@comcast.com...
> Hi,
>
> I am trying to automatically convert a word file to PDF. I have a Adobe
> PDF print driver which when you print to it asks for a PDF filename and
> then generates a PDF file as a print image. Is there anyway to automate
> this process in VFP - to be able to print directly to this print driver
> and supply a predefined filename for the PDF file?
>
> Thanks
>
> Zoom
>
>



Re: Any way to convert Word document to PDF in VFP with OLE Automation? by Raj

Raj
Wed Apr 23 12:41:10 CDT 2008


I believe PDF995 will let you do this and it is only about $20
Raj

"Paul Pedersen" <nospam@no.spam> wrote in message
news:eYYwwDWpIHA.2068@TK2MSFTNGP05.phx.gbl...
> Open Office Writer can save documents as PDF. I haven't looked into it,
> but it might be possible to automate that.
>
> http://udk.openoffice.org/common/man/tutorial/office_automation.html
>
> http://www.tedroche.com/Present/VFPOOoAutomation.htm
>
>
>
>
> "Zoom" <keashdoc@hotmail.com> wrote in message
> news:3vednTmRasMiAJXVnZ2dnUVZ_s2tnZ2d@comcast.com...
>> Hi,
>>
>> I am trying to automatically convert a word file to PDF. I have a Adobe
>> PDF print driver which when you print to it asks for a PDF filename and
>> then generates a PDF file as a print image. Is there anyway to automate
>> this process in VFP - to be able to print directly to this print driver
>> and supply a predefined filename for the PDF file?
>>
>> Thanks
>>
>> Zoom
>>
>>
>
>



Re: Any way to convert Word document to PDF in VFP with OLE Automation? by Rush

Rush
Wed Apr 23 13:13:51 CDT 2008

Zoom wrote:
> Hi,
>
> I am trying to automatically convert a word file to PDF. I have a Adobe PDF
> print driver which when you print to it asks for a PDF filename and then
> generates a PDF file as a print image. Is there anyway to automate this
> process in VFP - to be able to print directly to this print driver and
> supply a predefined filename for the PDF file?
>
> Thanks
>
> Zoo

You might give PDFCreator (open source) a try - it supports a COM
interface, and can be automated. (I use it for non-OpenOffice PDF
generation, and I've been happy with it).

- Rush

Re: Any way to convert Word document to PDF in VFP with OLE Automation? by tim_witort

tim_witort
Wed Apr 23 14:16:33 CDT 2008

Zoom seemed to utter in
news:7t6dndWVYIl77ZfVnZ2dnUVZ_g6dnZ2d@comcast.com:

> "Tim Witort" <tim_witort@hotmail.com> wrote in message
> news:Xns9A84600E4BDBCtimwitortwrotethis@216.196.97.131...
>> Zoom seemed to utter in
>> news:3vednTmRasMiAJXVnZ2dnUVZ_s2tnZ2d@comcast.com:
>>
>>> Hi,
>>>
>>> I am trying to automatically convert a word file to PDF. I have a
>>> Adobe PDF print driver which when you print to it asks for a PDF
>>> filename and then generates a PDF file as a print image. Is there
>>> anyway to automate this process in VFP - to be able to print directly
>>> to this print driver and supply a predefined filename for the PDF
>>> file?
>>
>> I do this, but I'm not using Acrobat's PDF printer. I use
>> Amyuni's PDF printer:
>>
>> *
>> * Set PDF output file name:
>> *
>> This.PDFWriter.FileNameOptions = 1 + 2
>> This.PDFWriter.DefaultFileName = lcSomeFileName
>>
>> *
>> * Direct Word to print to the PDF Writer:
>> *
>> This.WordObj.ActivePrinter = "PDF Writer"
>>
>> This.WordObj.Application.PrintOut(.F., .F., wdPrintAllDocument, "", ,
>> , ;
>> wdPrintDocumentContent, 1, , wdPrintAllPages, .F., .T., "", , , 0,
>> 0, 0, 0)
>>
>> We used to use Acrobat, but were running into problems when
>> user's weren't running the same version of Acrobat. Switched
>> to Amyuni and now all the PDF functions are built into our
>> application - no need for Acrobat at all.
>>
>> When we used to use Acrobat, we would need to set a registry
>> entry for the file name to print to, then print to the
>> Acrobat PDF Writer. With Amyuni, we just set properties on
>> the Amyuni PDF writer object as shown in the first two
>> code lines above.

> Appreciate the info. Do you have specific examples with the Adobe
> Print Driver?

The only thing different is setting the output filename
in the registry:

*
* Create an instance of the registry tool:
*
loRegistry = CREATEOBJECT("registry")

*
* Set the output file name:
*
loRegistry.SetRegKey("PDFFileName", tcPDFFile, ;
"Software\Adobe\Acrobat PDFWriter", HKEY_CURRENT_USER)

*
* Make sure PDF Writer is not set to open Acrobat after printing:
*
loRegistry.SetRegKey("bExecViewer", "0", ;
"Software\Adobe\Acrobat PDFWriter", HKEY_CURRENT_USER)

-- TRW
_______________________________________
t i m . w i t o r t
_______________________________________