AddPredefinedForm

Top  Previous  Next

The AddPredefinedForm method adds a new custom user defined form, having the characteristics specified by the method parameters.

HRESULT AddPredefinedForm(

[in] LPCWSTR p_wsFormName,

[in] LPCWSTR p_wsDescription,

[in] FLOAT   p_fWidth,

[in] FLOAT   p_fHeight,

[in] BOOL    p_bVisible,

[in] LPCWSTR p_wsProfileName,

[in] BOOL    p_bPublicProfile

);

 

Parameters:

p_wsFormName

[in]pointer to a null terminated Unicode string containing the name of the custom form to add

p_wsDescription

[in]pointer to a null terminated Unicode string containing the form description

p_fWidth

[in]form width in millimeters

p_fHeight

[in]form height in millimeters

p_bVisible

[in] specifies whether this form is visible in the forms combo box in the printer preferences dialog

p_wsProfileName

[in] pointer to a null terminated Unicode string containing the profile to modify. If this parameter is an empty string, the current active profile is used.

p_bPublicProfile

[in] Flag if the profile is a public or a private profile.

 

Return values:

S_OK on success or COM error code

NV_NOT_INITIALIZED - Initialize was not called

NV_PROFILE_EXISTS - a profile with the same name already exists

NV_ENOUGH_PROFILES - too many profiles already, can not add more

NV_FORM_EXISTS - a form with the specified name already exists

NV_ENOUGH_FORMS - the maximum number of custom forms has been reached

NV_INVALID_WIDTH - width should be in the range 1cm - 10m

NV_INVALID_HEIGHT - height should be in the range 1cm - 10m

NV_PUBLIC_PROFILE - you cannot change public profiles only on server