Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: Word to PDF, (maybe via PS ?)
Conf: (P-PDF) Developers, Msg: 75966
From: henrikryberg
Date: 11/8/2002 03:44 AM

This mail has been published under "Paper to PDF" by mistake.
I was advised that it was the wrong forum. Apologies.
I try to re-publish here instead.
*********************************************

Newbie to PDF programming question.
Environment: Win2000, Office 2000, Distiller 4.05, VB(A)

I've got a word doc. Ultimately I would like to have three different PDF files in one print loop (Distill methods must vary: print, screen + 1 custom)

I might have to have a middle step creating a PS file ?
(reason why I used .printout method in code below - but it didn't work outside In/Out folders)

I've tried automation through these In/Out folders, but this only creates 3 identical files.

Ideally I would like to drop my file in a dedicated folder reserved for this type of conversions.

So I thought I could make 3 loops creating 3 PDF's distilled in various ways - something like the code shown below. But the .FiletoPDF doesn't do anything no matter what I try.

(printout method used to see that printing works and that it's just a matter of swapping the distill methods)

***** VB Code and comments ********
Explanation on variables
jobNo = integer, between 1 and 3
PDFprintPath = string, actual path to pre-selected folder
thisDoc = string, name of Word doc
strDistilthis = string, concatenated filename - the file to distil.
msWord = object, Word app

'Create PS file for distiller and select Distiller method
Set msWord = GetObject(Class:="Word.Application.9")
msWord.ActivePrinter = "Acrobat Distiller"

Select Case jobNo
Case 1 'screenoptimized
'this creates a fine PDF, but doesn't look at distil method
ActiveDocument.PrintOut printtofile:=True, outputfilename:=PDFPrintPath & thisDoc & "s" & ".prn"

'get full name string of file above
strDistilThis = fGetPrnFileName(thisDoc, PDFPrintPath)
pdf.FileToPDF PDFPrintPath & strDistilThis, strDistilThis, "screenoptimized"

Case 2 'printoptimized
ActiveDocument.PrintOut printtofile:=True, outputfilename:=PDFPrintPath & thisDoc & "p" & ".prn"
strDistilThis = fGetPrnFileName(thisDoc, PDFPrintPath)
pdf.FileToPDF PDFPrintPath & strDistilThis & "p" & ".prn", strDistilThis, "printoptimized"

Case 3 'Custom PDF
ActiveDocument.PrintOut printtofile:=True, outputfilename:=PDFPrintPath & thisDoc & "Custom" & ".prn"
strDistilThis = fGetPrnFileName(thisDoc, PDFPrintPath)
pdf.FileToPDF PDFPrintPath & strDistilThis & "Custom" & ".prn", strDistilThis, "printoptimized"
End Select

*********************************************

Any suggestions or pieces of good advice from experienced people will be highly appreciated.

Thanks
;o) Henrik


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.