Home  • Download  • Register Now!  • Benefits  • Help  • Testimonials  • Samples  • Screenshots  • Awards  • Forum  • Convert Documents Online  • Print2Flash APIs  • Print2Flash vs. FlashPaper  • Contact Us
 Help Contents

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:

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")
If you need to get a default profile with default document options, you need to use DefaultProfile property of Server object:
 
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.
 
Value Language Value Language
auto Automatic selection of language based on the user's operating system language it Italian
bs Bosnian ja Japanese
cs Czech nl Dutch
da Danish pl Polish
de German pt Portuguese
en English ru Russian
es Spanish sr Serbian
fr French sv Swedish
hr Croatian tr Turkish
zh-CN Simplified Chinese zh-TW Traditional Chinese

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:
Value Flash Player version Value Flash Player version
8 8 18 11.5
9 9 19 11.6
10 10.1 20 11.7
11 10.2 21 11.8
12 10.3 22 11.9
13 11 23 12.0
14 11.1 24 13.0
15 11.2 25 14.0
16 11.3 26 15.0
17 11.4 27 16.0
    28 17.0
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:
  • %name% – main output document full path and name without extension;
  • %page% – page number (this is a required placeholder).

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 values from APPLICATIONTYPE enumeration. If you use Print2Flash Service and Server2 object, you cannot use MSWORD flag. To extract links from MS Word and PowerPoint documents, special application conversion method must be activated. See Hyperlinks topic for more information.
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:
  • “-10px” – for pixels;
  • “20%” – for percentage. Percentage is calculated relative to page width.

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:
  • “” (empty string) – no thumbnails are generated;
  • “All” – thumbnails are generated for each page;
  • Arbitrary page range. The string should be in the following format:

    [Range1Start[-][Range1End]] [,Range2Start[-][Range2End]] [, ... ]
See documentation on PageRange property of BatchProcessingOptions object.
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:
  • %name% – main output document full path and name without extension;
  • %page% – page number (this is a required placeholder);
  • %ext% – file format extension (for example, "jpg" or "png").

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:
  • %name% – main output document full path and name without extension;
  • %ext% - file format extension (for example, "xml" or "txt").

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.
In order to create metadata file, CreateMetaDataFile property should be set to true.


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
Here P2F refers to a Server object instance.
 

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
This sample obtains a default profile, sets its properties and then converts two documents using that profile default settings:
 
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"
Note that as ApplyChanges method is not called here, changes are not saved to the global default profile and affect only conversions performed via the current Server object instance (P2F).