SetCustomFilenameTemplate

Sets the template string of the custom file name. This method can be used only when the filename generation method is set to ‘Custom file naming’.

 

SetCustomFilenameTemplate (pBlackIceDEVMODE As Long, pszFilenameTemplate As String) As Boolean

 

Input value    - pointer to the BlackIceDEVMODE structure.

Template name string to set.

Return value - True on success, otherwise False.

 

The method checks the validation of the template string.

The format of the template string has to be to following:

 

[prefix][optional_field1][custom_field][optional_field2].[extension]

 

[prefix] can be the following:

The prefix is a maximum 4 characters long string. Prefix can contain any characters, except invalid filename characters, such as ? or *. The prefix can be an empty string.

[optional_field1], [optional_field2] can be the following:

<<NONE>>

The optional field is not used.

<<DOCNAME>>

Name of the document. This name is came from the printing application.

<<PAGENUM>>

Actual page number. It uses zero padding for 4 characters, for example 0005.

<<USERNAME>>

Name of the current logged in user.

<<COMPUTER>>

The host name of the computer.

<<DATE>>

Actual system date when printing in format of system default.

<<TIME>>

Actual system time when printing in format of system default.

<<TIMEMS>>

Local time with millisecond accuracy.

<<COUNTER>>

Sequential document number in 7 digits format.
The counter <<COUNTER>> can be rest manually at the following registry location:

HKEY_CURRENT_USER\Software\Black Ice Software LLC\[Black Ice Pinter driver name]      (dword) LastDocNumber

[custom_field] can be the following:

Custom_field is a maximum 64 character long string. Custom_field can contain any characters, except invalid filename characters, such as ? or *.

[extension] can be the following:

<<ORIGINAL>>

In this case the extension is the original extension of the selected file format. For example if the selected file format is JPEG the extension of the printed image will be .jpg.

Exteinsion also can be a maximum 4 charater long string, such as PDF, TIFF. This field can be empty.

 

These are some examples for the template string:

 

AAA<<NONE>><<NONE>>.<<ORIGINAL>>

<<DATE>>_printed_<<TIME>>.jpg

IMG<<DOCNAME>>printedby<<USERNAME>>.<<ORIGINAL>>

 

Field explanations:

 

prefix

optional_field1

custom_field

optional_field2

.extension

Result example

AAA

<<NONE>>

 

<<NONE>>

.<<ORIGINAL>>

AAA.PDF

 

<<DATE>>

_printed_

<<TIME>>

.jpg

4-19-2017_printed_10-44-33 AM.PDF

IMG

<<DOCNAME>>

printedby

<<USERNAME>>

.<<ORIGINAL>>

IMGDocumentprintedbyJohn.PDF

 

 

NOTE: For 32-bit applications , use pBlackIceDEVMODE as Integer, instead of Long.