Cadcorp SIS API Methods

ExportPdf Method

Description

Exports the current view to an Adobe Portable Document Format (PDF) file.

Syntax

Visual Basic
Public Function ExportPdf( _
   ByVal filename As String, _
   ByVal paperFormat As String, _
   ByVal parameters As String _
) As Integer

Parameters

filename
The name of the exported file.
 
paperFormat
A string describing the paper size, format, resolution and so on. See Notes below.
 
parameters
A comma-separated key-value pair collection. Possible keys are:

Title For PDF Properties
Subject For PDF Properties
Keywords For PDF Properties
Author

For PDF Properties

Values containing non-alphanumeric characters, such as space, asterisk, and so on,
should be enclosed in quotation marks (ASCII character 34). Visual Basic programmers
can enter the quote symbol twice to embed a single quote symbol.

ContentLandscape Possible values: True or False. This command is deprecated.

CompressBitmaps

Possible values:
True - compresses bitmaps using the zip algorithm to reduce the size of the PDF document
if it contains bitmaps (default).
False - no compression

CompressStreams Possible values:
True - compresses PDF streams to reduce the size of the PDF document (default).
False - no compression.

DownsampleBitmaps Possible values:
True - downsample bitmaps to the chosen resolution (default).
False - no downsampling carried out.

ExportForegroundOnly Possible values: True or False

This parameter is used in GeognoSIS only, where you can have a foreground swd and a
background swd. The default is to export both, if you set this property to true, then only the
foreground swd will be exported.

ExportInvisibleLayers

Possible values:
True - exports hidden layers as hidden layers (default).
False - does not export hidden layers.

ExportItemProperties

integer, default=0
This is a bit field with the bits meaning:
1 = exporting item properties as PDF comments enabled.
2 = PDF comments will also be printable
4 = PDF comments are 'dynamic' instead of 'static'
'dynamic' - PDF comment icons become visible when mouse hovers over them.
'static' - There is a separate PDF layer to switch PDF comments on and off.
8 = exporting item properties as PDF User Properties enabled

ExportItemProperties is a bit field, therefore simply add up the numbers.

For example:

1 + 8 = 9

9 = exporting item properties as PDF comments and exporting item properties
as PDF User Properties enabled.

*ExportItemPropertiesLimit

integer, default=2000
The maximum number of PDF comments created.

*ExportItemPropertiesColor 0xRRGGBB, default=cyan
The colour of PDF comments.

*ExportItemPropertiesIconSize integer between 1 and 100000, default=100
relative size of PDF comment icons, in percent.

*ExportItemIgnoreLayers default=no layers ignored
numbers of overlays to be ignored, delimited by semi-colon (;)

Note:

Keywords marked *
require ExportItemProperties
to be set to 1, 2 or 4.

Example 1
ExportItemProperties=1,ExportItemPropertiesIgnoreLayers=0;1

This example ignores the following layers:
overlay #0
overlay #1

Example 2
ExportItemProperties=1,ExportItemPropertiesIgnoreLayers=0;1;2:47:0;3:?:4

This example ignores the following layers:
overlay #0
overlay #1
overlay #0, contained within the photo item with item id #47, contained within overlay #2
overlay #4, contained within any photo item, contained within overlay #3

Example 3
ExportItemProperties=1,ExportItemPropertiesIgnoreLayers=0;1;2;3;4:59:3;4:59:2;4:59:1;4:59:0

This example ignores the following layers:
overlay #0
overlay #1
overlay #2
overlay #3
overlay #3, contained within the Map Frame item with item id #59, contained within overlay #4
overlay #2, contained within the Map Frame item with item id #59, contained within overlay #4
overlay #1, contained within the Map Frame item with item id #59, contained within overlay #4
overlay #0, contained within the Map Frame item with item id #59, contained within overlay #4

FontEmbedding

Possible values:
True - fonts will be embedded
False - fonts will not be embedded (default)

FontListEmbedAlways a carriage-return separated list of font names.

FontListEmbedNever a carriage-return separated list of font names.
(Fonts will only be embedded if the licence inside the font allows embedding)

FontSubsetLimit an integer between 0 and 100: default=0, fonts are subset before embedding if not more than this
percentage of glyphs of the font are used.
0=never subset, 100=always subset

HyperLinks a comma separated list, possible values are:
Text
Point
LineString
Polygon
3D
Other
* (means all)

Default is nothing.

Keywords string
specifies any keywords.

LayerInfoIllustrator10 true or false (default false).
Export layer information so that Adobe® Illustrator® 10 and previous versions can display each
overlay as a separate layer.

LayerInfoAcrobat6 true or false (default false).
Export layer information so that Adobe® Acrobat® 6 and later versions can display each overlay
as a separate layer.

MaxBitmapChunkSize Default value =1048576
Very large bitmaps are chunked when they are exported to PDF. This parameter allows you to
specify the (maximum) size of these chunks, for example 1048576 (1MB).
Bitmap width * chunk height * bits per pixel / 8 will restrict the size of the chunks keeping
them smaller than the entered value.

Measurement

=PDF : (for Adobe® Acrobat® 7.0 and above, this entry is equivalent to "True" in Cadcorp SIS 6.3)
=PDF9 : (for Adobe® Acrobat® Reader® 9.0 and above)
=GeoPDF

It is possible to use a combination of these options, for example:
=GeoPDF, PDF or
=GeoPDF, PDF9

MinHotSpotWidth Floating point number
specify the unit, if units are not specified points (1/72th of an inch) will be used.
Increases the range in which the mouse pointer changes from pointer mark to hand mark.
The default range is approx 0.1mm square.
Example: MinHotSpotWidth=1cm

MinLineWidth distance, default=1/3 pt, possible values, e.g. "1cm", "1.3mm", etc. If no unit is given,
pt (1/72inch) is assumed.

This is the minimum line width of all lines in the PDF document. Smaller line widths can give
better results when zooming into the PDF document very far. Thicker line widths usually give
better results on printouts.

Monochrome true or false
If true, a monochrome document will be created.
If false (default), a true colour document will be created.

OnlyLayersInsidePhotos

true or false
If true, only layers inside Map Frame will be exported.
If false, all layers will be exported.

OwnerPassword string
This is the password that users must type if they want to change the document’s security
settings.
This password must be different from the UserPassword.

PaperFormat

string
defines the paper size

See Notes below.

PermissionPrinting 0/1/2
0 = None
1 = Low resolution
2 = High Resolution

PermissionChanging 0/1/2/3/4
0 = None
1 = Inserting, Deleting and rotating of images
2 = Fill in form fields and of signing
3 = Commenting, Fill in form fields and of signing
4 = Any except extracting of pages

PermissionCopying true or false
If true, users can select and copy the contents of the PDF document.
This also grants access to those
contents to utilities such as Adobe Catalog.

PermissionTextAccess true or false
If true, visually-impaired users can read the document with screen readers. This option does not
allow users to copy or extract the content of the
document.

Permission number. T his command is deprecated.

ReferenceDC Reference Device
0=Screen (default)
1=current printer
2=best printer (auto selected)

RotateImage

Rotates the image.
0 = rotate 0° (default)
90 = rotate 90°
270 = rotate 270°

Scale

Fit = This is the default when Scale is missing. This forces behaviour
compatible with SIS 7.0.

View = Use the SWD's view's scale. This is usually fixed to 1 or 1000000 and does not change
when you zoom in or out.

<N> = Forces the output to be at the specified scale, i.e. Scale-1250.

This parameter is especially useful for print templates. You can use Scale=1 and be sure that the PDF output will be at scale 1:1, regardless of the contents of the print template.

Subject string
specifies the Subject

Title string
specifies the Title

UserPassword string
the password users have to enter to open the PDF document


Use double quotes (ASCII character 34) around the Params text to obtain spaces and/or symbols within each parameter. Visual Basic programmers can enter the quote symbol twice to embed a single quote symbol.

Notes: The paperFormat argument is a string that defines the paper size, border size, output resolution and units.

Here are some examples:

Build the paperFormat argument from the following components. The square brackets indicate optional parameters.

Argument Format
"A4" A4 portrait, no border, 300 dpi
"A4*" A4 landscape, no border, 300 dpi
"500x800" 500pts wide, 800 pts high, no border, 300 dpi
"20x30cm" 20cm wide, 30cm high, no border, 300 dpi
"A4:36" A4 portrait, 36pts border, 300 dpi
"20x30cm:150" 20cm wide, 30cm high, 150pts border, 300 dpi
"20x30cm:15mm" 20cm wide, 30cm high, 15mm border, 300 dpi
"A4*@600" A4 landscape, no border, 600 dpi
"A3:2cm@600dpi" A3 portrait, 2cm border, 600 dpi

Build the paperFormat argument from the following components. The square brackets indicate optional parameters.

Block Consists of
paperFormat [ BorderSep Border ] [ ResolSep Resolution ]
PaperSize [ InLandscape ] [ PaperSizeUnits ]
PaperSizePredef one of A4, A3 or a paper size that appears in the Export PDF dialog in SIS
InLandscape *
PaperSizeUnits Size x Size [Unit ]
Size a positive floating point number
Unit one of cm, mm, or one of the units appearing in the Export PDF dialog in Cadcorp SIS. The default units are points.
BorderSep :
Border Size [ Unit ]
ResolSep @
Resolution Number [ ResolUnit ]
Number a positive integer
ResolUnit dpi

Remarks

Available: GEO MM ME MD OD OM SISpy

Groups:

Example

sis.ExportPdf ("c:\docs\map.pdf", "A3:2cm@600dpi", Title=""Town Centre"", Author=MF, Subject=Maps, ContentLandscape=False")

Exports the current view as a 600dpi file, with a 2cm border, in A3 portrait format. The PDF document's information dictionary contains entries for Title (Town Centre), Author (MF) and Subject (Maps)


Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).