2.7.20 expWks
Contents
Menu Information
File : Export : As Image File
Brief Information
Export the active sheet as raster or vector image file
Command Line Usage
expWks type:=jpg export:=active path:="c:\temp\";
X-Function Execution Options
Please refer to the page for additional option switches when accessing the x-function from script
Variables
| Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
|---|---|---|---|---|
| Image Type | type |
Input int |
|
Specifies the image type for the exported file. The default option is Encapsulated Postscript (*.eps).
|
| Select Sheet(s) | export |
Input int |
|
Use this option to select the worksheet(s) to be exported. By default, the active sheet will be exported.
|
| Worksheets | pages |
Input string |
|
This edit box lists the worksheets that will be exported. If Specified is selected in the Export drop-down list, this edit box will be editable, allowing you to choose the specific worksheets to be exported. In this case, you can click the Browse button to the right of this edit box to open the Project Browser dialog for selecting the worksheets. If other options are selected in the Export drop-down list, this edit box will be read-only. |
| File Name(s) | filename |
Input string |
|
Specifies how to name the exported image file(s). Options include:
Note:
|
| Path | path |
Input string |
|
Specifies the file path for the exported image file(s). |
| Overwrite Existing | overwrite |
Input int |
|
To specify if the existing file(s) in the path should be overwrote.
|
| Use Preference Options | sysopts |
Input int |
|
Whether to use Page settings from Preference Option dialog. Default is used. This is not visible in GUI and only used in script. |
| Export Settings | tr |
Input TreeNode |
|
Specifies the export settings.
|
| Keep Original Size | keepsize |
Input int |
|
Whether to keep original worksheet size.
Default is keep. This is not visible in GUI and only used in script. |
| Image Size | tr1 |
Input TreeNode |
|
Specifies the image size.
|
| Image Settings | tr2 |
Input TreeNode |
|
Specifies the image settings.
|
Description
This tool exports worksheets as image files.
The dialog box of this tool has a preview pane to the right. You can customize the settings in the left and then see the effects in the preview pane.
Details on Some Dialog Options
- Export Settings (tr)
- Please see this page for more details.
- Image Size (tr1)
- Please see this page for more details.
- Image Settings (tr2)
- Please see this page for more details.
Examples
- 1. Export the active worksheet as a JPG file, with the default sheet name as the file name:
expWks type:=jpg export:=active path:="c:\temp\";
- 2. Export the active worksheet as a PDF file, using the sheet name and today's date as the file name:
string todaysDate$ = date2str(today(), "MM_dd_yyyy")$;expWks type:=pdf filename:="<sheet name> %(todaysDate$)";
- 3. Export the active worksheet as a PDF file using cell A1 as the file name, and remove the black frame around the sheet:
expWks type:=pdf filename:=" %(%H,A,1)" tr.Frame:=0;
- 4. Export the active worksheet as a TIFF file, using the long name as the file name, and apply advanced image settings:
expWks type:=tif export:=active filename:="%(page.longname$)" path:=D:\ overwrite:=ask tr.BorderWid:=0 tr.Area:=1 tr1.Unit:=1 tr1.Rescaling:=0 tr2.TIF.DotsPerInch:=100 tr2.TIF.ColorSpace:=CMYK tr2.TIF.Compression:=PackBits;
Related X-Functions
Keywords:publishing