| File Name | Description |
|---|---|
| uninstall.exe | run it to uninstall Zan Image Printer |
| zvprtcfg.exe | console mode application, command line utility specifically designed for scripting and for use by system administrators. |
| zvprtcfg_win32.exe | Win32 application, command line utility suitable for those who want to control Zan Image Printer with easy programming. |
| zvprthlp.chm | HTML format help file |
| zvprtres.dll | This resource file stores all dialog box templates and other resources |
| zvprtemail.exe | Email sending application |
| configure.ini | program configuration file: disable/enable event log, maximum virtual printer ports |
| zvprtsrv.exe |
The core program for Zan Image Printer. Runs in the background, communicates with the printer render driver,
retrieves the in-memory bitmap from it and saves the bitmap to an image file. Multiple instances of zvprtsrv.exe can be launched, each instance of zvprtsrv.exe is responsible for capturing and saving images for one specific printer. zvprtsrv.exe is spawned in current user's security context. |
C:\Program Files\zvprt50>zvprtcfg zan image printer(bw) -show Build Datetime=May 1 2008, 08:49:23 File Version=5, 0, 4, 1 OS Name=Microsoft Windows XP Professional x64 Edition OS Version=5.02.3790 Service Pack 1 Windows Directory=C:\WINDOWS System Directory=C:\WINDOWS\system32 Printer Driver Directory=C:\WINDOWS\system32\spool\DRIVERS\x64 Configuration Directory=C:\Documents and Settings\Administrator\Application Data \zvprt50\zan image printer(bw) Printer GPD File=C:\WINDOWS\system32\spool\DRIVERS\x64\3\zvprt2.gpd Debug Logging=Disabled Windows environment variables: [%ALLUSERSPROFILE]=C:\Documents and Settings\All Users [%APPDATA]=C:\Documents and Settings\Administrator\Application Data [%TEMP]=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp [%TMP]=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp [%USERDOMAIN]=ZAN-PMLGRLABUJT [%USERNAME]=Administrator [%USERPROFILE]=C:\Documents and Settings\Administrator [%windir]=C:\WINDOWS Parameters(keyword-value pairs) for zan image printer(bw): save.folder=E:\test\ save.basefilename=[%DocName] save.filenameindex=1 save.filexistact=1 save.popupdialog=2
Option Explicit
Private Declare Function SHGetFolderPath Lib "shell32" _
Alias "SHGetFolderPathA" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, _
ByVal hToken As Long, ByVal dwFlags As Long, _
ByVal pszPath As String) As Long
'Used CSIDL values.
'For the full list, search MSDN for "CSIDL Values"
Private Const CSIDL_APPDATA As Long = &H1A
Private Const CSIDL_PROGRAM_FILES As Long = &H26
Private Const CSIDL_COMMON_APPDATA As Long = &H23
Private Const SHGFP_TYPE_CURRENT = 0
Private Const S_OK As Long = 0
Private Const MAX_PATH = 260
Private Function GetZanPrinterFolder(csidl As Long) As String
Dim sPath As String * MAX_PATH
Dim SpecialFolderPath As String
Dim lResult As Long
sPath = Space$(MAX_PATH)
lResult = SHGetFolderPath(0, _
csidl, _
0, _
SHGFP_TYPE_CURRENT, _
sPath)
SpecialFolderPath = Left$(sPath, _
InStr(sPath, vbNullChar) - 1)
GetZanPrinterFolder = SpecialFolderPath
End Function
Public Sub Main()
Dim IniFileFolder As String
'Use CSIDL_COMMON_APPDATA instead if
'all users share the same settings
IniFileFolder = GetZanPrinterFolder(CSIDL_APPDATA)
If Right$(IniFileFolder, 1) <> "\" Then
IniFileFolder = IniFileFolder & "\"
End If
IniFileFolder=IniFileFolder & "zvprt50\Zan Image Printer(bw)"
End Sub
uses Windows, Messages, SysUtils, ShlObj, ShellAPI, SHFolder, Graphics; procedure GetZanPrinterFolder(var APath: String); implementation //get the zan INI setting files folder //for bw printer procedure GetZanPrinterFolder(var APath: String); begin SetLength(APath, MAX_PATH); FillChar(APath[1], MAX_PATH, 0); //Use CSIDL_COMMON_APPDATA instead if //all users share the same settings SHGetFolderPath(0, CSIDL_APPDATA, 0, 0, PChar(APath)); APath := String (PChar (APath)); if (APath[Length(APath)] <> '\') then begin APath := APath + '\'; end; APath := APath + 'zvprt50\Zan Image Printer(bw)\'; end;
#include <windows.h> #include <shlobj.h> #include <shlwapi.h> #pragma comment(lib, "shlwapi.lib") char szPath[MAX_PATH]; HRESULT hr; //Use CSIDL_COMMON_APPDATA instead if //all users share the same settings hr = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szPath); PathAddBackslash(szPath); strcat(szPath, "zvprt50\\Zan Image Printer(bw)");
using namespace System;
String^ strPath;
//Use Environment::SpecialFolder::CommonApplicationData instead if
//all users share the same settings
//strPath = Environment::GetFolderPath
//(Environment::SpecialFolder::CommonApplicationData);
strPath = Environment::GetFolderPath
(Environment::SpecialFolder::ApplicationData);
if(!strPath->EndsWith(L"\\")) strPath = String::Concat(strPath, L"\\");
strPath = String::Concat(strPath, L"zvprt50\\Zan Image Printer(bw)");
Dim strPath As String
'Use Environment.SpecialFolder.CommonApplicationData instead if
'all users share the same settings
'strPath = Environment.GetFolderPath
'(Environment.SpecialFolder.CommonApplicationData)
strPath = Environment.GetFolderPath _
(Environment.SpecialFolder.ApplicationData)
If Not strPath.EndsWith("\") Then
strPath = String.Concat(strPath, "\")
End If
string strPath;
//Use Environment::SpecialFolder::CommonApplicationData instead if
//all users share the same settings
//strPath = Environment::GetFolderPath
//(Environment::SpecialFolder::CommonApplicationData);
strPath = Environment::GetFolderPath
(Environment::SpecialFolder::ApplicationData);
if(!strPath->EndsWith(L"\\")) strPath = String::Concat(strPath, L"\\");
strPath = String::Concat(strPath,
L"zvprt50\\Zan Image Printer(bw)\\save.ini");




| File Name | Description |
|---|---|
| save.ini | contains a set of rules for saving files and pop-up dialogs. |
| image.ini | contains options for image formats, color type, compression, and image quality. |
| general.ini | contains settings for the status dialog, sentinel file, and ZIP archiving. |
| docuname.ini | contains options to remove unwanted strings from document name. |
| advimage.ini | contains options for post generation image processing (trim, invert, crop, transpose, flip, rotate and scaling). |
| app.ini | contains settings for running another application after printing is finished. |
| text.ini | contains options for text extraction. |
| event.ini | contains options for event notification. |
| message.ini | contains options for message notification. |
| orientation.ini | contains options for rotating landscape pages. |
| email.ini | contains options for sending Email. |
| watermark.ini | contains options for adding watermarks. |
| printerredirection.ini | contains options for printer redirection. |
| ftp.ini | contains options for sending printed output to an FTP server. |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| save | folder | string | save.folder | Folder: specify where you want to save the output image files. You can insert macro commands to form the folder name dynamically |
| save | basefilename | string | save.basefilename | File Name: specify the file name for the image to be created. You can insert macro commands to form the file name dynamically |
| save | filenameindex | DWORD | save.filenameindex | Init File Number: specifies the initial count used in the File Number macro command |
| save | filexistact | DWORD or string | save.filexistact |
When File Exists: 0 (Show warning dialog) 1 (Auto pick a unique name to prevent collision) 2 (Always overwrite) Zan Image Printer also accepts an equivalent mnemonic string for the filexistact value as mnemonic strings are easier to remember: the following mnemonic strings are equivalent to 1 (Auto pick a unique name to prevent collision): auto unique auto pick the mnemonic string "overwrite" is equivalent to 2 (Always overwrite) all other strings will be converted to 0 (Show warning dialog) |
| save | popupdialog | DWORD or string | save.popupdialog |
Before Printing Starts Show the: 0 (Save As Dialog) 1 (Image Printer Dialog) 2 (No Dialogs) Zan Image Printer also accepts an equivalent mnemonic string for the popupdialog value: the following mnemonic strings are equivalent to 0 (Save As Dialog): save saveas the following mnemonic strings are equivalent to 1 (Image Printer Dialog): dialog image printer dialog the following mnemonic strings are equivalent to 2 (No Dialogs): none no dialog |
Option Explicit
Private Declare Function SHGetFolderPath Lib "shell32" _
Alias "SHGetFolderPathA" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, _
ByVal hToken As Long, ByVal dwFlags As Long, _
ByVal pszPath As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32.dll" _
Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Integer, ByVal lpFileName As String) As Integer
Private Declare Function WritePrivateProfileString Lib "kernel32.dll" _
Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal lpString As String, _
ByVal lpFileName As String) As Integer
Private Declare Function GetPrivateProfileInt Lib "kernel32.dll" _
Alias "GetPrivateProfileIntA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal nDefault As Integer, _
ByVal lpFileName As String) As Integer
'Used CSIDL values.
'For the full list, search MSDN for "CSIDL Values"
Private Const CSIDL_APPDATA As Long = &H1A
Private Const CSIDL_PROGRAM_FILES As Long = &H26
Private Const CSIDL_COMMON_APPDATA As Long = &H23
Private Const SHGFP_TYPE_CURRENT = 0
Private Const S_OK As Long = 0
Private Const MAX_PATH = 260
Private Function GetZanPrinterFolder(csidl As Long) As String
Dim sPath As String * MAX_PATH
Dim SpecialFolderPath As String
Dim lResult As Long
sPath = Space$(MAX_PATH)
lResult = SHGetFolderPath(0, _
csidl, _
0, _
SHGFP_TYPE_CURRENT, _
sPath)
SpecialFolderPath = Left$(sPath, _
InStr(sPath, vbNullChar) - 1)
GetZanPrinterFolder = SpecialFolderPath
End Function
Public Sub Main()
Dim IniFileFolder As String
Dim SaveFolder As String * MAX_PATH
Dim lngLength As Long
Dim PopupDlgInd As Integer
'get the save.ini file full path.
'Use CSIDL_COMMON_APPDATA instead if
'all users share the same settings
IniFileFolder = GetZanPrinterFolder(CSIDL_APPDATA)
If Right$(IniFileFolder, 1) <> "\" Then
IniFileFolder = IniFileFolder & "\"
End If
IniFileFolder=IniFileFolder & "zvprt50\Zan Image Printer(bw)\save.ini"
lngLength = GetPrivateProfileString("save", "folder", "", _
SaveFolder, MAX_PATH, IniFileFolder)
WritePrivateProfileString "save", "basefilename", _
"[%DocName]_[%Page]", IniFileFolder
PopupDlgInd = GetPrivateProfileInt("save", "popupdialog", _
0, IniFileFolder)
WritePrivateProfileString "save", "filexistact", "1", _
IniFileFolder
End Sub
uses
Windows, Messages, SysUtils, ShlObj, ShellAPI, SHFolder,
Graphics;
procedure GetZanPrinterFolder(var APath: String);
//save.ini read/write
procedure test_saveini();
implementation
//get the zan INI setting files folder
//for bw printer
procedure GetZanPrinterFolder(var APath: String);
begin
SetLength(APath, MAX_PATH);
FillChar(APath[1], MAX_PATH, 0);
//Use CSIDL_COMMON_APPDATA instead if
//all users share the same settings
SHGetFolderPath(0, CSIDL_APPDATA, 0, 0, PChar(APath));
APath := String (PChar (APath));
if (APath[Length(APath)] <> '\') then
begin
APath := APath + '\';
end;
APath := APath + 'zvprt50\Zan Image Printer(bw)\';
end;
//save.ini read/write
procedure test_saveini();
var
saveinifilepath: String;
SaveFolder: String;
PopupDlgInd: Integer;
begin
SetLength(SaveFolder, MAX_PATH);
GetZanPrinterFolder(saveinifilepath);
saveinifilepath := saveinifilepath + 'save.ini';
GetPrivateProfileString('save','folder','',
PChar(SaveFolder),MAX_PATH, PChar(saveinifilepath));
WritePrivateProfileString('save', 'basefilename',
'[%DocName]_[%Page]', PChar(saveinifilepath));
PopupDlgInd := GetPrivateProfileInt('save','popupdialog',
0, PChar(saveinifilepath));
WritePrivateProfileString('save', 'filexistact', '1',
PChar(saveinifilepath));
//use SaveFolder, PopupDlgInd below
end;
#include <shlobj.h>
char szAppData[MAX_PATH];
char szValue[MAX_PATH];
HRESULT hr;
DWORD dwPopupDlg;
//Use CSIDL_COMMON_APPDATA instead if
//all users share the same settings
hr = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szAppData);
if(szAppData[strlen(szAppData) - 1] != '\\')
{
strcat(szAppData, "\\");
}
strcat(szAppData, "zvprt50\\Zan Image Printer(bw)");
strcat(szAppData, "\\save.ini");
GetPrivateProfileString("save", "folder", "", szValue,
MAX_PATH, szAppData);
WritePrivateProfileString("save", "basefilename",
"[%DocName]_[%Page]", szAppData);
dwPopupDlg = GetPrivateProfileInt("save", "popupdialog",
0, szAppData);
WritePrivateProfileString("save", "filexistact", "1",
szAppData);
using namespace System;
using namespace System::Text;
using namespace System::Runtime::InteropServices;
// Declare the function that is exported from unmanaged dll:
[DllImport("KERNEL32.DLL")]
extern "C" int _cdecl GetPrivateProfileString(
String^ lpAppName,
String^ lpKeyName,
String^ lpDefault,
StringBuilder^ lpReturnedString,
int nSize,
String^ lpFileName);
[DllImport("KERNEL32.DLL")]
extern "C" bool _cdecl WritePrivateProfileString(
String^ lpAppName,
String^ lpKeyName,
String^ lpString,
String^ lpFileName);
[DllImport("KERNEL32.DLL")]
extern "C" int _cdecl GetPrivateProfileInt(
String^ lpAppName,
String^ lpKeyName,
int nDefault,
String^ lpFileName);
String^ strPath;
//Use Environment::SpecialFolder::CommonApplicationData instead if
//all users share the same settings
//strPath = Environment::GetFolderPath
//(Environment::SpecialFolder::CommonApplicationData);
strPath = Environment::GetFolderPath
(Environment::SpecialFolder::ApplicationData);
if(!strPath->EndsWith(L"\\")) strPath = String::Concat(strPath, L"\\");
strPath = String::Concat(strPath,
L"zvprt50\\Zan Image Printer(bw)\\save.ini");
String^ szValue;
StringBuilder^ tempstr = gcnew StringBuilder(256);
GetPrivateProfileString(L"save", L"folder", L"",
tempstr, tempstr->Capacity, strPath);
szValue = tempstr->ToString();
WritePrivateProfileString(L"save", L"basefilename",
L"[%DocName]_[%Page]", strPath);
int dwPopupDlg = GetPrivateProfileInt(L"save", L"popupdialog",
0, strPath);
WritePrivateProfileString(L"save", L"filexistact", L"1", strPath);
Imports System.Runtime.InteropServices
Imports System.Text
Imports System
Module Module1
Private Declare Function GetPrivateProfileString Lib "kernel32" _
Alias "GetPrivateProfileStringW" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As StringBuilder, _
ByVal nSize As Integer, _
ByVal lpFileName As String) As Integer
Private Declare Function GetPrivateProfileInt Lib "kernel32.dll" _
Alias "GetPrivateProfileIntA" _
(ByVal lpApplicationName _
As String, ByVal lpKeyName As String, ByVal nDefault As _
Integer, ByVal lpFileName As String) As Integer
Private Declare Function WritePrivateProfileString Lib "kernel32.dll" _
Alias "WritePrivateProfileStringA" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpString As String, _
ByVal lpFileName As String) As Boolean
Sub Main()
Dim strPath As String
'Use Environment.SpecialFolder.CommonApplicationData instead if
'all users share the same settings
'strPath = Environment.GetFolderPath
'(Environment.SpecialFolder.CommonApplicationData)
strPath = Environment.GetFolderPath _
(Environment.SpecialFolder.ApplicationData)
If Not strPath.EndsWith("\") Then
strPath = String.Concat(strPath, "\")
End If
strPath=String.Concat(strPath, "zvprt50\Zan Image Printer(bw)\save.ini")
Dim szValue As String
Dim tempstr As StringBuilder
tempstr = New StringBuilder(256)
GetPrivateProfileString("save", "folder", "", tempstr, _
tempstr.Capacity, strPath)
szValue = tempstr.ToString()
WritePrivateProfileString("save", "basefilename", _
"[%DocName]_[%Page]", strPath)
Dim PopupDlgInd As Integer
PopupDlgInd = GetPrivateProfileInt("save", "popupdialog", 0, strPath)
WritePrivateProfileString("save", "filexistact", "1", strPath)
End Sub
End Module
using System.Runtime.InteropServices;
class Program
{
static void Main(string[] args)
{
string strPath;
//Use Environment.SpecialFolder.CommonApplicationData instead if
//all users share the same settings
//strPath = Environment.GetFolderPath
//(Environment.SpecialFolder.CommonApplicationData);
strPath = Environment.GetFolderPath
(Environment.SpecialFolder.ApplicationData);
if (!strPath.EndsWith("\\")) strPath = String.Concat(strPath, "\\");
strPath=String.Concat(strPath,"zvprt50\\Zan Image Printer(bw)\\save.ini");
String szValue;
StringBuilder tempstr = new StringBuilder(256);
GetPrivateProfileString("save", "folder", "",
tempstr, tempstr.Capacity, strPath);
szValue = tempstr.ToString();
WritePrivateProfileString("save", "basefilename",
"[%DocName]_[%Page]", strPath);
uint dwPopupDlg = GetPrivateProfileInt("save", "popupdialog",
0, strPath);
WritePrivateProfileString("save","filexistact","1",strPath);
}
[DllImport("kernel32.dll")]
static extern uint GetPrivateProfileString(string lpAppName,
string lpKeyName, string lpDefault,
StringBuilder lpReturnedString, int nSize, string lpFileName);
[DllImport("kernel32.dll")]
static extern bool WritePrivateProfileString(string lpAppName,
string lpKeyName,
string lpString, string lpFileName);
[DllImport("kernel32.dll")]
static extern uint GetPrivateProfileInt(string lpAppName,
string lpKeyName, int nDefault, string lpFileName);
}
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| image | fileformat | DWORD or string | image.fileformat |
Output Image File Format: 0 (BMP) 1 (TIFF) 2 (JPEG) 3 (PNG) 4 (PDF) 5 (GIF) 6 (JPEG 2000) Zan Image Printer also accepts an equivalent mnemonic string for the fileformat value as mnemonic strings are easier to remember: the following mnemonic strings are equivalent to 0 (BMP): bmp bitmap the following mnemonic strings are equivalent to 1 (TIFF): tif tiff the following mnemonic strings are equivalent to 2 (JPEG): jpg jpeg the mnemonic string "png" is equivalent to 3 (PNG) the mnemonic string "pdf" is equivalent to 4 (PDF) the mnemonic string "gif" is equivalent to 5 (gif) the following mnemonic strings are equivalent to 6 (JPEG 2000): jp2 jpeg 2000 |
| image | imagecolor | DWORD or string | image.imagecolor |
Color: 0 (Monochrome) 1 or 256 (256) 2 (Grayscale) 3 or 24 (True Color) Zan Image Printer also accepts an equivalent mnemonic string for the imagecolor value: the following mnemonic strings are equivalent to 0 (Monochrome): bw monochrome the following mnemonic strings are equivalent to 2 (Grayscale): gray grayscale gray scale the following mnemonic strings are equivalent to 3 (True Color): true color truecolor true 24 bit 24bit 24-bit |
| image | compression | DWORD or string | image.compression |
Compression: 0 (None) 1 (CCITT G3) 2 (CCITT G4) 3 (Packbits) 4 (Deflate/Zip) 5 (JPEG) 6 (LZW) 20 (RLE8) Zan Image Printer also accepts an equivalent mnemonic string for the compression value: the mnemonic string "none" is converted to 0 (None) the following mnemonic strings are equivalent to 1 (CCITT G3): g3 group 3 group3 the following mnemonic strings are equivalent to 2 (CCITT G4): g4 group 4 group4 the following mnemonic strings are equivalent to 3 (Packbits): packbits packbit the following mnemonic strings are equivalent to 4 (Deflate/Zip): deflate zip the following mnemonic strings are equivalent to 5 (JPEG): jpeg jpg the mnemonic string "lzw" is converted to 6 (LZW) the mnemonic string "rle" is converted to 20 (RLE8) |
| image | pagetype | DWORD or string | image.pagetype |
File Mode(valid only for TIFF/PDF files): 0 (One multi-page) 1 (Serialized) 2 (Append to existing file) Zan Image Printer also accepts an equivalent mnemonic string for the pagetype value: the following mnemonic strings are equivalent to 0 (One multi-page): one one multi page one multi-page single the following mnemonic strings are equivalent to 1 (Serialized): serialized multiple the following mnemonic strings are equivalent to 2 (Append to existing file): appending append |
| image | pdftextlayer | DWORD | image.pdftextlayer |
Create PDF in image + searchable text format (valid only for PDF files): 0 (no) 1 (yes) |
| image | rowsperstrip | DWORD or string | image.rowsperstrip |
RowsPerStrip: 0 (Default) 1 (Each page as a single strip) 2 (One row per strip) Zan Image Printer also accepts an equivalent mnemonic string for the rowsperstrip value: the mnemonic string "default" is equivalent to 0 (Default) the mnemonic string "single" is equivalent to 1 (Each page as a single strip): All other strings are equivalent to 2 (One row per strip) |
| image | qfactor | DWORD | image.qfactor |
Valid only for TIFF/JPEG/PDF files: between 0 (worst quality) and 100 (best quality). |
| image | color2bwthreshold | DWORD | image.color2bwthreshold |
Normally, you save to monochrome image files in Black & White mode using the printer's default
halftoning algorithm. But in some cases, you can improve print quality by removing halftone screening
artifacts thus making images appear more natural:
First set Zan Image Printer into Color mode, and then save to a monochrome file. Doing this will cause Zan Image Printer to reduce the number of colors in the true color images to 2(black & white) by a changeable Color Reduction Threshold. In the conversion, each pixel in the image is compared with this threshold, if it is higher than the threshold, the pixel is set to white. If it is less than the threshold, it is set to black. The threshold range is from 0 to 255(default 200). |
| tiff-fax | fillorder | DWORD | tiff-fax.fillorder |
Reverse bit order(FillOrder): 1 (MSB-to-LSB) 2 (LSB-to-MSB) |
| tiff-fax | adjustwidth | DWORD | tiff-fax.adjustwidth |
Automatically adjust the image width to create a faxable TIFF: 0 (no) 1 (yes) |
| tiff-fax | adjustheight | DWORD | tiff-fax.adjustheight |
Adjust the image height to create a faxable TIFF: 0 (no) 1 (yes) |
| tiff-fax | lineheight | DWORD | tiff-fax.lineheight |
Specify the height in lines to create a faxable TIFF |
| tiff-fax | t4options | DWORD | tiff-fax.t4options |
CCITT Group 3 T4Options: 0 (1D MH) 1 (2D MR) 4 (1D MH, byte-aligned-EOLs) 5 (2D MR, byte-aligned-EOLs) |
| tiff-fax | pagenumber | DWORD | tiff-fax.pagenumber |
Add PageNumber Tag: 0 (no) 1 (yes) |
| tiff-fax | datetime | DWORD | tiff-fax.datetime |
Add DateTime Tag: 0 (no) 1 (yes) |
| tiff-fax | ifdfirst | DWORD | tiff-fax.ifdfirst |
Place Image File Directory (IFD) in front of image data: 0 (no) 1 (yes) |
| tiff-fax | software | string | tiff-fax.software |
Software Tag: The name of the software that created the image. If this field is left blank, no software tag will be added. |
Option Explicit
Private Declare Function SHGetFolderPath Lib "shell32" _
Alias "SHGetFolderPathA" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, _
ByVal hToken As Long, ByVal dwFlags As Long, _
ByVal pszPath As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32.dll" _
Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Integer, ByVal lpFileName As String) As Integer
Private Declare Function WritePrivateProfileString Lib "kernel32.dll" _
Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal lpString As String, _
ByVal lpFileName As String) As Integer
Private Declare Function GetPrivateProfileInt Lib "kernel32.dll" _
Alias "GetPrivateProfileIntA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal nDefault As Integer, _
ByVal lpFileName As String) As Integer
'Used CSIDL values.
'For the full list, search MSDN for "CSIDL Values"
Private Const CSIDL_APPDATA As Long = &H1A
Private Const CSIDL_PROGRAM_FILES As Long = &H26
Private Const CSIDL_COMMON_APPDATA As Long = &H23
Private Const SHGFP_TYPE_CURRENT = 0
Private Const S_OK As Long = 0
Private Const MAX_PATH = 260
Private Function GetZanPrinterFolder(csidl As Long) As String
Dim sPath As String * MAX_PATH
Dim SpecialFolderPath As String
Dim lResult As Long
sPath = Space$(MAX_PATH)
lResult = SHGetFolderPath(0, _
csidl, _
0, _
SHGFP_TYPE_CURRENT, _
sPath)
SpecialFolderPath = Left$(sPath, _
InStr(sPath, vbNullChar) - 1)
GetZanPrinterFolder = SpecialFolderPath
End Function
Public Sub Main()
Dim IniFileFolder As String
Dim Compress As Integer
'get the image.ini file full path.
'Use CSIDL_COMMON_APPDATA instead if
'all users share the same settings
IniFileFolder = GetZanPrinterFolder(CSIDL_APPDATA)
If Right$(IniFileFolder, 1) <> "\" Then
IniFileFolder = IniFileFolder & "\"
End If
IniFileFolder=IniFileFolder & "zvprt50\Zan Image Printer(bw)\image.ini"
WritePrivateProfileString "image", "fileformat", "2", IniFileFolder
WritePrivateProfileString "image", "imagecolor", "3", IniFileFolder
Compress = GetPrivateProfileInt("image", "compression", _
0, IniFileFolder)
End Sub
uses
Windows, Messages, SysUtils, ShlObj, ShellAPI, SHFolder,
Graphics;
procedure GetZanPrinterFolder(var APath: String);
//image.ini read/write
procedure test_imageini();
implementation
//get the zan INI setting files folder
//for bw printer
procedure GetZanPrinterFolder(var APath: String);
begin
SetLength(APath, MAX_PATH);
FillChar(APath[1], MAX_PATH, 0);
//Use CSIDL_COMMON_APPDATA instead if
//all users share the same settings
SHGetFolderPath(0, CSIDL_APPDATA, 0, 0, PChar(APath));
APath := String (PChar (APath));
if (APath[Length(APath)] <> '\') then
begin
APath := APath + '\';
end;
APath := APath + 'zvprt50\Zan Image Printer(bw)\';
end;
//image.ini read/write
procedure test_imageini();
var
imginifilepath: String;
dwCompress: Integer;
begin
GetZanPrinterFolder(imginifilepath);
imginifilepath := imginifilepath + 'image.ini';
WritePrivateProfileString('image', 'fileformat',
'2', PChar(imginifilepath));
WritePrivateProfileString('image', 'imagecolor',
'3', PChar(imginifilepath));
dwCompress := GetPrivateProfileInt('image','compression',
0, PChar(imginifilepath));
//use dwCompress below
end;
#include <shlobj.h>
char szAppData[MAX_PATH];
HRESULT hr;
DWORD dwCompress;
//Use CSIDL_COMMON_APPDATA instead if
//all users share the same settings
hr = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szAppData);
if(szAppData[strlen(szAppData) - 1] != '\\')
{
strcat(szAppData, "\\");
}
strcat(szAppData, "zvprt50\\Zan Image Printer(bw)");
strcat(szAppData, "\\image.ini");
WritePrivateProfileString("image", "fileformat", "2", szAppData);
WritePrivateProfileString("image", "imagecolor", "3", szAppData);
dwCompress= GetPrivateProfileInt("image", "compression", 0, szAppData);
using namespace System;
using namespace System::Text;
using namespace System::Runtime::InteropServices;
//Declare the function that is exported from unmanaged dll:
[DllImport("KERNEL32.DLL")]
extern "C" int _cdecl GetPrivateProfileString(
String^ lpAppName,
String^ lpKeyName,
String^ lpDefault,
StringBuilder^ lpReturnedString,
int nSize,
String^ lpFileName);
[DllImport("KERNEL32.DLL")]
extern "C" bool _cdecl WritePrivateProfileString(
String^ lpAppName,
String^ lpKeyName,
String^ lpString,
String^ lpFileName);
[DllImport("KERNEL32.DLL")]
extern "C" int _cdecl GetPrivateProfileInt(
String^ lpAppName,
String^ lpKeyName,
int nDefault,
String^ lpFileName);
String^ strPath;
//Use Environment::SpecialFolder::CommonApplicationData instead if
//all users share the same settings
//strPath = Environment::GetFolderPath
//(Environment::SpecialFolder::CommonApplicationData);
strPath = Environment::GetFolderPath
(Environment::SpecialFolder::ApplicationData);
if(!strPath->EndsWith(L"\\")) strPath = String::Concat(strPath, L"\\");
strPath=String::Concat(strPath,L"zvprt50\\Zan Image Printer(bw)\\image.ini");
WritePrivateProfileString(L"image", L"fileformat", L"2", strPath);
WritePrivateProfileString(L"image", L"imagecolor", L"3", strPath);
int dwCompress = GetPrivateProfileInt(L"image", L"compression",
0, strPath);
Imports System.Runtime.InteropServices
Imports System.Text
Imports System
Module Module1
Private Declare Function GetPrivateProfileInt Lib "kernel32.dll" _
Alias "GetPrivateProfileIntA" _
(ByVal lpApplicationName _
As String, ByVal lpKeyName As String, ByVal nDefault As _
Integer, ByVal lpFileName As String) As Integer
Private Declare Function WritePrivateProfileString Lib "kernel32.dll" _
Alias "WritePrivateProfileStringA" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpString As String, _
ByVal lpFileName As String) As Boolean
Sub Main()
Dim strPath As String
'Use Environment.SpecialFolder.CommonApplicationData instead if
'all users share the same settings
'strPath = Environment.GetFolderPath
'(Environment.SpecialFolder.CommonApplicationData)
strPath = Environment.GetFolderPath _
(Environment.SpecialFolder.ApplicationData)
If Not strPath.EndsWith("\") Then
strPath = String.Concat(strPath, "\")
End If
strPath = String.Concat(strPath, _
"zvprt50\Zan Image Printer(bw)\image.ini")
Dim dwCompress As Integer
WritePrivateProfileString("image", "fileformat", "2", strPath)
WritePrivateProfileString("image", "imagecolor", "3", strPath)
dwCompress = GetPrivateProfileInt("image", "compression", _
0, strPath)
End Sub
End Module
using System.Runtime.InteropServices;
class Program
{
static void Main(string[] args)
{
string strPath;
//Use Environment.SpecialFolder.CommonApplicationData instead if
//all users share the same settings
//strPath = Environment.GetFolderPath
//(Environment.SpecialFolder.CommonApplicationData);
strPath = Environment.GetFolderPath
(Environment.SpecialFolder.ApplicationData);
if (!strPath.EndsWith("\\")) strPath = String.Concat(strPath, "\\");
strPath = String.Concat(strPath,
"zvprt50\\Zan Image Printer(bw)\\image.ini");
WritePrivateProfileString("image", "fileformat", "2", strPath);
WritePrivateProfileString("image", "imagecolor", "3", strPath);
uint dwCompress = GetPrivateProfileInt("image",
"compression", 0, strPath);
}
[DllImport("kernel32.dll")]
static extern bool WritePrivateProfileString(string lpAppName,
string lpKeyName,
string lpString,
string lpFileName);
[DllImport("kernel32.dll")]
static extern uint GetPrivateProfileInt(string lpAppName,
string lpKeyName,
int nDefault, string lpFileName);
}
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| general | hidestsdialog | DWORD | general.hidestsdialog |
Hide Status Dialog: 0 (no) 1 (yes) |
| general | hideui | string | general.hideui | comma(,) delimited list of hideui options. Controls
which property pages are hidden to the end user: save (hide the Save tab page) image (hide the Image tab page) settings (hide the Settings tab page) proginfo (hide the Program Information button on the About/Registration page) If this parameter is blank, all of the property pages are visible. Set hideui to following to hide the Save/Image/Settings tab pages and the Program Information button altogether: save, image, settings, proginfo |
| general | opacity | DWORD | general.opacity |
Status dialog opacity: 30-100 30: partially transparent 100: totally opaque |
| general | stsdialogpos | DWORD | general.stsdialogpos | Status dialog position: 0 (Top Left) 1 (Top) 2 (Top Right) 3 (Left) 4 (Center) 5 (Right) 6 (Bottom Left) 7 (Bottom) 8 (Bottom Right) x,y (custom position x, y in pixel coordinates relative to the top-left corner of the screen) |
| general | tipdlg | DWORD | general.tipdlg |
Show the tips dialog before each print job: 0 (no) 1 (yes) |
| general | sentinel | DWORD | general.sentinel |
Generate a sentinel file after printing finishes: 0 (no) 1 (yes) |
| general | sentinelfile | string | general.sentinelfile | Sentinel filename(can include macros) |
| general | sentinel template is saved in a separate file sentineltemplate.txt | string | general.sentineltemplate | Sentinel template |
| general | startdocfilename | DWORD | general.startdocfilename |
Enable/Disable controlling the output folder/file name via the StartDoc Win32 API: 0 (disable) 1 (enable) |
| general | zvprtsrvresident | DWORD | general.zvprtsrvresident |
Keep zvprtsrv.exe in memory(stay resident) until Windows is rebooted: 0 (no) 1 (yes) If 0, zvprtsrv.exe will exit after 25 seconds of inactivity. |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| docuname | removepath | DWORD | docuname.removepath |
Remove path information from document name: 0 (no) 1 (yes) |
| docuname | removestrings | DWORD | docuname.removestrings |
Remove unwanted strings from document name: 0 (no) 1 (yes) |
| docuname | unwantedstrings | string | docuname.unwantedstrings | Unwanted strings that you want removed from the document name |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| invert | enable | DWORD | invert.enable |
Enable inverting: 0 (no) 1 (yes) |
| trim | enable | DWORD | trim.enable |
Enable border trimming: 0 (no) 1 (yes) |
| trim | left | DWORD | trim.left |
Enable left border trimming: 0 (no) 1 (yes) |
| trim | right | DWORD | trim.right |
Enable right border trimming: 0 (no) 1 (yes) |
| trim | top | DWORD | trim.top |
Enable top border trimming: 0 (no) 1 (yes) |
| trim | bottom | DWORD | trim.bottom |
Enable bottom border trimming: 0 (no) 1 (yes) |
| crop | enable | DWORD | crop.enable |
Enable cropping: 0 (no) 1 (yes) |
| crop | originx | DWORD | crop.originx | Origin for the top left corner of the crop rectangle in pixels |
| crop | originy | DWORD | crop.originy | Origin for the top left corner of the crop rectangle in pixels |
| crop | dimx | DWORD | crop.dimx | Width of the crop rectangle in pixels |
| crop | dimy | DWORD | crop.dimy | Height of the crop rectangle in pixels |
| scale | enable | DWORD | scaling.enable |
Enable scaling: 0 (no) 1 (yes) |
| scale | type | DWORD | scaling.type |
Scaling type: 0: scale the image to the specified pixel size 1: reduce the image by specifying the horizontal and vertical scaling factors |
| scale | horizontal | numeric string | scaling.horizontal |
If the scaling type is 0, this specifies the width in pixels of the desired image. If the scaling type is 1, this specifies the horizontal scaling factor(1.0-3.0) |
| scale | vertical | numeric string | scaling.vertical |
If the scaling type is 0, this specifies the height in pixels of the desired image. If the scaling type is 1, this specifies the vertical scaling factor(1.0-3.0) |
| rotate | enable | DWORD | rotate.enable | Enable rotation: 0 (no) 1 (yes) |
| rotate | angle | DWORD | rotate.angle | Sets the rotation angle(clockwise): 0: no rotation 90 180 270 |
| flip | enable | DWORD | flip.enable | Enable flipping: 0 (no) 1 (yes) |
| flip | type | DWORD | flip.type |
0: mirror the image horizontally(left-right) 1: mirror the image vertically(top-bottom) |
| transpose | enable | DWORD | transpose.enable | Transpose the image: 0 (no) 1 (yes) |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| application | enableapp | DWORD | app.enableapp |
Run application after printing finishes: 0 (no) 1 (yes) |
| application | name | string | app.name |
User specified application(s). Zan Image Printer supports two built-in commands: deletefile - deletes the specified file: deletefile filename ShellExecute - performs an operation on a specified file: ShellExecute Operation, filename |
| application | parameters | string | app.parameters | Command line parameters passed to the specified application |
| application | waitappcompletion | DWORD | app.waitappcompletion |
Wait for completion: 0 (no) 1 (yes) |
| application | apptimeoutinterval | DWORD | app.apptimeoutinterval |
Timeout intervals in seconds(0-3600) If the timeout interval is any value between 1 and 3600, the print job will return if the interval elapses, even if the launched application doesn't exit. if the Timeout is 0, the timeout interval never elapses so the print job will keep waiting until the launched application exits. |
| application | openfolder | DWORD | app.openfolder |
Open the save folder after printing finishes: 0 (no) 1 (yes) |
| application | rundefaultapp | DWORD | app.rundefaultapp |
Launch the default viewer for the generated image: 0 (no) 1 (yes) |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| text | enabletextout | DWORD | text.enabletextout |
Extract text to file: 0 (no) 1 (yes) |
| text | suppressimage | DWORD | text.suppressimage |
Suppress the creation of image files: 0 (no) 1 (yes) |
| text | file | string | text.file | Output text file name(optional) |
| text | format | DWORD | text.format |
Format: 0 (Plain text) 1 (Formatted text) |
| text | appending | DWORD | text.appending |
Append text to existing file: 0 (no) 1 (yes) |
| text | prefixbom | DWORD | text.prefixbom |
Write Prefix Byte-Order Mask(BOM) to file: 0 (no) 1 (yes) |
| text | encoding | DWORD | text.encoding |
File encoding: 0 (ANSI) 1 (Unicode) 2 (Unicode big endian) 3 (UFT-8) |
| text | linebreaks | DWORD | text.linebreaks |
Insert line breaks: 0 (Windows CR LF) 1 (Unix LF) 2 (None) |
| text | formfeed | DWORD | text.formfeed |
Formfeed after every page: 0 (no) 1 (yes) |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| event | enable | DWORD | event.enable | Enable/disable event notification: 0 (disable) 1 (enable) |
| event | startdoc | string | event.startdoc | Signals the start of printing. Leave blank to not receive a notification |
| event | enddoc | string | event.enddoc | Signals the completion of the print job. Leave blank to not receive a notification |
| event | startpage | string | event.startpage | Signals the start of a page. Leave blank to not receive a notification |
| event | endpage | string | event.endpage | Signals when printing the page is complete. Leave blank to not receive a notification |
| event | cancelprint | string | event.cancelprint | Signal this event in your application to tell Zan Image Printer to cancel current printing |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| message | enable | DWORD | message.enable | Enable/disable message notification: 0 (disable) 1 (enable) |
| message | apptitle | string | message.apptitle | Specifies the application window's title(or name) that the message will be sent to. If this parameter is blank, all window names match and the message(a.k.a. broadcast message) will be sent to every top-level window. Minimize the use of broadcast messages whenever possible, as these are very heavy on system resources and may crash certain applications. |
| message | msgtype | DWORD | message.msgtype | Specifies the message type: 0 (a registered window message) 1 (WM_COPYDATA message) |
| message | msgname | string | message.msgname | registered window message name. |
| message | msgpost | DWORD | message.msgpost | Specifies how to send the message to a window: 0: SendMessage(waits for acknowledgement) 1: PostMessage(without waiting) |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| landscape | enable | DWORD | landscape.autorotate | Auto rotate landscape images:
0 (no) 1 (yes) |
| landscape | angle | DWORD | landscape.angle | Sets the rotation angle(clockwise): 90 270 |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| enable | DWORD | email.enable |
Enable Email: 0 (no) 1 (yes) |
|
| method | DWORD | email.method |
Method: 0: Use DNS MX lookup to find Email server 1: Send through MAPI compliant client 2: Send through SMTP server |
|
| Email body is saved in a separate file emailbody.txt | string | email.body | Email body | |
| port | DWORD | email.port | Specifies the SMTP server port number to use | |
| from | string | email.from | Specifies Sender(From) Email address | |
| to | string | email.to | Destination Email address or list of addresses separated with semicolons(;).
If the [%email] macro is specified as the email address, Zan Image Printer will
search the document being printed for an email address, extract it from the text,
and then automatically send the email to that address. |
|
| cc | string | email.cc | Carbon Copy e-mail address or a list of addresses separated with semicolons(;) | |
| displayname | string | email.displayname | The name that is sent to whoever is receiving Email from you to tell them who it's from | |
| servername | string | email.servername | Specifies the SMTP server IP address or name | |
| username | string | email.username | SMTP authentication account(user) name | |
| password | string | email.password | Password for SMTP authentication or MAPI profile.
The password is first encrypted then base64 encoded before saving. |
|
| profile | string | email.profile | Specifies a profile that a MAPI compliant client uses to remember the Email accounts and settings | |
| priority | DWORD | email.priority | Indicate the priority/importance of the Email message: 0: None 1: Low 2: Normal 3: High |
|
| ssl | DWORD | email.ssl | SMTP over SSL: 0 (no) 1 (yes) |
|
| auth | DWORD | email.auth | Authentication Method: 0: None 1: CRAM MD5 2: AUTH LOGIN 3: AUTH PLAIN 4: NTLM 5: Auto Detect |
|
| encoding | DWORD | email.encoding | Encoding for the Email message(headers and body): 0: Arabic (Windows) 1: Baltic (Windows) 2: Central European (ISO) 3: Central European (Windows) 4: Chinese Simplified (GB2312) 5: Chinese Simplified (HZ) 6: Chinese Traditional (Big5) 7: Cyrilic (KOI8-R) 8: Cyrillic (Windows) 9: Greek (Windows) 10: Hebrew (Windows) 11: Japanese (JIS) 12: Korean 13: Korean (EUC) 14: Latin 9 (ISO) 15: Thai (Windows) 16: Turkish (Windows) 17: Unicode (UTF-7) 18: Unicode (UTF-8) 19: Vietnamese (Windows) 20: Turkish (Windows) 21: Western European (ISO) 22: Western European (Windows) |
|
| subject | string | email.subject | The subject of the Email. You can insert save macro commands and file name macro commands to form the subject. | |
| zip | DWORD | email.zip | Create ZIP archive to send Email attachments: 0 (no) 1 (yes) |
|
| maxsize | DWORD | email.maxsize | Maximum attachment size in MB(0-10) | |
| deletefiles | DWORD | email.deletefiles | Delete the original images after the Email is sent: 0 (no) 1 (yes) |
|
| sharedsession | DWORD | email.sharedsession | Use the existing shared session: 0 (no) 1 (yes) |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| watermark | enable | DWORD | watermark.enable | Enable Watermark function: 0 (no) 1 (yes) |
| watermark | batesnumber | DWORD | watermark.batesnumber | Start bates numbering at: specifies the initial number
used in the Bates Number macro command |
| watermark_N | enable | DWORD | watermark.watermark_N.enable | Enable this watermark item: 0 (no) 1 (yes) |
| watermark_N | displayname | string | watermark.watermark_N.displayname | The display name to identify the watermark item in the list. Note: Zan Image Printer will ignore this watermark entry if you leave the displayname empty |
| watermark_N | type | DWORD | watermark.watermark_N.type | Watermark type: 0: Text 1: BMP |
| watermark_N | watermark | string | watermark.watermark_N.watermark | If the type is BMP, this specifies the full path to the BMP file that you want to appear as watermark If the type is Text, this specifies the text string you want to appear as watermark. To use multi-line text, separate each line with the linefeed character \n. |
| watermark_N | drawtextformat | string | watermark.watermark_N.drawtextformat | Alignment of multi-line text (separated by linefeed character '\n'), valid only for multiple line text watermark: DT_LEFT: Aligns text to the left DT_RIGHT: Aligns text to the right DT_CENTER: Centers text horizontally in the rectangle |
| watermark_N | pagerange | string | watermark.watermark_N.pagerange | To specify the page range, enter the beginning and ending page numbers(for example, 1,2,5-10, 20-end) or specify
a predefined option for applying the watermark: First Page All Pages odd Pages Even Pages |
| watermark_N | font | string | watermark.watermark_N.font | The font used for the text annotation |
| watermark_N | size | DWORD | watermark.watermark_N.size | Font size in points for the text annotation |
| watermark_N | opacity | DWORD | watermark.watermark_N.opacity | Watermark opacity percentage(0-100). 100 makes the watermark opaque, 0 makes the watermark completely transparent |
| watermark_N | position | DWORD | watermark.watermark_N.position | Use this to specify the position of the watermark: 0 (Offset in pixels) 1 (Offset in percentage) 2 (Top Left) 3 (Top) 4 (Top Right) 5 (Left) 6 (Center) 7 (Right) 8 (Bottom Left) 9 (Bottom) 10 (Bottom Right) |
| watermark_N | style | string | watermark.watermark_N.style | A list of font styles or BMP tiling options separated with commas(,) Font style: bold italic underline strikeout BMP tiling style: tile: the BMP graphic is repeated both horizontally and vertically tile-x: the BMP graphic is repeated horizontally tile-y: the BMP graphic is repeated vertically stretchedtowidth: stretched to fit the page width stretchedtoheight: stretched to fit the page height stretchedtofit: stretch the BMP graphic across the entire page writethru: don't use transparent color |
| watermark_N | color | string | watermark.watermark_N.color | Text color or BMP watermark transparent color auto: Auto detect transparent color r g b: enter colors as RGB values separated by spaces like: 255 12 3 |
| watermark_N | offsetx | DWORD | watermark.watermark_N.offsetx | Horizontal offset(in pixels or percentage) of the watermark relative to the left side of the image |
| watermark_N | offsety | DWORD | watermark.watermark_N.offsety | Vertical offset(in pixels or percentage) of the watermark relative to the top side of the image |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| printerredirection | enable | DWORD | printerredirection.enable | Enable printer redirection: 0 (no) 1 (yes) |
| printerredirection | copies | DWORD | printerredirection.copies | Set the number of copies to print, from 1 to 50 |
| printerredirection | fit | DWORD | printerredirection.fit | Fit to page: 0 (no) 1 (yes) |
| printer_N | enable | DWORD | printerredirection.printer_N.enable | Enable redirection for this printer |
| printer_N | name | string | printerredirection.printer_N.name | Printer name |
| printer_N | tray | string | printerredirection.printer_N.tray | Printer tray selector, in the format of first page tray name;first page range;other page tray name. For example:
letterhead;First Page;letter |
| AppName | KeyName | Value Type | Command Line Utility KeyName | Description |
|---|---|---|---|---|
| ftp | url | string | ftp.url | The name of the FTP server/host (e.g. ftp.mycompany.com or an IP address such as 192.168.10.2)
and optionally the name of the upload folder (can include the save macro commands) where the files should be placed.
Example: ftp.mycompany.com/docs/[%Date] You do not need to include the ftp:// prefix, you can type \ instead of / in any URL and Zan Image Printer will substitute /. If the upload folder is left blank, the files will be stored in the default home folder for the ftp user. |
| ftp | username | string | ftp.username | FTP user (account) name |
| ftp | password | string | ftp.password | Password associated with the user name. The password is first encrypted then base64 encoded before saving |
| ftp | enable | DWORD | ftp.enable | Determines whether you want to enable the FTP feature |
| ftp | passive | DWORD | ftp.passive | Passive FTP (also referred to as PASV FTP) is a more secure form of data transfer in which the flow of data is initiated by the FTP client rather than by the FTP server. Check this option if your computer is behind a firewall. We recommend that you use passive (PASV) mode for most transfers. |
| ftp | port | DWORD | ftp.port | Specifies the port that should be used to connect to the FTP server. The default is 21. |
C:\Program Files\zvprt50>zvprtcfg Syntax: zvprtcfg printer keyword=value [-silent] Or: zvprtcfg -help Or: zvprtcfg -examples Or: zvprtcfg printer -show Or: zvprtcfg printer -setdefault Or: zvprtcfg -listprinters Where: printer: printer name. if no printer is specified, the most recently used printer name will be used. silent: do not print out any message on screen show: show the current parameters(keyword-value pairs) for the specified printer examples: show usage examples listprinters: show all installed printer instances setdefault: set the specified printer as the default printer
Option Explicit
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Declare Function CreateProcess Lib "kernel32" _
Alias "CreateProcessA" _
(ByVal lpApplicationName As String, _
ByVal lpCommandLine As String, _
lpProcessAttributes As Any, _
lpThreadAttributes As Any, _
ByVal bInheritHandles As Long, _
ByVal dwCreationFlags As Long, _
lpEnvironment As Any, _
ByVal lpCurrentDriectory As String, _
lpStartupInfo As STARTUPINFO, _
lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long
Private Declare Function SHGetFolderPath Lib "shell32" _
Alias "SHGetFolderPathA" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, _
ByVal hToken As Long, ByVal dwFlags As Long, _
ByVal pszPath As String) As Long
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const ERROR_SUCCESS = 0
Private Const STANDARD_RIGHTS_READ As Long = &H20000
Private Const KEY_QUERY_VALUE As Long = &H1
Private Const KEY_ENUMERATE_SUB_KEYS As Long = &H8
Private Const KEY_NOTIFY As Long = &H10
Private Const SYNCHRONIZE As Long = &H100000
Private Const KEY_READ As Long = ((STANDARD_RIGHTS_READ Or _
KEY_QUERY_VALUE Or _
KEY_ENUMERATE_SUB_KEYS Or _
KEY_NOTIFY) And _
(Not SYNCHRONIZE))
Private Declare Function RegCloseKey Lib "advapi32.dll" _
(ByVal hKey As Long) As Long
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
Alias "RegOpenKeyExA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, _
ByVal samDesired As Long, _
phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" _
Alias "RegQueryValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal lpReserved As Long, _
lpType As Long, lpData As Any, lpcbData As Long) As Long
'Used CSIDL values.
'For the full list, search MSDN for "CSIDL Values"
Private Const CSIDL_APPDATA As Long = &H1A
Private Const CSIDL_PROGRAM_FILES As Long = &H26
Private Const CSIDL_COMMON_APPDATA As Long = &H23
Private Const SHGFP_TYPE_CURRENT = 0
Private Const S_OK As Long = 0
Const NORMAL_PRIORITY_CLASS = &H20
Private Const MAX_PATH = 260
Function DirExists(ByVal DName As String) As Boolean
Dim sDummy As String
On Error Resume Next
If Right(DName, 1) <> "\" Then DName = DName & "\"
sDummy = Dir$(DName & "*.*", vbDirectory)
DirExists = Not (sDummy = "")
End Function
'Retrieve a file's path
Function GetFilePath(FileName As String) As String
Dim i As Long
For i = Len(FileName) To 1 Step -1
Select Case Mid$(FileName, i, 1)
Case ":"
GetFilePath = Left$(FileName, i)
Exit For
Case "\"
GetFilePath = Left$(FileName, i - 1)
Exit For
End Select
Next
End Function
'detect the zan image printer installation directory
Private Function GetZanInstallFolder() As String
Dim sPath As String
Dim szTmp As String * MAX_PATH
Dim lResult As Long
Dim hKey, dwSize As Long
szTmp = Space$(MAX_PATH)
dwSize = MAX_PATH
'uninstall entry
If RegOpenKeyEx(HKEY_LOCAL_MACHINE, _
"\Software\Microsoft\Windows\CurrentVersion\Uninstall\zvprt50" _
, 0&, KEY_READ, hKey) = ERROR_SUCCESS Then
If RegQueryValueEx(hKey, "UninstallString", _
0&, 0&, ByVal szTmp, dwSize) = ERROR_SUCCESS Then
sPath = Left$(szTmp, _
InStr(szTmp, vbNullChar) - 1)
sPath = GetFilePath(sPath)
If DirExists(sPath) Then
GetZanInstallFolder = sPath
Exit Function
End If
End If
End If
'Assume \Program Files\zvprt50 folder:
lResult = SHGetFolderPath(0, _
CSIDL_PROGRAM_FILES, _
0, _
SHGFP_TYPE_CURRENT, _
sPath)
szTmp = Left$(sPath, _
InStr(sPath, vbNullChar) - 1)
If Right$(szTmp, 1) <> "\" Then
szTmp = szTmp & "\"
End If
szTmp = szTmp & "zvprt50"
GetZanInstallFolder = szTmp
End Function
'run application with given parameters
Private Sub util_CreateProcess(command_line As String)
Dim pInfo As PROCESS_INFORMATION
Dim sInfo As STARTUPINFO
Dim sNull As String
Dim lSuccess As Long
Dim lRetValue As Long
sInfo.cb = Len(sInfo)
lSuccess = CreateProcess(sNull, _
command_line, _
ByVal 0&, _
ByVal 0&, _
1&, _
NORMAL_PRIORITY_CLASS, _
ByVal 0&, _
sNull, _
sInfo, _
pInfo)
lRetValue = CloseHandle(pInfo.hThread)
lRetValue = CloseHandle(pInfo.hProcess)
End Sub
Public Sub Main()
Dim cmdline As String
cmdline = GetZanInstallFolder()
If Right$(cmdline, 1) <> "\" Then
cmdline = cmdline & "\"
End If
cmdline = cmdline & _
"zvprtcfg_win32 Zan Image Printer(bw) save.folder=c:\temp"
util_CreateProcess cmdline
End Sub
uses
Windows, Messages, SysUtils, ShlObj,
ShellAPI, SHFolder, Registry;
procedure util_CreateProcess(ProgramName:String);
procedure GetZanInstallFolder(var APath: String);
procedure zvprtvfg_test();
implementation
//run application with given parameters
procedure util_CreateProcess(ProgramName:String);
var
StartInfo : TStartupInfo;
ProcInfo : TProcessInformation;
CreateOK : Boolean;
begin
FillChar(StartInfo,SizeOf(TStartupInfo),#0);
FillChar(ProcInfo,SizeOf(TProcessInformation),#0);
StartInfo.cb := SizeOf(TStartupInfo);
CreateOK := CreateProcess(nil,PChar(ProgramName),nil,nil,False,
CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORITY_CLASS,
nil, nil, StartInfo, ProcInfo);
if CreateOK then
begin
CloseHandle(ProcInfo.hProcess);
CloseHandle(ProcInfo.hThread);
end
end;
//detect the zan image printer installation directory
procedure GetZanInstallFolder(var APath: String);
var
hkeyStartup: HKEY;
dwSize: DWORD;
begin
dwSize := MAX_PATH;
SetLength(APath, MAX_PATH);
//uninstall entry
if RegOpenKeyEx(HKEY_LOCAL_MACHINE,
'\Software\Microsoft\Windows\CurrentVersion\Uninstall\zvprt50',
0,
KEY_READ,
hkeyStartup) = ERROR_SUCCESS then
begin
if RegQueryValueEx(hkeyStartup,
'UninstallString', nil, nil,
PBYTE(Pchar(APath)),
@dwSize) = ERROR_SUCCESS then
begin
APath := String (PChar(APath));
APath := ExtractFilePath(APath);
end;
//Close the Key, we won't be needing it anymore
RegCloseKey(hkeyStartup);
if DirectoryExists(APath) then Exit;
end;
//Assume \Program Files\zvprt50 folder:
SHGetFolderPath(0, CSIDL_PROGRAM_FILES, 0, 0,
PChar(APath));
APath := String (PChar (APath));
if (APath[Length(APath)] <> '\')
then APath := APath + '\';
APath := APath + 'zvprt50';
end;
procedure zvprtvfg_test();
var
szCmdLine: String;
begin
GetZanInstallFolder(szCmdLine);
if (szCmdLine[Length(szCmdLine)] <> '\')
then szCmdLine := szCmdLine + '\';
szCmdLine := szCmdLine +
'zvprtcfg_win32 Zan Image Printer(bw) save.folder=c:\temp';
util_CreateProcess(szCmdLine);
end;
#include <windows.h>
#include <winspool.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <shellapi.h>
#pragma comment(lib, "shlwapi.lib")
//check if folder exists
BOOL IsFolderExists(char *lpDirectoryName)
{
if(strlen(lpDirectoryName) == 0)
{
return FALSE;
}
DWORD dwFileAttr = GetFileAttributes(lpDirectoryName);
if((dwFileAttr != 0xFFFFFFFF) &&
(dwFileAttr & FILE_ATTRIBUTE_DIRECTORY))
{
return TRUE;
}
else
{
return FALSE;
}
}
//detect the zan image printer installation directory
void GetZanInstallFolder(char *installfolder)
{
/*first, search the registry uninstall key*/
HKEY hkeyStartup;
//uninstall entry
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\zvprt50",
0,
KEY_READ,
&hkeyStartup) == ERROR_SUCCESS)
{
DWORD dwSize = MAX_PATH;
if(RegQueryValueEx(hkeyStartup,
"UninstallString",
NULL,
NULL,
(LPBYTE)installfolder,
&dwSize) == ERROR_SUCCESS)
{
PathRemoveFileSpec(installfolder);
PathAddBackslash(installfolder);
}
/*Close the Key, we won't be needing it anymore*/
RegCloseKey(hkeyStartup);
if(IsFolderExists(installfolder))
{
return;
}
}
//Assume \Program Files\zvprt50 folder:
SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, 0, installfolder);
PathAddBackslash(installfolder);
strcat(installfolder,"zvprt50");
}
BOOL util_CreateProcess(char* command_line)
{
PROCESS_INFORMATION pInfo;
STARTUPINFO sInfo;
ZeroMemory(&sInfo, sizeof(STARTUPINFO));
sInfo.cb = sizeof(STARTUPINFO);
sInfo.lpReserved = NULL;
sInfo.lpReserved2 = NULL;
sInfo.cbReserved2 = 0;
sInfo.lpDesktop = NULL;
sInfo.lpTitle = NULL;
sInfo.dwFlags = 0;
sInfo.dwX = 0;
sInfo.dwY = 0;
sInfo.dwFillAttribute = 0;
sInfo.wShowWindow = SW_SHOW;
BOOL bret = CreateProcess(NULL, command_line, NULL, NULL,
FALSE, 0, NULL, NULL, &sInfo, &pInfo);
CloseHandle(pInfo.hProcess);
CloseHandle(pInfo.hThread);
return bret;
}
char szCmdLine[MAX_PATH];
GetZanInstallFolder(szCmdLine);
PathAddBackslash(szCmdLine);
strcat(szCmdLine,"zvprtcfg_win32 Zan Image Printer(bw) save.folder=c:\\temp");
util_CreateProcess(szCmdLine);
using namespace System;
using namespace Microsoft::Win32;
using namespace System::IO;
using namespace System::Diagnostics;
//detect the zan image printer installation directory
String^ GetZanInstallFolder(void)
{
String^ installfolder = String::Empty;
RegistryKey ^ rkTest;
//first, search the registry uninstall key:
rkTest = Registry::LocalMachine->OpenSubKey(
L"\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\zvprt50");
if(rkTest)
{
installfolder = rkTest->GetValue(L"UninstallString")->ToString();
rkTest->Close();
if(installfolder->Length)
{
installfolder = Path::GetDirectoryName(installfolder);
DirectoryInfo^ installdir1=gcnew DirectoryInfo(installfolder);
if(installdir1->Exists)
{
return installfolder;
}
}
}
//Assume \Program Files\zvprt50 folder:
installfolder = Environment::GetFolderPath
(Environment::SpecialFolder::ProgramFiles);
if(!installfolder->EndsWith(L"\\"))
installfolder = String::Concat(installfolder, L"\\");
installfolder=String::Concat(installfolder, L"zvprt50");
return installfolder;
}
String^ apppath;
apppath = GetZanInstallFolder();
if(!apppath->EndsWith(L"\\"))
apppath = String::Concat(apppath, L"\\");
apppath=String::Concat(apppath, L"zvprtcfg_win32");
Process::Start(apppath,
L" Zan Image Printer(bw) save.folder=c:\\temp");
Imports System
Imports Microsoft.Win32
Imports System.IO
Imports System.Diagnostics
Module Module1
'detect the zan image printer installation directory
Function GetZanInstallFolder() As String
Dim installfolder As String
Dim rkTest As RegistryKey
'first, search the registry uninstall key:
rkTest = Registry.LocalMachine.OpenSubKey _
("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\zvprt50")
If Not (rkTest Is Nothing) Then
installfolder = rkTest.GetValue _
("UninstallString").ToString()
rkTest.Close()
If (installfolder.Length > 0) Then
installfolder = Path.GetDirectoryName(installfolder)
Dim installdir1 As DirectoryInfo = _
New DirectoryInfo(installfolder)
If installdir1.Exists Then
Return installfolder
End If
End If
End If
'Assume \Program Files\zvprt50 folder:
installfolder = Environment.GetFolderPath _
(Environment.SpecialFolder.ProgramFiles)
If Not installfolder.EndsWith("\") Then
installfolder = String.Concat(installfolder, "\")
End If
installfolder = String.Concat(installfolder, "zvprt50")
Return installfolder
End Function
Sub Main()
Dim apppath As String
apppath = GetZanInstallFolder()
If Not apppath.EndsWith("\") Then
apppath = String.Concat(apppath, "\")
End If
apppath = String.Concat(apppath, "zvprtcfg_win32")
Process.Start(apppath, _
" Zan Image Printer(bw) save.folder=c:\temp")
End Sub
End Module
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Microsoft.Win32;
using System.IO;
class Program
{
//detect the zan image printer installation directory
static string GetZanInstallFolder()
{
string installfolder = string.Empty;
RegistryKey rkTest;
//first, search the registry uninstall key:
rkTest = Registry.LocalMachine.OpenSubKey(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\zvprt50");
if (rkTest != null)
{
installfolder = rkTest.GetValue("UninstallString").ToString();
rkTest.Close();
if(installfolder.Length > 0)
{
installfolder = Path.GetDirectoryName(installfolder);
DirectoryInfo installdir1=new DirectoryInfo(installfolder);
if (installdir1.Exists)
{
return installfolder;
}
}
}
//Assume \Program Files\zvprt50 folder:
installfolder = Environment.GetFolderPath
(Environment.SpecialFolder.ProgramFiles);
if (!installfolder.EndsWith("\\"))
installfolder = String.Concat(installfolder, "\\");
installfolder=String.Concat(installfolder,"zvprt50");
return installfolder;
}
static void Main(string[] args)
{
string apppath;
apppath = GetZanInstallFolder();
if (!apppath.EndsWith("\\"))
apppath = String.Concat(apppath, "\\");
apppath = String.Concat(apppath, "zvprtcfg_win32");
Process.Start(apppath,
" Zan Image Printer(bw) save.folder=c:\\temp");
}
}
| Command Line Utility KeyName | Value Type | Description |
|---|---|---|
| gpd.papersize | string |
Paper size or a list of paper sizes with commas(,) All: all paper sizes 9X11 10X11 10X14 11X17 12X11 15X11 A0 A1 A2 A3 A3_EXTRA A3_ROTATED A4 A4_EXTRA A4_PLUS A4_ROTATED A5 A5_EXTRA A5_ROTATED A6 A6_ROTATED B0(ISO) B0(JIS) B1(ISO) B1(JIS) B2(ISO) B2(JIS) B3(ISO) B3(JIS) B4 B4(JIS) B4_JIS_ROTATED B5(ISO) B5(JIS) B5_JIS_ROTATED B6(ISO) B6_JIS B6_JIS_ROTATED CSHEET DSHEET ESHEET ENV_9 ENV_10 ENV_11 ENV_12 ENV_14 ENV_DL ENV_C3 ENV_C4 ENV_C5 ENV_C6 ENV_C65 ENV_B4 ENV_B5 ENV_B6 ENV_ITALY ENV_MONARCH ENV_PERSONAL ENV_INVITE EXECUTIVE F sheet FOLIO FANFOLD_STD_GERMAN FANFOLD_LGL_GERMAN JAPANESE_POSTCARD DBL_JAPANESE_POSTCARD LEDGER LEGAL LEGAL_EXTRA LETTER LETTER_PLUS LETTER_EXTRA NOTE QUARTO Square(64x64) Square(128x128) Square(256x256) Square(512x512) A_PLUS B_PLUS STATEMENT TABLOID TABLOID_EXTRA FANFOLD_INVITE FANFOLD_US CUSTOMSIZE Default: all paper sizes except B5(ISO), EXECUTIVE, and FANFOLD_INVITE You can set the default paper size by following the list of allowable paper sizes with a colon and then the default paper size. |
| gpd.dpi | string | DPI resolution or a list of DPI resolutions with commas(,),
each printer can only be installed with resolutions from one group. default: 75 x 75, 100 x 100, 120 x 120, 150 x 150, 200 x 100, 200 x 200, 240 x 240, 300 x 300, 360 x 360, 400 x 400, 600 x 600 group1: 75 x 75, 100 x 100, 120 x 120, 150 x 150, 200 x 100, 200 x 200, 240 x 240, 300 x 300, 360 x 360, 400 x 400, 600 x 600, 720 x 720, 1200 x 1200, 2400 x 2400 group2: 204 x 98, 204 x 196 group3: 72 x 72, 96 x 96, 144 x 144, 288 x 144, 288 x 288 group4: 240 x 144, 240 x 288 If the horizontal and vertical resolutions are the same, you can enter a single number to specify the resolution, i.e. 300x300 can be abbreviated to 300. |
| gpd.orientation | string |
Orientation: Portrait Landscape |
| gpd.color | string | Color mode: bw color |
pDevMode=...
dmDeviceName="Zan Image Printer(bw)"
dmSpecVersion=0x0401
dmDriverVersion=0x0500
dmSize=220
dmDriverExtra=592
dmFields="orientation papersize copies defaultsource printquality
lor yresolution ttoption collate formname nup icmmethod icmintent dithertype"
dmOrientation=2
dmPaperSize=90
dmCopies=1
dmDefaultSource=15
dmPrintQuality=300
dmColor=2
dmYResolution=300
dmTTOption=2
dmCollate=1
dmFormName="12x11"
dmNup=1
dmICMMethod=1
dmICMIntent=2
dmDitherType=4294967295
...