Property | Type | Description |
Value | VARIANT (String Name) | (Read / Write) All the Miraplacid Publsher Properties. This is Default Property.
Meaning, it could be referred as obj("property_name") as well as obj.Value("property_name")
All the parameters are listed below. |
DocumentName | String | (Read Only) Original name of the printed document |
TotalPages | Number | (Read Only) total estimated amount of pages in current print job |
ReadyPages | Number | (Read Only) Amount of pages ready to process |
JobProperty | VARIANT (String Name) | (Read Only) Current job various properties. All the parameters are listed below. |
TotalJobs | Number | (Read Only) Number of printed documents spooled in Publisher and waiting for processing |
AutoSend | Number | (Read / Write) 0 - interactive mode; 1 - Process and Auto-send to the specified destinations |
Identity | Number | (Read / Write) Identity value to replace {{IDENTITY}} tag |
Format | String | (Read / Write) Selected Format Plug-in name |
FormatParam | VARIANT (String PluginName, String ParameterName) | (Read / Write) Format Plug-in Parameters
All the parameters for all plug-ins are listed below. |
FormatParamNoCheck | VARIANT(String PluginName, String ParameterName) | (Write Only) Format Plug-in Parameters. Use this option to set only appropriate property, without updating plug-in user interface and checking value. This option is useful when you need to set all options in a batch, and some options affect others. After all options are set, call FormatCheckSettings to update plug-in state correctly. |
FormatPluginNames | String Collection | (Read Only) List of installed format plug-ins (BMP, JPG and so on) |
Transport | String | (Read / Write) Selected Transport Plug-in names. If more than one transport plug-in selected, names shall be comma delimited. |
TransportParam | VARIANT(String PluginName, String ParameterName) | (Read / Write) Transport Plug-in Parameters
All the parameters for all plug-ins are listed below. |
TransportParamNoCheck | VARIANT(String PluginName, String ParameterName) | (Write Only) Transport Plug-in Parameters. Use this option to set only appropriate property, without updating plug-in user interface and checking value. This option is useful when you need to set all options in a batch, and some options affect others. After all options are set, call TransportCheckSettings to update plug-in state correctly. |
TransportPluginNames | String Collection | (Read Only) List of installed transport plug-ins (File, FTP and so on) |
Printer | String | (Read / Write) Name of the currently selected printer |
Printers | String Collection | (Read Only) List of all printers in Publisher collection. |
SystemPrinters | String Collection | (Read Only) List of all printers installed in the system. Useful for user interface, this property allows UI to avoid using spooler API. |
DefaultPrinter | String | (Read Only) Name of the default printer in the system. |
ValueNoRedraw (hidden) | VARIANT (String Name) | (Write Only) Does the same as Value except that ValueNoRedraw does not force image re-processing after changing value. To prevent processing overhead when you need to change several parameters at once, you may use ValueNoRedraw to set all parameters exacept the last, and Value for last parameter to let Core re-process the page once with cumulative changes. |
UILoaded (hidden) | Number | (Read / Write) 0 - UI not loaded; 1 - UI loaded. UI should set this value when it loaded and initialized and clear (set to 0) on unload. When you read from this property, it returns number of UIs loaded. |
UILoadedWithEvents (hidden) | Number | (Write only) 0 - UI not loaded; 1 - UI loaded. UI should set this value when it loaded and initialized and clear (set to 0) on unload. UI chould use this value if it needs to receive all necessary print job events (StartJob, StartPage, EndJob) even if it started in the middle of print job processing (see UI working scheme). |
Listeners (hidden) | Number | (Read only) Number of processes/modules subscribed to events. Publisher may work with several UIs and ordinary listeners. UIs, in difference of listeners, registers themselves using UILoaded. |
Method | Parameters | Description |
SendPage | Number | Send a particular page as an image through selected Transport Plug-Ins. Returns immediately. |
SendPageWait | Number | Send a particular page as an image through selected Transport Plug-Ins. Waits until all pages will be saved. |
SendAll | None | Send All through selected Transport Plug-Ins. Returns immediately. |
SendAllWait | None | Send All through selected Transport Plug-Ins. Waits until page will be saved. |
CancelJob | None | Cancel current Print Job. Returns immediately. |
CancelJobWait | None | Cancel current Print Job. Waits until current job will be cancelled and the new one will be opened, if any. |
CancelAllJobs | None | Cancel Publisher's internal print queue and spooler queue associated with Publisher |
SaveConfiguration | None | Save current configuration for active user and active printer |
SaveCommonConfiguration | None | Save current configuration for all users (who do not have own configurations yet) and active printer |
LoadUI | None | Loads user interface component if it is not already loaded. |
UnloadUI | None | Unloads user interface component, if it supports OnUnload event. |
GetEMFPage | Number index, String filename | Extracts a page referred by index from current job and saves it as a file "filename" in EMF format. Caller is responsible for deleting this file. Special tags supported. |
SetEMFPage | Number index, String filename | Assigns a file "filename" to be a content of page referred by index. File must be in EMF format. Caller is responsible for deleting this file. File must not be deleted before the job is saved. If EMF image dimensions from external file are different from those used in other pages in print job, multipage saving will not work. To set page back to original content from print job spool file, set filename to empty string or NULL value. Special tags supported. |
Stop | None | Unloads plug-ins, get ready for unloading from memory. System will unload Miraplacid Publisher core form memory with 2-5 seconds delay. We recommend you to add this method call at the end of each script. |
FormatCheckSettings | String plug-in | Call this method after updating several plug-in settings in a batch (using FormatParamNoCheck). Some settings may affect others, and this method guarantees that they will be updated in correct order. |
TransportCheckSettings | String plug-in | Call this method after updating several plug-in settings in a batch (using TransportParamNoCheck). Some settings may affect others, and this method guarantees that they will be updated in correct order. |
PreparePage (hidden) | Number | UI should call this method to force Core prepare page (load, make processing according current settings) for displaying to user. Parameter mean number of page to prepare, staring from 1. Core will return immediately and provide the page with OnPageReady event. |
obj.Value("ScaleWidth") = 1024
obj("ScaleWidth") = 1024
_bstr_t pname;
pname=L"WcaleWidth";
mp_core->put_Value(pname,_variant_t((ULONG)1024));
Property | Type | Description |
ScaleWidth | Number | scale size |
ScaleHeight | Number | scale size |
ScaleMode | Number | scaling algorithm: 0 - no scaling (default), 1 - Fast, 2 - Bilinear, 3 - Bicubic |
ScalePercent | Number | 0 - scale size in pixels (default), 1 - scale size in percents |
ScaleConstrain | Number | 1 - constrain scaling proportions, 0 - not (default) |
BorderWidth | Number | leave that many pixels space left and right from the detected area (auto-detect mode only) |
BorderHeight | Number | leave that many pixels space top and bottom from the detected area (auto-detect mode only) |
BorderType | Number | 0 - No (default), 1 - Auto-detect, 2 - Manual |
BorderLeft | Number | in Manual Mode - set left border for clipping |
BorderRight | Number | in Manual Mode - set right border for clipping |
BorderTop | Number | in Manual Mode - set top border for clipping |
BorderBottom | Number | in Manual Mode - set bottom border for clipping |
FlipH | Number | 1 - flip image vertical, 0 - not (default) |
FlipV | Number | 1 - flip image horizontal, 0 - not (default) |
Gamma | Number | gamma (0 .. 511, 255 is default) |
Saturation | Number | saturation (0 .. 511, 255 is default) |
Value | Number | value (0 .. 511, 255 is default) |
Hue | Number | hue (0 .. 359, 179 is default) |
GrayScale | Number | 0 - color (default), 1 - force grayscale |
Invert | Number | 1 - invert image colors, 0 - not (default) |
MultiPage | Number | 1 - generate one multipage image of document, 0 - one image per page (default) |
BackgroundImage | String | Name of file which will be used as a background image |
var job_status = obj.JobProperty("Status")
Property | Type | Description |
JobID | Number | System print job ID for the current job. 0 if no active job. |
Status | Number | Current job status. Binary flags (ORed):
|
Resolution | Number | Resolution for the current job, in DPI. 0 if no active job. |
Printer | String | Printer name for the current job. Empty string if no active job. |
Document | String | Document name for the current job. Empty string if no active job. |
SpoolFile | String | Spool file name with full path for the current job. Empty string if no active job. |
obj.FormatParam("GIF","palette")=64
Bitmap | ||
Property | Type | Description |
output | Number | Output Format. 0 = 32-bit, 1 = 24-bit, 2 = 16-bit, 3 = 8-bit, 4 = 4-bit, 5 = 1-bit. |
diffusion | Number | 0 = turn off errors diffusion algorithm, 1 = turn on |
palette | Number | 0 = use default palette, 1 = use custom palette |
GIF | ||
Property | Type | Description |
palette | Number | Number of colors in resulting GIF file. |
delay | Number | Delay in milliseconds between frames in multipage (animated) GIF. |
loops | Number | Number of repetitions of frame loop in multipage (animated) GIF. |
diffusion | Number | 0 = turn off errors diffusion algorithm, 1 = turn on |
JPG | ||
Property | Type | Description |
output | Number | Output image quality. 0 = 100% quality, 1 = 95% quality and so on up to 10%. 18 = 10% quality. |
Property | Type | Description |
output | Number | Output Format. 0 = 100% quality, 1 = 95% quality and so on up to 10%. 18 = 10% quality. |
title | String | PDF document Title |
creator | String | PDF document Creator |
author | String | PDF document Author |
PNG | ||
Property | Type | Description |
output | Number | Output Format. 0 = 24-bit, 1 = 8-bit, 2 = 4-bit, 3 = 1-bit. |
compression | Number | 0 = No Compression. 1 = Default Compression. 2 = Fast Compression. 3 = Best Compression (recommended) |
diffusion | Number | 0 = turn off errors diffusion algorithm, 1 = turn on |
palette | Number | 0 = use default palette, 1 = use custom palette |
TGA | ||
Property | Type | Description |
output | Number | Output Format. 0 = 32-bit, 1 = 24-bit, 2 = 16-bit, 3 = 8-bit. |
diffusion | Number | 0 = turn off errors diffusion algorithm, 1 = turn on |
palette | Number | 0 = use default palette, 1 = use custom palette |
TIFF | ||
Property | Type | Description |
output | Number | Output Format. 0 = 32-bit CMYK, 1 = 24-bit, 2 = 8-bit, 3 = 4-bit, 4 = 1-bit. |
compression | Number | 0 = No Compression. 1 = Packbits (RLE), 2 = LZW, 3 = CCITT Group 3, 4 = CCITT Group 4. 2 and 4 work only for 1-bit mode. |
diffusion | Number | 0 = turn off errors diffusion algorithm, 1 = turn on |
palette | Number | 0 = use default palette, 1 = use custom palette |
obj.TransportParam("File","filename")="image_{{PAGE}}"
File | ||
Property | Type | Description |
path | String | Destination File Path. Special tags supported. |
filename | String | Destination File Name. Special tags supported. |
open | Number | Opens result image file with post-processor. |
everypage | Number | 0 = call post-processor once per document. 1 = call post-processor for each saved image. Ignored if open=0. |
hide | Number | 0 = show post-processor window. 1 = hide post-processor window. Ignored if open=0. |
exec | String | Post-processor filename with full path. Special tags supported. Ignored if open=0. |
param | String | additional parameters for post-processor. Special tags supported. Ignored if open=0. |
wait | Number | Set it to 1 if you wish to wait application termination before continue. Ignored if open=0. |
unilist | Number | Set it to 1 if you wish to get list file content in Unicode. Ignored if open=0 or everypage = 0. |
FTP | ||
Property | Type | Description |
url | String | Destination FTP directory URL. Special tags supported. |
file | String | Destination File Name. Special tags supported. |
passive | Number | 0 = FTP passive mode OFF. 1 = FTP passive mode ON. |
user | String | FTP server username. |
password | String | FTP server password. |
HTTP | ||
Property | Type | Description |
url | String | Destination HTTP URL. Special tags supported. |
file | String | Destination File Name. Special tags supported. |
put | Number | 0 = use POST method. 1 = use PUT method. |
user | String | username. |
password | String | password. |
Property | Type | Description |
String | Semicolon-separated list of email addresses. | |
message | String | Email message body. Special tags supported. |
subject | String | Email message subject. Special tags supported. |
filename | String | Name of attachment file. Special tags supported. |
Printer | ||
Property | Type | Description |
printer | String | Printer name. Can be a real printer name or "Default" string which means default printer. |
settings | ByteArray | One-dimentional Safearray of bytes containing printer settings (DEVMODE). To use default printer settings, set this value to the empty Safearray of bytes. |
margins | Number | 1 - use printer margins, 0 - not. |
fit | Number | 0 = Print page as-is. 1 - Fit image to printer page. |
scale | Number | scale factor, in percents, for additonally adjust fit to page feature. Ignored if fit=0. |
Event | Parameters | Description |
OnStartJob | None | Called when Core receives start job signal from driver. |
OnPagePrinted | Number | Called when Core receives next job from driver with page number as a parameter. |
OnAllPagesPrinted | None | Called when Core receives end job signal from driver. |
OnPageReady | Number page_id, String object | Called when Core prepared a page for displaying in responce to PreparePage
method call.
Page_id is a number of prepared page.
Object parameter is a name of Windows FileMapping object which contains ready-to-display
Windows bitmap. UI may use this object as a memory object with OpenFileMapping/MapViewOfFile API calls. |
OnCancelJob | None | Called when Core finishes all activity with current job as an acknowledge for CancelJob call from UI or after SendAll process end. |
OnUnload | None | Called when AutoSend property is set to true. UI should unload upon receiving this event. |
OnProgress | String source, Number value | Called when some lengthy process is taking place. Source could be a name of transport plug-in - in this case it reflects sending progress for this particular plug-in; or special value "Process" which reflects the state of image processing. Special value of "Convert" reflects state of image conversion process (from internal representation to perticular image format). Value is the value of progress indicator (0 - 100). |
OnProcessingEvent | Number event | Called on start and finish of various saving and processing stages. This event lets receiver know exactly
when and which process is going on. The following codes suported:
|
OnError | Number code, String message | Called when some error is happened. Message is textual representation of
the error. There are the folowing codes could be passed to this event:
|
OnAddRemovePrinter | Number | Core monitors printers add/remove operations and default printer change in the system. When this happen, it generates this event to let UI update lists of printers.
In responce to this event, UI must update its own printer lists and send update signal to its set of transport plug-ins to allow them update their printer lists,
by calling CheckSettings method with appropriate parameter. Parameter may have the following values:
|
OnSettingChanged | String target, String property, Variant value | When some of clients connected to particular Core object changes a property of this object, Core will
broadcast this event to all its listeners. For Core properties, target will be "Core", for plug-ins - plug-in name. Other parameters are property name and its new value. Using this mechanism, it is possible to use Publisher with several UIs or other listeners, each will always have actual set of property values. Special case of property is a "Printer" value. It changes when Core receives print job for different printer or after initial configuration load. UI must re-read all the configuration from Core. If property changed to its current value, event will be sent with empty Variant. Please, note that client (UI) initiated the change will receive this event as well. |
OnSettingsChangeFailed | String target, String property | If some configuration parameter has been changed incorrectly, or change in one parameter changes another settings, Core fires this event. In responce to this event, UI must reload apporpriate porperty. |
Property | Type | Description |
Valid | Number | (Read Only) May be used to examine current evaluation state. Has the following values:
|
Users | String Collection | (Read / Write) List of users currently allowed to print to Publisher. Implemented in Terminal Server version only. |
UserLicenses | Number | (Read Only) Maximum number of end user licenses. Implemented in Terminal Server version only. |
Method | Parameters | Returns | Description |
SetLicense | String FirtsName, String LastName, String Keycode | Number | This method is intended for registering Publisher. Application must provide FirstName, LastName and Keycode generated by Miraplacid to this method. Resulting value is 1 if registration succeeded, 0 if not. After 3 unsuccessful registration attempts this method will always return CLASS_E_NOTLICENSED and will not actually try to register. Application should re-create the object to continue registering. |
LoadUI | None | None | Method LoadUI allows application to force loading UI which will ask user for registration information. This could be done if Valid property returns 2 or 3. |
Property | Type | Description |
Value | Variant | (Read/Write) Any properties that your plug-in may have. Some of them may be saved into configuration in registry and restored from it. |
ValueNoCheck | Variant | (Write Only) The same as Value, but does not check value itself or against other values and does not update UI. Use to prevent update relative settings in a wrong order. When all the settings updated, call CheckSettings method. |
Name | String | (Read Only) Plug-in name for internal use. |
Layout | String | (Read Only) This string contains a list of properties (Values) which should be saved in configuration or restored from it. Format of this string is: "Bparam1,Lparam2,EParam3", where "B", "L" and "E" are prefixes meaning type of parameter (BSTR, Long and Encrypted BSTR, which will be saved in encrypted form and decrypted on load from registry, accordingly). Parameter names should be separated by commas. Spaces are not allowed. |
Extension | String | (Read Only) File extension corresponding current rendering plug-in, without leading period, i.e. "gif", "bmp". |
SafeForMultipage | Number | (Read Only) Returns 1 if this plug-in is able to support multipage images with pages of different dimensions.
For example, TIFF, GIF and PDF have internal paged stucture, while other plug-ins assemble "multipage" images by glueing pages together, and
this prevents them from accepting pages with different dimensions. Core analyses this property and prohibits saving multipage documents with this format if it does not supprt this feature. |
Method | Parameters | Description |
Convert | IImageCollection *images, Number resolution, String filename | Conversion procedure. Plug-in should obtain images from images, convert it to appropriate format and save to filename. If images collection provides several images to plug-in, it should generate multipage file filled with all images provided. Resolution is a printer DPI value which can be set to the image. |
ConvertToBitmap | String in_file, String out_file | Reverse conversion procedure, used for background image loading. Plug-in should read input file and convert it to bitmap file in internmal format. If image is in wrong format or error happened during decoding, plug-in should return E_FAIL or other appropriate error. If decoding procedure is not supported, plug-in should return E_NOTIMPL. |
CheckSettings | no parameterts; returns nothing | Call this method after a series of ValueNoCheck done to perform values (mutual) check and update plug-in UI state. |
InitSettings | no parameterts; returns nothing | Core calls this method when there is no configuration for current printer loaded. Plug-in must update its internal settings and UI. |
Method | Parameters | Description |
OnChangeParam | String plugin, String param, VARIANT val | When some plug-in parameter has changed via user interface, plug-in informs about that with OnChangeParam event. "plugin" is internal name of plug-in, "param" is a name of changed parameter, "val" is a new value of parameter. |
OnProgress | String plugin, long value | During conversion process, plug-in may fire this event to provide information about the progress of image conversion. |
Property | Type | Description |
Count | Number | (Read Only) Number of images in image set. |
Method | Parameters | Description |
Item | Number index; returns String | With this method, plug-in receives page content identified by "index". Method returns name of system filemapping object containing bitmap image for conversion. |
Property | Type | Description |
Value | Variant | (Read/Write) Any properties that your plug-in may have. Some of them may be saved into configuration in registry and restored from it. |
ValueNoCheck | Variant | (Write Only) The same as Value, but does not check value itself or against other values and does not update UI. Use to prevent update relative settings in a wrong order. When all the settings updated, call CheckSettings method. |
Name | String | (Read Only) Plug-in name (short). |
Layout | String | (Read Only) This string contains a list of properties (Values) which should be saved in configuration or restored from it. Format of this string is: "Bparam1,Lparam2,EParam3", where "B", "L" and "E" are prefixes meaning type of parameter (BSTR, Long and Encrypted BSTR, which will be saved in encrypted form and decrypted on load from registry, accordingly). Parameter names should be separated by commas. Spaces are not allowed. |
UsesRawImage | Number | (Read Only) Plug-in should return 1 if it does not need to convert image to particular format; it uses internal representation (bitmap) directly. Example of such a plug-in could be printer plug-in which prints bitmap to a printer and does not need converted image. |
Method | Parameters | Description |
Start | None | Publisher Core call this member when it begins saving text page(s). Plug-in may update its internal state and prepare resources. |
Process | String name, ITransportHelper object | Publisher Core calls this method when it needs to send converted file to selected location. "name" is name of the source object to save. For raw plug-ins (UsesRawImage == 1) this will be a name of file mapping object; for other plug-ins this is a name of graphics file. "object" parameter is an interface provided by Core which allows plug-in to translate strings. |
End | ITransportHelper object | Publisher Core call this member on end of saving to let plug-in free used resources and update its state. "object" parameter is an interface provided by Core which allows plug-in to translate strings. |
CheckSettings | Number | Call this method with parameter = 0 after a series of ValueNoCheck done to perform values (mutual) check and update plug-in UI state. Other values of parameter is for plug-ins which deals with printers. If some plug-in will not need this information, it may ignore calls with values other than 0 and return immediately. If parameter = 1 - default printer changed. Plug-in may just update visual representation of its printer list. If parameter = 2 - some printer added/removed. Plug-in must reload printer list and update all settings. |
InitSettings | None | Core calls this method when there is no configuration for current printer loaded. Plug-in must update its internal settings and UI. |
Method | Parameters | Description |
OnChangeParam | String plugin, String param, VARIANT val | When some plug-in parameter has changed via user interface, plug-in informs about that with OnChangeParam event. "plugin" is internal name of plug-in, "param" is a name of changed parameter, "val" is a new value of parameter. |
OnError | String plugin, String error_message | When some error happens during saving the text, plug-in should raise OnError event. "error_message" is what user will see as an error description. |
OnProgress | String plugin, Number value | Plug-in should raise this event periodically during saving process. Value is the value of progress indicator (0 - 100). |
Method | Parameters | Description |
TranslateString | String input; Number translate_flag; returns String output | Translates string possibly containing special tags and replaces these tags with their actual values. If translate_flag is not 0, this method changes unsafe characters (which cannot be used in filenames) to underscores when replaces tags. |