Making changes to default options via script after noinstall

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
Ricardo Martinez
Posts: 3
Joined: Mon Jan 31 2005

Making changes to default options via script after noinstall

Post by Ricardo Martinez »

Hello,

we are planning to deploy the Amyuni Professional in our network (500 computers- we have a corporate license). We want to use the silent install option provided by AMYUNI. The only problem is, that we would like to modify the default options of the PDF printer (as an example we want to have the 'embedded fonts' option checked by default... )
Is there a possibility to do this on an easy way? Perhaps someone of the support people has a script, with which we are able to manipulate the default configuration options of the driver.

Thanks in advance for any help..

Best regards
Ric ardo
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Here is a simple VBA script that installs the PDF Printer and set the Font Embedding option to true.

Hope this helps 8)

Code: Select all

' This VB script can be used to Install the PDF Converter and set some of the printer features


Option Explicit

Dim PDF

Set PDF = CreateObject("cdintfEx.cdintfEx")

PDF.PDFDriverInit( "My PDF Printer" ) 

PDF.SetLicenseKey "Licensee","ActivationCode"

PDF.DriverInit( "PDF Printer" ) 'To prevent the printer from being removed

PDF.FontEmbedding = True 

' Set other properties here.

PDF.SetDefaultConfig  'To be called after setting all configuration settings

Set PDF = Nothing
Ricardo Martinez
Posts: 3
Joined: Mon Jan 31 2005

Post by Ricardo Martinez »

Hello Joan,

thanks for the script! I had to change the 'PDF.SetLicenseKey'. I have used the 'PDF.EnablePrinter instead... Now the installation procedure works flawlessly. Nevertheless I am having a hard time enabling some configuration options. I have done the choice to enable the 'Fontembedding' option. But when you enable this option, the driver is configured to do the 'partial font embedding'. We want to do the full embedding of true type and licensed fonts. Is there a possibilty to do this through scripting? I have tried to do it over the 'PDF.FileNameOptionsEx'. But it does not seem to work as expected...

Any help would be greatly appreciated


This is the scipt I am using so far:

Code: Select all

Option Explicit 

Dim PDF 

Set PDF = CreateObject("cdintfEx.cdintfEx") 

PDF.PDFDriverInit( "Gothaer PDF Printer" ) 

PDF.EnablePrinter "XXXX","XXXX" 

PDF.DriverInit( "Gothaer PDF Printer" ) 'To prevent the printer from being removed 
PDF.Printerlanguage = 3
PDF.JPEGCompression = TRUE
PDF.JPEGLevel = 7
PDF.FontEmbedding = True 
PDF.FileNameOptionsEx = 1+10+20+200+200000+400000

PDF.SetDefaultConfig  'To be called after setting all configuration settings 

Set PDF = Nothing [/color]
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You can use the DevmodeFlags() to set other font embedding options.
DevmodeFlags returns a DWord in C++ and a Long in VB.

You can call the following:

Code: Select all

Dim flags as Long
flags = DevmodeFlags
flags = flags + 128 + 256
DevmodeFlags = flags.
The values used for DevmodeFlags are not the same as the ones used for FileNameOptions.

Multilanguage = 20 Hex = 32 Dec
Full Font Embedd = 40Hex = 64 Dec
Standard Font Embedding = 80 Hex = 128 Dec
Licensd Font Embedding = 100 Hex = 256

Hope this helps.
Ricardo Martinez
Posts: 3
Joined: Mon Jan 31 2005

Post by Ricardo Martinez »

Hello Joan,

thanks for the info, the DevModeFlags function works as desired. There are still some doubts that I would like to have clarified... Perhaps there are some answers for my questions ;-)

1. Buffer Overflow with the 'FilenameOptions' Function:
I keep getting buffer overflow errors if I set the FileNameOptions=&H8000& This is the hex value that is supposed to be necessary for the 'LinearizeForWeb'-Option. At least this is the value printed in the PDF-Documentation for the Amyuni PDF Converter... Why does it not work? Did I miss something? If I convert the Hex into Dec=32768 I still get the buffer overflow error...

2. Reserved Function 'DevModeFlags':
I was told in the Amyuni Forum the values for the 'Font-Embedding' options, that can be set through the 'DevModeFlags' function. Which are the values that I need to set through the 'DevModeFlags' Function for the following print properties: 'Web optimization' , 'Message broadcast' and 'Page content compression'

3. Why are most of the options set only for the actual user? Why is the 'DefaultDirectoy' set for all users?
If I execute the Installation/script as the user 'admin', I get the configuration through the VB-Script for the actual user 'admin'. Nevertheless, as soon as I 'log in' with another user account (also with admin rights), the Amyuni options are set on a different way. (I suppose the standard options set through the 'install.exe'). The only property that has been changed for all users through the VBscript is the 'Default Directory'. Why is this so?

4. What is necessary to make the configuration options available to all the users ? This seems to be possible, as the 'install.exe' from Amyuni makes the standard settings for all users....

Any help will be appreciated.


This is our script so far:

[/code]
' Script um den Amyuni PDF Converter zu installieren und die Konfigurationsoptionen zu setzen
' Erstellt von Ricardo Martinez IE3 in Februar 2005 fuer GSP2/2005

Option Explicit 'verhindert das Variabeln die nicht über declare oder dim deklariert worden sind benutzt werden

' Dimensionierung und Erzeugung der Objekte
Dim PDF 'Objekt
Dim WshShell 'Objekt
Dim EnvD 'String
Dim EnvP 'String

'Auslesen der Umgebungs Variabeln um den Standardordner zu setzen
set WshShell = CreateObject("Wscript.Shell")
EnvD = WshShell.ExpandEnvironmentStrings("%HOMEDRIVE%")
EnvP = WshShell.ExpandEnvironmentStrings("%HOMEPATH%")

' Initialisierung des Treibers und Übergabe der Lizenzinformationen
Set PDF = CreateObject("cdintfEx.cdintfEx")
PDF.PDFDriverInit( "Gothaer PDF Converter" )
PDF.EnablePrinter "XXXXXX","XXXXXX"

' Setzen der Konfigurationsoptionen
With PDF
.DriverInit( "Amyuni PDF Converter" ) 'Sichert, das der Treiber nicht geloescht wird
.Printerlanguage=3
'undokumentierte DevmodeFlags
'Multilanguage=32
'Full Font Embedd = 64
'Standard Font Embedd = 128
'Licensed Font Embedd = 256
.devmodeflags = 64 + 128 + 256
.FontEmbedding = TRUE
.JPEGCompression = TRUE
.JPEGLevel = 7
.DefaultDirectory = EnvD + EnvP
.FileNameOptions = 50
.SetDefaultConfig ' Speichern der Konfiguration
End With

Set PDF = Nothing 'nicht unbedingt erforderlich, aber zur Sicherheit

[/code]
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please find here some replies to your questions:

1 - As you are using the ActiveX interface of CDIntf please use FileNameOptionsEx instead of FileNameOptions. This should help.

2 - sorry but I don't have all the values of the Devmode flags, please send an e-mail to Technical Support support@amyuni.com to get the needed information.

3 - 4 - Do you have a "Per User Settings" version of the driver? To know this you need to check with our Technical support.

I know this is not much info but I hope by contacting our Support Team you will get more details.

Have a nice day!
Post Reply