2.7.19 expWks


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

eps

Specifies the image type for the exported file. The default option is Encapsulated Postscript (*.eps).
Option list

  • ai:AI
    Adobe Illustrator, vector format
  • bmp:BMP
    Bitmap, raster format
  • emf:EMF
    Enhanced Metafile, vector format
  • eps:EPS
    Encapsulated PostScript, vector format
  • gif:GIF
    Graphics Interchange Format, raster format
  • jpg:JPG
    JPEG, Joint Photographic Experts Group, raster format
  • pcx:PCX
    Zsoft PC Paintbrush Bitmap, raster format
  • pdf:PDF
    Portable Document Format, vector format
  • png:PNG
    Portable Network Graphics, raster format
  • psd:PSD
    Adobe PhotoShop, raster format
  • tga:TGA
    Truevision Targa, raster format
  • tif:TIF
    TIFF, Tag Image File, raster format
  • wmf:WMF
    Windows Metafile, vector format
  • cgm:CGM
    Computer Graphics Metafile, vector format (Only for 32bit version)
  • dxf:DXF
    AutoCAD Drawing Interchange, vector format (Only for 32bit version)
  • svg: SVG
    Scalable Vector Graphics, vector format
Select Sheet(s) export

Input

int

active

Use this option to select the worksheet(s) to be exported. By default, the active sheet will be exported.
Option list

  • active:Current Sheet
The active worksheet will be exported
  • book:Sheets in Book
All the worksheets in active workbook will be exported
  • folder:Sheets in Folder
All the worksheets in active folder of the project (see this in Project Explorer) will be exported. The worksheets in the subfolders will not be included.
  • recursive:Sheets in Folder (recursively)
All the worksheets in active folder of the project (see this in Project Explorer) will be exported. The worksheets in the subfolders will be included.
  • project:Sheets in Project
All the worksheet in the project will be exported.
  • specified:The specified sheet
It makes the "Worksheets" edit box editable, allowing you to choose the specific worksheets to be exported.
Worksheets pages

Input

string

<active>

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

<Long Name>

Specifies how to name the exported image file(s). Options include:

  • <Long Name>: Uses the long names of the worksheets as the file names of the exported images.
  • <Short Name>: Uses the short names of the worksheets as the file names of the exported images.
  • <Sheet Name>: Uses the sheet names of the worksheets as the file names of the exported images.
  • wks##: Uses filenames like "wks01", "wks02"....
  • wks<pound>#:Use "wks# + index" (filenames like "wks#1", "wks#2"....) and character "#"(represented by <pound>) as file name.

Note:

  1. File Name supports keyword combination, such as <longname>-multi, the long name of the worksheet and the string -multi will be used as the export file name.
  2. <pound>, representing the character "#", can also be used without combining with worksheet index. For example, Set File Name(s) as Wks<pound>2 then the file name would be Wks#2.
Path path

Input

string

Specifies the file path for the exported image file(s).

Overwrite Existing overwrite

Input

int

ask

To specify if the existing file(s) in the path should be overwrote.
Option list

  • rename:Auto Rename
    Renames the exported file automatically.
  • replace:Replace
    Replaces the existing file with the exported file.
  • skip:Skip
    Skips the exporting of this file.
  • ask:Ask
    Asks the user to decide the operation.
Use Preference Options sysopts

Input

int

1

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

<unassigned>

Specifies the export settings.
See more details in Description table

Keep Original Size keepsize

Input

int

0
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

<unassigned>

Specifies the image size.
See more details in Description table

Image Settings tr2

Input

TreeNode

<unassigned>

Specifies the image settings.
See more details in Description table

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. The following script command will export the active worksheet as a JPG file:
expWks type:=jpg export:=active path:="c:\temp\";
2. The following example will export a worksheet as a JPG file from the dialog:
a. Active the worksheet to be exported.
b. Select File: Export: As Image File from the menu. This opens the dialog box of the expWks X-Function.
c. Select the Joint Photographic Experts Group (*.jpg) with the Image Type drop-down list.
d. Enter c:\temp for Path.
e. Expand the Image Sizes branch and select page ratio for Specify Size in. Enter 50 for Ratio (%). You can see Current Size is changed.
f. Click OK to export the worksheet.
3. Using tree node options
expWks type:=tif export:=active filename:="<long name>" path:=D:\ overwrite:=ask
tr.BorderWid:=0 tr.OpenGLGraph.AntiAlias:=1 tr.Area:=1.
tr1.Unit:=1 tr1.Rescaling:=0.
tr2.TIF.DotsPerInch:=100 tr2.TIF.ColorSpace:=CMYK tr2.TIF.Compression:=PackBits;

Related X-Functions

expImage


Keywords:publishing