Creating PDF-Files - Changing default settings with VBA?

Creating PDF-Files - Changing default settings with VBA?

Post by Otto Has » Tue, 24 Jul 2001 22:17:12



Hi NG,

I want to create PDF-Files of drawings with
the PDF-Writer.

Now I try to change the default settings of the
PDFWriter with VBA (user defined paper size).

Therefore I change the following registry keys:

HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter (cp-values)
HKEY_CURRENT_USER\Printers\DevModes2\Acrobat PDFWriter
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\AcrobatPDFWriter\Default DevMode

The registry keys are changed successfully but
when I print out they take no effect and the
original values are used.

What is wrong? Which values must be changed?
Any idea?

Otto

 
 
 

Creating PDF-Files - Changing default settings with VBA?

Post by Domini » Wed, 25 Jul 2001 01:03:53


I'm on the way to create a small utility for PDF-Printing with SW...

had to tweak VB with code that should not work in real world
but actualy it does  =)

hopefully tonight I will get on this

btw, just create 2 PDF-printers and set their default to what you need
so you won`t have to mind about registry changes..
(Just create a dummy one, generic type printer and then change it's drivers
to PDF writer, then it`s default settings to the format you need!)

Dom


> Hi NG,

> I want to create PDF-Files of drawings with
> the PDF-Writer.

> Now I try to change the default settings of the
> PDFWriter with VBA (user defined paper size).

> Therefore I change the following registry keys:

> HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter (cp-values)
> HKEY_CURRENT_USER\Printers\DevModes2\Acrobat PDFWriter
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\AcrobatPDFWriter\Default DevMode

> The registry keys are changed successfully but
> when I print out they take no effect and the
> original values are used.

> What is wrong? Which values must be changed?
> Any idea?

> Otto


 
 
 

Creating PDF-Files - Changing default settings with VBA?

Post by Kenneth Barrenti » Wed, 25 Jul 2001 02:07:49


I don't know of a permanent fix, but here is a temp solution.
Starting from, the File Menu, Print, Select PDF Writer, click
Properties, select Custom, type in height by width values and margin.
It will stay set at what ever value you type in.  However, if you exit
SW and then launch SW again, you will have to reset these values.
Annoying, but works.  BTW, OS is W2K.

Kenneth


> Hi NG,

> I want to create PDF-Files of drawings with
> the PDF-Writer.

> Now I try to change the default settings of the
> PDFWriter with VBA (user defined paper size).

> Therefore I change the following registry keys:

> HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter (cp-values)
> HKEY_CURRENT_USER\Printers\DevModes2\Acrobat PDFWriter
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\AcrobatPDFWriter\Default DevMode

> The registry keys are changed successfully but
> when I print out they take no effect and the
> original values are used.

> What is wrong? Which values must be changed?
> Any idea?

> Otto

 
 
 

Creating PDF-Files - Changing default settings with VBA?

Post by Danfer » Wed, 25 Jul 2001 14:56:44


Hi, I'm interesting in this utility. when you'll finish it, can I receive a copy ?
I' have other codes that you can find it usefull.

Best regards
Danferes


> I'm on the way to create a small utility for PDF-Printing with SW...

> had to tweak VB with code that should not work in real world
> but actualy it does  =)

> hopefully tonight I will get on this

> btw, just create 2 PDF-printers and set their default to what you need
> so you won`t have to mind about registry changes..
> (Just create a dummy one, generic type printer and then change it's drivers
> to PDF writer, then it`s default settings to the format you need!)

> Dom


> > Hi NG,

> > I want to create PDF-Files of drawings with
> > the PDF-Writer.

> > Now I try to change the default settings of the
> > PDFWriter with VBA (user defined paper size).

> > Therefore I change the following registry keys:

> > HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter (cp-values)
> > HKEY_CURRENT_USER\Printers\DevModes2\Acrobat PDFWriter
> > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\AcrobatPDFWriter\Default DevMode

> > The registry keys are changed successfully but
> > when I print out they take no effect and the
> > original values are used.

> > What is wrong? Which values must be changed?
> > Any idea?

> > Otto

 
 
 

Creating PDF-Files - Changing default settings with VBA?

Post by Otto Has » Wed, 25 Jul 2001 18:13:38


Hi Dom,

Quote:> btw, just create 2 PDF-printers and set their default to what you need
> so you won`t have to mind about registry changes..
> (Just create a dummy one, generic type printer and then change it's drivers
> to PDF writer, then it`s default settings to the format you need!)

this idea sounds good and I will use it if I get no other solution.

My problem is:

Valid drawings are stored in a special folder
in RapidDraft format.

Each night a batch process will create a file list
of this folder and create PDF (and TIF) files.

For this I use Excel because I will log the process.

All works fine but only the different paper sizes
of the drawings are a problem.

I have paper sizes from 8,27x11,7 to 33,1x46,8 inches
each landscape or portrait. With your solution
I need a lot of defined PDFWriters.

Otto

 
 
 

Creating PDF-Files - Changing default settings with VBA?

Post by Glenn Fran » Fri, 27 Jul 2001 01:49:49


I wrote a VB routine that does something similar.  It looks in the
directories every hour and creates a PDF file of any drawing that has
been modified in the past hour.  I only print B, C, D & E size so the
following works well for me.  In PDF Writer Properties set the page
size to custom  34 x 22 inches and the margin to .125.  Set
orientation to landscape and resolution to 600.  Pick "scale to fit"
and "print to file".  In VB 6.0 use the command PRINTOUT2.  Hope this
helps.

> Hi NG,

> I want to create PDF-Files of drawings with
> the PDF-Writer.

> Now I try to change the default settings of the
> PDFWriter with VBA (user defined paper size).

> Therefore I change the following registry keys:

> HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter (cp-values)
> HKEY_CURRENT_USER\Printers\DevModes2\Acrobat PDFWriter
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\AcrobatPDFWriter\Default DevMode

> The registry keys are changed successfully but
> when I print out they take no effect and the
> original values are used.

> What is wrong? Which values must be changed?
> Any idea?

> Otto