Profile Object
The Profile object controls various document options used at document conversion. These options include interface options, protection options, optimization options, hyperlink support options, output format control, watermark options, page thumbnail options, and metadata file options.
Remarks
The Profile object allows you to control all those options that can be setup in Document Options window when converting documents manually but at programmatic conversion. In addition this object can be used to change default document options shown in Default Document Options window.
There are three possible scenarios of using Profile object:
- For specifying special (ad hoc) options applied to a single conversion or series of conversion. In such a case you should create a Profile object, setup its properties and pass it to ConvertFile or ConvertDir methods as a Profile argument;
- For changing default document options applied to all document conversions performed via a single Server object instance. In such a case you should obtain reference to the default profile using DefaultProfile property and change its properties. Then you may convert files with this Server object instance and all the options you setup will be applied to all document conversions via this instance;
- For changing default document options shown in Default Document Options window. In such a case you should obtain a reference to the default profile using DefaultProfile property, change its properties and save the changes using ApplyChanges method.
Object access
To create an ad hoc Profile object, you need to create it using "Print2Flash5.Profile" ProgID such as in the following example:
Set MyProfile=CreateObject("Print2Flash5.Profile") |
Set DefProfile=P2F.DefaultProfile |
Here P2F refers to Server object instance.
Regardless of the method you obtained a profile, initially it contains the default document option settings as they have been setup in Default Document Options window. The difference between an ad hoc and default profile instances is that you cannot save an ad hoc profile and that default profile settings are used if no profile is specified at conversion. After you obtained a reference to Profile object using one of the methods above, you can access its properties and methods.
Properties
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | String | Profile name. This field is reserved for future use. | ||||||||||||||||||||||||||||||||||||||||||||||||
Document interface |
||||||||||||||||||||||||||||||||||||||||||||||||||
InterfaceOptions | Integer | Bit mask specifying which buttons and controls should be shown in converted document interface. Should be an OR combination of flags from INTERFACE_OPTION enumeration | ||||||||||||||||||||||||||||||||||||||||||||||||
Skin | Skin object | The default Skin
object used at document conversions. You may either retrieve this object or
set it to another Skin object obtained from
SkinCollection collection. If this property is set to null value, it tells Print2Flash that no skin is used and no skin images are stored inside the document. It is helpful for reducing of document file size in case you either don't need the document toolbar at all or use your own custom document viewer for single file or external viewer Flash output format. |
||||||||||||||||||||||||||||||||||||||||||||||||
Language | String | Specifies document toolbar hint language. Possible
parameter values are listed below.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Document protection |
||||||||||||||||||||||||||||||||||||||||||||||||||
ProtectionOptions | Integer | Bit mask specifying which protection options should be activated in the converted document. Should be an OR combination of flags from PROTECTION_OPTION enumeration | ||||||||||||||||||||||||||||||||||||||||||||||||
RestrictionDomains | String | Specifies from which domains (sites) the
generated Print2Flash documents are allowed to be viewed. The value must be a
comma-separated list of domains. For example, "mysite.com,print2flash.com"
value allows document display only if the document has been loaded from mysite.com or print2flash.com domains. Mentioning a domain in the list does
not include all its subdomains so allowed subdomains must be listed
separately, e.g. "mysite.com,www.mysite.com". If the document is loaded from
another domain, no document contents is shown to the user. If this value is set to the empty string, no domain restriction is effective and documents can be viewed from any domain. See Restricting Access to Documents help topic for more information. |
||||||||||||||||||||||||||||||||||||||||||||||||
Options for Flash documents |
||||||||||||||||||||||||||||||||||||||||||||||||||
FlashVersion | Integer | The version of Flash Player for
which document output should be optimized. The values should be as following
for various player versions:
|
||||||||||||||||||||||||||||||||||||||||||||||||
CompressionMethod | Integer | Compression method to be used for output Flash document files. Should be a value from COMPRESSION_METHOD enumeration. | ||||||||||||||||||||||||||||||||||||||||||||||||
OutputFormat | Integer | Output format for generated Flash documents. It should be set to one of the values from OUTPUTFORMAT enumeration. See Output Formats topic for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||
DocTemplate | String | Specifies the name of the custom document viewer template file to use for single file output format of Flash documents. Note that this custom document template is used only if TemplateType property is set to TEMPLATE_CUSTOM. See Designing your Own Document Viewer for Single File Format topic for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||
TemplateType | Integer | Specifies the type of document template to use for single file output format of Flash documents. The value must belong to TEMPLATETYPE enumeration. If TEMPLATE_CUSTOM is specified, you must supply a custom document template with DocTemplate property. | ||||||||||||||||||||||||||||||||||||||||||||||||
OutputResolution | Integer | Resolution used for the generated page Flash files if "Single file per page" output format is used. Zero value means output resolution is always equal to printing resolution. See Designing your Own Document Viewer for Single File per Page Format topic for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||
ASVersion | Integer | Version of ActionScript to use for the generated page Flash files if "Single file per page" output format is used. It can be 2 or 3. | ||||||||||||||||||||||||||||||||||||||||||||||||
PageFileName | String | The template of the name and path of page
files if "Single file per page" output format
of Flash documents is used. The template format
may include these placeholders:
See Designing your Own Document Viewer for Single File per Page Format topic for more information. |
||||||||||||||||||||||||||||||||||||||||||||||||
FrameWidth | Integer | Initial width of the document in the Flash Player unless another size is specified in document embedding code. | ||||||||||||||||||||||||||||||||||||||||||||||||
FrameHeight | Integer | Initial height of the document in the Flash Player unless another size is specified in document embedding code. | ||||||||||||||||||||||||||||||||||||||||||||||||
Options for HTML5 documents |
||||||||||||||||||||||||||||||||||||||||||||||||||
DocumentType | DOCUMENT_TYPE enumeration | Bit mask that specifies which document types should be produced: none, only Flash, only HTML5 or both. | ||||||||||||||||||||||||||||||||||||||||||||||||
HTML5Options | HTML5Options object | Object storing options specific for HTML5 documents. | ||||||||||||||||||||||||||||||||||||||||||||||||
Document optimization |
||||||||||||||||||||||||||||||||||||||||||||||||||
UseJpeg | Boolean | Flag specifying whether to compress mages in the output document to JPEG | ||||||||||||||||||||||||||||||||||||||||||||||||
JpegQuality | Integer | JPEG quality level to use for compression of images in the output document. It should be a number between 1 (lowest quality) and 100 (highest quality). Note that images are compressed as JPEG only if UseJpeg property is set to true as well. | ||||||||||||||||||||||||||||||||||||||||||||||||
Hyperlinks |
||||||||||||||||||||||||||||||||||||||||||||||||||
ParseLinks | Boolean | Flag specifying if Print2Flash should parse hyperlinks out of document text and convert them to clickable hyperlinks in generated Print2Flash documents. See Hyperlinks topic for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||
ExtractLinks | Integer | Specifies from which types of documents
Print2Flash should extract hyperlinks for insertion in generated Print2Flash documents. Currently it could be MSWORD, MSPOWERPOINT or
ACROBAT |
||||||||||||||||||||||||||||||||||||||||||||||||
LinkTargetAuto | Boolean | If true, hyperlink targets are taken from
source documents. If a source document does not specify a target or a link
has been parsed from document text, _blank target is used. If false, the target is specified by LinkTarget property. See Hyperlinks Tab of Document Options Window help topic. |
||||||||||||||||||||||||||||||||||||||||||||||||
LinkTarget | String | Specifies the target to be used for hyperlinks. This property is used only if LinkTargetAuto property is false. | ||||||||||||||||||||||||||||||||||||||||||||||||
Watermarks |
||||||||||||||||||||||||||||||||||||||||||||||||||
WatermarkImage | String | Path to the graphic file of PNG format which should be placed on each document page as a watermark. See Watermarks topic for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||
WatermarkScale | Integer | Specifies how the image watermark should be scaled relative to the page size. The value represents the percentage of the page size and should be between 1 and 100. | ||||||||||||||||||||||||||||||||||||||||||||||||
WatermarkTransparency | Integer | Specifies the transparency correction for the watermark image. This property affects watermark image transparency (alpha channel). The value should be between 0 (transparency of image is not affected) and 255 (full transparency). | ||||||||||||||||||||||||||||||||||||||||||||||||
WatermarkAnchor | Integer | Specifies the position on the page the watermark should be placed at. It must be a value from the WATERMARKANCHOR enumeration. | ||||||||||||||||||||||||||||||||||||||||||||||||
WatermarkXOffset | String | Specifies the horizontal offset of the
watermark from the position denoted by
WatermarkAnchor property. The value must be specified either in pixels
or as a percentage in these formats:
If the unit is not specified, the default unit is percentage. The numeric value may be either positive or negative. |
||||||||||||||||||||||||||||||||||||||||||||||||
WatermarkYOffset | String | Specifies the vertical offset of the watermark from the position denoted by WatermarkAnchor property. The format of the value is similar to WatermarkXOffset property except that if it is specified as a percentage, it is calculated relative to page height. | ||||||||||||||||||||||||||||||||||||||||||||||||
Page thumbnails |
||||||||||||||||||||||||||||||||||||||||||||||||||
ThumbnailPageRange | String | String describing the pages for which
page thumbnails must be created. The acceptable
values are the following:
|
||||||||||||||||||||||||||||||||||||||||||||||||
ThumbnailFileName | String | The template of the name and path of
page thumbnails files. If it includes the path,
it is interpreted relative to the output folder (see
ConvertDir and
ConvertFile methods). The
template format may include these placeholders:
In order to create page thumbnails, ThumbnailPageRange property should specify which thumbnails should be created. |
||||||||||||||||||||||||||||||||||||||||||||||||
ThumbnailFormat | Integer | Page thumbnail image file format. It should be set to one of the values from IMAGEFORMAT enumeration. | ||||||||||||||||||||||||||||||||||||||||||||||||
ThumbnailJpegQuality | Integer | JPEG quality level to use for compression of thumbnails images if the image format is JPEG. It should be a number between 1 (lowest quality) and 100 (highest quality). | ||||||||||||||||||||||||||||||||||||||||||||||||
ThumbnailImageHeight | Integer | Page thumbnail image file height. See Page Thumbnails topic for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||
ThumbnailImageWidth | Integer | Page thumbnail image file width. See Page Thumbnails topic for more information. | ||||||||||||||||||||||||||||||||||||||||||||||||
Metadata file |
||||||||||||||||||||||||||||||||||||||||||||||||||
CreateMetaDataFile | Boolean | If true, metadata file is created at conversion. The name and path to the file is specified by the MetaDataFileName property. | ||||||||||||||||||||||||||||||||||||||||||||||||
MetaDataFileFormat | Integer | Format of the metadata file. It should be set to one of the values from METADATAFORMAT enumeration. | ||||||||||||||||||||||||||||||||||||||||||||||||
MetaDataFileName | String | The template of the name and path of
metadata file. If it includes the path, it is
interpreted relative to the output folder (see
ConvertDir and
ConvertFile methods). The
template format may include these placeholders:
For example, if the output document name is c:\test\mydoc.swf, template is
"%name%.%ext%" and metadata file
format is XML, the metadata file name will be
c:\test\mydoc.xml. |
Methods
ApplyChanges
Method saves the default profile.
Signature
ApplyChanges()
Arguments
None
Remarks
Methods saves the default profile. The method should be called only for default profile obtained via DefaultProfile property of Server object. If you intend to change the global default profile properties, you need to call this method to save the changes.
Examples
The following example obtains a default profile, modifies some of its properties and save the changes back to default profile. The example assumes that enumeration constants file P2FAPIConst.vb from Print2Flash SDK is included:
Set DefProfile=P2F.DefaultProfile DefProfile.InterfaceOptions = INTLOGO or NTZOOMSLIDER or INTFITWIDTH or INTFITPAGE or INTPREVPAGE or INTNEXTPAGE DefProfile.ProtectionOptions = PROTDISPRINT or PROTDISTEXTCOPY DefProfile.FlashVersion = 8 DefProfile.UseJpeg = True DefProfile.JpegQuality = 80 DefProfile.ApplyChanges |
Profile Object Examples
The sample below creates an ad hoc profile, sets its properties and use it for conversion of a document named C:\Docs\MyDoc.doc
Set MyProfile=CreateObject("Print2Flash5.Profile") MyProfile.InterfaceOptions = INTLOGO or INTDRAG or INTSELTEXT or INTGOTOPAGE MyProfile.ProtectionOptions = PROTENAPI P2F.ConvertFile "C:\Docs\MyDoc.doc", , MyProfile |
Set DefProfile=P2F.DefaultProfile DefProfile.InterfaceOptions = INTDRAG Or INTZOOMBOX Or INTFITWIDTH Or INTPREVPAGE Or INTNEXTPAGE or INTPRINT DefProfile.UseJpeg = True DefProfile.JpegQuality = 60 P2F.ConvertFile "C:\Docs\MyDoc.doc" P2F.ConvertFile "C:\Docs\Finance.xls" |