Software Companions - Gerber and HPGL Viewers scViewerX User Guide 
scViewerX

User's Guide
scViewerX Version 5

Introduction

Welcome to scViewerX
scViewerX is a powerful ActiveX control that allows you to view, print and convert PLT (hpgl, hpgl/2 and Calcomp), Adobe PDF, Autodesk DWF, CGM, TIFF and other formats, inside your own application, or on a WEB page. You can implement and use the scViewerX component in any development environment that can use ActiveX controls, e.g.: Visual Basic, Visual Studio, .NET, Delphi and more.

Measure and annotate your drawings with scViewerX
scViewerX includes an extensive set of annotation tools which includes text, polylines, polygons, rectangles, circles, ellipses, stamps, barcodes, pictures and more. You will find several tools for measurement and counting, which may be useful for e.g.: take-off measurement applications.

Convert your drawings with scViewerX
The control includes several methods for converting between different formats, you will even find a method to convert your PDF files back to CAD formats. You have full control of the conversion and can change resolution, number of colors, scale and other settings. Pen tables are available for PLT, DWF and CGM files, and may be used to override widths, styles and colors.

Build your application with ScViewerX
scViewerX contains more than 200 methods, properties and events that may be used by your application.
You will find methods for comparing drawings, deskewing image files, printing and much more. The control includes methods for merging, splitting and encrypting PDF files. The printing interface includes methods for printing to specific a printer, printing multiple files on a single sheet, poster printing, printing current displayed portion and more.
This document describes each method, property and event available to the programmer.


Contents


Methods

NB! All coordinates are in drawing units (world coordinates) unless stated otherwise.

AddCompareDocument
Load a file that will be compared to the currently loaded file.
SyntaxBOOL AddCompareDocument(BSTR pFileName);
Parameters pFileName Name of file to compare to the currently loaded file.
Returns BOOL TRUE if the compare file was successfully loaded.

AddImagePlaceholder
Load a file and add to the currently viewed file. The image will be placed using a text position and extents in millimetres.

SyntaxLONG AddImagePlaceholder(BSTR bstrReplaceText, BSTR bstrImageFileName, double Width, double Height);
Parameters bstrReplaceTextText in file to replace with given image. Text position will be used as image origin.
bstrImageFileNameFilename of image to load. Supported file formats : PNG, JPEG, TIFF and BMP.
WidthWidth of image in millimetres.
HeightHeight of image in millimetres.
Returns LONG Nonzero if image is added.

AddImagePosition
Load a file and add to the currently viewed file. The image will be placed using a rectangle given in millimetres. All coordinates are relative to top left corner.

SyntaxLONG AddImagePosition(BSTR bstrFileName, double Left, double Top, double Right, double Bottom);
Parameters bstrImageFileNameFilename of image to load. Supported file formats : PNG, JPEG, TIFF and BMP.
LeftLeft location of added image.
TopTop location of added image.
RightRight location of added image.
BottomBottom location of added image.
Returns LONG Nonzero if image is added.

AddQRImage
Add a QR (2-d barcode) to the currently viewed file. The QR image will be placed using a rectangle given in millimetres. All coordinates are relative to top left corner.

SyntaxLONG AddQRImage(BSTR bstrText, long QrSize, long Margin, long QrLevel, double Left, double Top, double Right, double Bottom);
Parameters bstrTextText to encode in QR 2-d barcode.
QrSizeScale of QR image, normally set to 1.
MarginWhite space around QR Image in pixels.
QrLevelError correction level of QR supported values:
  1. 7%
  2. 15%
  3. 25%
  4. 30%
LeftLeft location of added image.
TopTop location of added image.
RightRight location of added image.
BottomBottom location of added image.
Returns LONG Nonzero if QR image is added.

CheckFile
Check if the given file can be loaded by the control.

SyntaxBOOL CheckFile(BSTR pFileName);
Parameters pFileName Name of file to check.
Returns BOOL TRUE if file can be loaded.

CheckFileFormat
Check if the given file can be loaded by the control.
Returns file format if file can be loaded.

Syntaxlong CheckFileFormat(BSTR pFileName);
Parameters pFileName Name of file to check.
ReturnslongOne of the following values is returned:
  1. Unknown file format
  2. HPGL/2
  3. Gerber RS-274D
  4. Gerber RS-274X
  5. Calcomp plotter format
  6. CALS
  7. TIFF
  8. PNG.
  9. Windows BMP.
  10. JPEG.
  11. CGM (Computer Graphics Metafile).
  12. Autodesk DWF.
  13. Adobe PDF.
  14. JEDMICS C4 (tiled group 4).
  15. WebP Image Format.

CloseCompareDocument
Close the compare file and return to normal view mode

SyntaxBOOL CloseCompareDocument();
Parameters none  
Returns BOOL TRUE if success.

CloseFile
Close the currently loaded file.

SyntaxBOOL CloseFile();
Parameters none  
Returns BOOL TRUE if success.

CopyToClipBoard
Copy the given region to clipboard. If all four coordinates is set to zero, the whole drawing will be copied to the clipboard.

SyntaxBOOL CopyToClipBoard(long x1, long y1, long x2, long y2);
Parameters x1 Upper left corner of part to copy.
  y1 Upper left corner of part to copy.
  x2 Lower right corner of part to copy.
  y2 Lower right corner of part to copy.
Returns BOOL TRUE if success.

DeskewImage
Deskew a skewed image with the given angle. You can calculate the skew angle by using the GetDeskewAngle method.

SyntaxLONG DeskewImage(LONG Page, DOUBLE Angle);
Parameters DeskewImage Page number to deskew (pages start at index 0).
  Angle Deskew angle in radians.
Returns BOOL TRUE if success.

DrawToDC
Draw the whole drawing, or a part of it, to a user provided device context.
The device context may be any device (metafile, bitmap, printer, dibsection etc.).

SyntaxLONG DrawToDC(OLE_HANDLE hDC, DOUBLE dScale, LONG lPage, DOUBLE dRotation, LONG lOffsetX, LONG lOffsetY, LONG lClipX1, LONG lClipY1, LONG lClipX2, LONG lClipY2, OLE_COLOR crBackColor, VARIANT_BOOL bMirror, VARIANT_BOOL bFlip);
Parameters hDC Device context handle.
  dScale Scale factor.
  lPage Page number to draw.
  dRotation Rotation factor in degrees.
  lOffsetX Horizontal offset used for drawing.
  lOffsetX Vertical offset used for drawing.
  lClipX1 left corner of clip rectangle.
  lClipY1 Lower corner of clip rectangle.
  lClipX2 Right corner of clip rectangle.
  lClipY2 Upper corner of clip rectangle.
  crBackColor Background color to use.
  bMirror Set to true to mirror the drawing horizontally.
  bFlip Set to true to flip the drawing vertically.
Returns BOOL TRUE if success.

EnumeratePen
Returns the real pen number for the given pen index.

Syntaxlong EnumeratePen(long lIndex);
Parameters lIndex Pen index (0..GetNumPens())
Returns long Real pen number.

Export
Export the current loaded file to the given format.

SyntaxBOOL Export(BSTR bstrFileName, BSTR bstrFormat, double dScale, long lBitsPixel, long lDPI);
Parameters bstrFileName Name of created file.
  bstrFormat Format to use.
The following format identifiers are supported:
FormatDescription
BMPWindows Bitmap
CALSCALS Type 1 CCITT-G4 Raster Format
CGMComputer Graphics Metafile
DWFDrawing Web Format
DXFAutoDesk Drawing Exchange Format
Version 2000
DXFR12AutoDesk Drawing Exchange Format
Version 12
EMFWindows Enhanced Metafile
GBRGerber RS274X
HPRTLHP-RTL
JPEGJFIF Compliant JPEG
PCXPaintbrush Format
PDFAcrobat PDF
PDFRASTERAcrobat PDF raster
PLTHPGL/2 Plotter Format
PNGPortable Network Graphics
PSAdobe Postscript
SVGScalable Vector Format
TIFFTagged Image File Format
WEBPGoogle WebP Image Format
WMFWindows Metafile
  dScale Scalefactor.
  lBitsPixel Bits Per Pixel (Raster only).
  lDPI Pixels per Inch (Raster only).
Returns BOOL TRUE if file created.

ExportExtents
Does the same as the Export method, but have two extra parameters to control the extent of the exported file. The two properties named ExportAlignmentH and ExportAlignmentV controls the placement of the drawing, if it's smaller than the exported page size.

SyntaxBOOL ExportExtents(BSTR bstrFileName, BSTR bstrFormat, double dWidth, double dHeight, double dScale, long lBitsPixel, long lDPI);
Parameters bstrFileName Name of created file.
  bstrFormat Format to use.
The following formats are supported:
FormatDescription
BMPWindows Bitmap
CALSCALS Type 1 CCITT-G4 Raster Format
CGMComputer Graphics Metafile
DWFDrawing Web Format
DXFAutoDesk Drawing Exchange Format
Version 2000
DXFR12AutoDesk Drawing Exchange Format
Version 12
EMFWindows Enhanced Metafile
GBRGerber RS274X
HPRTLHP-RTL
JPEGJFIF Compliant JPEG
PCXPaintbrush Format
PDFAcrobat PDF
PDFRASTERAcrobat PDF raster
PLTHPGL/2 Plotter Format
PNGPortable Network Graphics
PSAdobe Postscript
SVGScalable Vector Format
TIFFTagged Image File Format
WEBPGoogle WebP Image Format
WMFWindows Metafile
  dWidth Width of exported file in millimetres.
  dHeight Height of exported file in millimetres.
  dScale Scalefactor.
  lBitsPixel Bits Per Pixel (Raster only).
  lDPI Pixels per Inch (Raster only).
Returns BOOL TRUE if file created.

ForceRedraw
Force the control to refresh drawing window. Use this function after toggling vector layer states or other operations that may cause current display to be invalid (e.g.: DeskewImage).

SyntaxLONG ForceRedraw(void);
Parameters none
Returns LONG Non-zero if success

GerberDefineAperture
Define a single aperture in the aperture table. This will only affect Gerber files using the older RS-274D format.

Syntaxlong GerberDefineAperture(long lApertureNo, long lShape, long lSizeX, long lSizeY, long lHoleSize);
Parameters lApertureNo Aperture number to define (values from 10 to 9999 valid).
  lShape Aperture shape, following values are available:
  1. Round
  2. Square
  3. Oval
  4. Polygon
  lSizeX Width of aperture in 1/10000 Inch.
  lSizeY Height of aperture in 1/10000 Inch.
  lHoleSize Size of drill hole in 1/10000 Inch.
Returns long non-zero if success.

GerberLoadAperture
Load aperture defintions from a file. This will only affect Gerber files using the older RS-274D format.

Syntaxlong GerberLoadAperture(BSTR bstrFileName);
Parameters bstrFileName Name of file with predefined apertures. Several different formats are supported, including:
  • Gerbview Apertures (*.gba, *.app)
  • VeriBest Aperture Map (*.map)
  • Pads Aperture Report (*.rep)
  • PCB386 GAP Files (*.gap)
  • Aperture Report (*.lst)
  • Seetrax Apertures (*.txt)
  • and more...
If you need an aperture format that is currently not supported, you can request support by sending an e-mail to sales@softwarecompanions.com.
Returns long non-zero if success.

GerberSetColors
Change the track and flash colors used during display of Gerber files.

Syntaxlong GerberSetColors(OLE_COLOR crFlashColor, OLE_COLOR crTrackColor);
Parameters crFlashColor RGB color to use for flash elements (pads).
  crTrackColor RGB color to use for tracks.
Returns long non-zero if success.

GerberSetFormat
Change the settings needed to load RS-274D Gerber files correctly.

Syntaxlong GerberSetFormat(VARIANT_BOOL bIncremental, long lPreceding, long lSucceeding, long lUnits, VARIANT_BOOL bLeading, VARIANT_BOOL bTrailing);
Parameters bIncremental If true the Gerber files contains incremental coordinates. Set to false for absolute coordinates.
  lPreceding Number of digits before decimal point.
  lSucceeding Number of digits after decimal point.
  lUnits Units used in Gerber file. Set to 0 for Inch and 1 for Milimetres.
  bLeading Leading zeros suppressed if set to true.
  bTrailing Trailing zeros suppressed if set to true.
Returns long non-zero if success.

GetDeskewAngle
Returns the calculated deskew angle. This method will analyze the raster data to find the deskew angle. Note that this method will only work for raster formats: TIFF, PNG, JPEG, BMP and CALS. It will work for PDF files if you load these using the LoadPDFFile method with raster format option.

SyntaxLONG GetDeskewAngle(LONG Page, DOUBLE *Angle);
ParametersPage Page number to analyze (for multipage files), pages start with index 0.
 Angle Calucalted angle in degrees.
Returns LONG Non-zero if success.

GetFileExtent
Returns the extents of the currently loaded file.

SyntaxBOOL GetFileExtent(long *pWidth, long *pHeight);
ParameterspWidth Returned Width
 pHeight Returned Height
Returns BOOL TRUE if success.

GetMarkupDrawState
Return current markup engine state.

SyntaxLONG GetMarkupDrawState(LONG* Mode, LONG* ElementType);
Parameters Mode Current markup mode, possible values:
  1. Idle (no markup action active)
  2. Add markup. The markup engine is in add markup mode. ElementType will contain the active markup element type.
  3. Edit markup. The markup engine is currently editing a markup element. ElementType will contain the active markup element type.
  ElementType Active markup element type. See MarkupDrawElement for available element types, and the corresponding values.
Returns LONG Non-zero if success

GetMeasurePnt
Returns a point from last measurement operation. Number of available measurment points is returned by the NumMeasurePnts property. Points are numbered from 0 to NumMeasurePnts-1. Returned coordinates are given in millimeters unaffected by calibration.

SyntaxLONG GetMeasurePnt(LONG Index, DOUBLE* x, DOUBLE* y);
ParametersIndex Index for point to return.
 x Returned x coordinate.
 y Returned y coordinate.
Returns BOOL TRUE if success.

GetMouseAction
Return the active mouse action.

SyntaxLONG GetMouseAction(LONG *Action);
Parameters Action Return active active mouse action.
A list of valid action modes follows:
  1. No Action (clear active states)
  2. Set copy as metafile to clipboard mode.
  3. Set edit markup mode.
Returns LONG Non-zero if success

GetNamedView
Returns information about a named view.
This function is currently only available for DWF and DWFx files.

SyntaxLONG GetNamedView(LONG lView, BSTR* bstrViewName, DOUBLE* x1, DOUBLE* y1, DOUBLE* x2, DOUBLE* y2);
Parameters lView Index of view to return information for.
  bstrViewName Returned named of view.
  x1 Left corner for view in world coordinates.
  y1 Lower corner for view in world coordinates.
  x2 Right corner for view in world coordinates.
  y2 Upper corner for view in world coordinates.
Returns long Non-zero if success.

GetNumPages
Returns the number of pages in the currently loaded file.

Syntaxlong GetNumPages();
Parameters None  
Returns long Number of pages in loaded HPGL file.

GetNumPens
Returns the number of pens used for current viewed page. Use EnumeratePen to get real pen numbers.

Syntaxlong GetNumPens();
Parameters None  
Returns long Number of pens used.

GetPageThumbnail
Returns a thumbnail image for the given page.

SyntaxLONG GetPageThumbnail(LONG Page, LONG Width, LONG Height, LONG BitsPerPixel, LONG Flags, IPictureDisp** Thumbnail);
Parameters Page Page number to create a thumbnail of (first page is index 0)
  Width Width of thumbnail image in pixels
  Height Height of thumbnail image in pixels
  BitsPerPixel The bits per pixel controls number of colors to use in the thumbnail image. Set this value to 1 for a monochrome (black & white) image, or 24 for a true color image.
  Flags Reserved for future use, set to 0
  Thumbnail The returned image (IDispatch)
Returns long TRUE if success.

GetPaperSize
Returns the papersize as defined in the HPGL/2 plotter file. The width and height will be set to 0 if the size is not defined in the file.

Syntaxlong GetPaperSize(double *pdW, double *pdH);
Parameters pdW Returned paper width
  pdH Returned paper height
Returns long TRUE if success.

GetPenState
Returns state of the given pen.

SyntaxBOOL GetPenState(long lPen, long *plState);
Parameters lPen Pen number.
  plState Returned pen status (0:Off/1:On).
Returns long TRUE if success.

GetPenTableEntry
Get width, color and style for the given pen table entry.

SyntaxBOOL GetPenTableEntry(long lPen, double *pdWidth, long *pcrColor, long *plStyle);
Parameters lPen Pen number.
  pdWidth Returned pen width.
  pcrColor Returned pen color.
  plStyle Returned pen style (Windows GDI styles).
Returns BOOL TRUE if success.

GetPropertyLong
Return a property long value.
This method is a replacement for properties with parameter, which is not supported by all programming languages.

SyntaxLONG GetPropertyLong(LONG ID, LONG Parameter, LONG* Value);
Parameters ID Identifier of the property value to return. The following values are supported:
  1. Markup Layer State - Parameter is the layer index. If the returned value is non-zero the layer is visible, else it is invisible.
  2. Markup Element State - Parameter is the element handle. If the returned value is non-zero the element is visible, else it is invisible.
  3. Markup Element Page - Parameter is the element handle. The returned value is the page number where the element is located.
  4. Markup Element Lock - Parameter is the element handle. If the returned value is non-zero the element is locked, else it can be modified.
  5. Markup Layer Color - Parameter is the layer index. The returned value is the current layer color.
  6. Markup Element opacity - Parameter is the element handle. The returned value is the element opacity in the range 0 to 100. 100 is full opacity (no transparency).
  7. Markup Element Color - Parameter is the element handle. The returned value is the current outline/draw color.
  8. Markup Element Fill Color - Parameter is the element handle. The returned value is the current fill color.
  Parameter Depends on the ID, see ID above for more information.
  Value Returned value, see ID above for more information.
Returns LONG Non-zero if success.

GetRasterInfo
Get detailed information about a raster image page.
This method works only for raster formats (TIFF,PNG,JPEG,CALS or BMP).

SyntaxLONG GetRasterInfo(LONG lPageNumber, LONG* plPixelWidth, LONG* plPixelHeight, LONG* plDPIx, LONG* plDPIy);
Parameters lPageNumber Page number.
  plPixelWidth Returned width of raster image in pixels.
  plPixelHeight Returned height of raster image in pixels.
  plDPIx Returned horizontal dots per inch used by image.
  plDPIx Returned verical dots per inch used by image.
Returns LONG Nonzero if success.

GetResolution
Returns the resolution of the loaded file in DPI (dots per inch).

SyntaxLONG GetResolution();
Parameters None  
Returns BOOL Dots Per Inch. Zero means unknown.

GetRotatedFileExtent
Returns the extents of the currently loaded file if rotation is used.

SyntaxBOOL GetRotatedFileExtent(long *pWidth, long *pHeight);
ParameterspWidth Returned Width
 pHeight Returned Height
Returns BOOL TRUE if success.

GetVectorLayerInformation
Return information about given vector layer. This function is currently only supported for DWF and DWFx file format.

SyntaxLONG GetVectorLayerInformation(LONG lLayer, BSTR* pLayerName, LONG* lState, OLE_COLOR* crColor);
Parameters lLayer Layer number.
  pLayerName Return name of vector layer.
  lState Return default state for the layer (0=off, 1=on)
  crColor Return default layer color.
Returns LONG Nonzero if success.

GetVectorLayerState
Return status for given vector layer. This function is currently only available for DWF and DWFx file format.

SyntaxLONG GetVectorLayerState(LONG lLayer, LONG* lState);
Parameters lLayer Layer number.
  lState Return current state for the layer (0=off, 1=on)
Returns LONG Nonzero if success.

GetVersion
Returns the version and build number for the control.

SyntaxBOOL GetVersion(long *plMajor,long *plMinor, long *plBuild );
Parameters plMajor Major version number
  plMinor Minor version number
  plBuild Build number
Returns BOOL TRUE if success.

GetViewRect
Return world coordiantes for the currently displayed area of the active file.

SyntaxBOOL GetViewRect(long *x1, long *y1, long *x2, long *y2);
Parameters x1 Return left coordinate of the active displayed area.
  y1 Return upper coordinate of the active displayed area.
  x2 Return right coordinate of the active displayed area.
  y2 Return lower coordinate of the active displayed area.
Returns BOOL TRUE if success

HideToolWindow
Hide the tooltip window if it's visible. The tooltip window is created with the ShowToolWindow method.

Syntaxvoid HideToolWindow();
Parameters none
Returns BOOL no return value.

LoadFile
Load any of the supported file formats for viewing, printing and conversion.

SyntaxBOOL LoadFile(BSTR pFileName);
Parameters pFileName Name of file to load.
Returns BOOL TRUE if file loaded.

LoadFromString
Load HPGL/2 data using a string.
Note: Since data is given as a text string, the method will not accept RTL image data or other binary information.
Only text based HPGL/2 information is accepted.
Use LoadFromStream to load file data that contains binary information.

SyntaxBOOL LoadFromString(BSTR pData);
Parameters pData String containing HPGL/2 instructions.
Returns BOOL TRUE if file loaded.

LoadFromStream
Load file from an IStream. Accepts all supported file types.

SyntaxBOOL LoadFromStream(VARIANT pStream);
Parameters pData VARIANT with IStream interface.
Returns BOOL TRUE if file loaded.

LoadPDFFile
Load a PDF file as raster, vector or native PDF data.

SyntaxLONG LoadPDFFile(BSTR FileName, LONG LoadFormat, LONG BitsPerPixel, LONG DPI);
Parameters pFileName Name of PDF file to load.
  LoadFormat Select which data format to use for loading:
  1. Load as native PDF data (no conversion).
  2. Load as raster data, PDF data will be converted to raster during load. DPI and BitsPerPixel is required for this format.
  3. Load as vector data. This will extract all vector data from the PDF file. Note that the result may differ visually from native PDF viewing. By using this format you can convert the PDF to DXF, PLT and other vector formats.
  BitsPerPixel Select number of colors to use for raster format, supported values:
  1. Monochrome (black and white).
  2. True color.
  DPI Resolution of raster image given in dots per inch. Higher DPI values requires more memory.
Returns BOOL TRUE if file loaded.

LoadPenTable
Load a ViewCompanion compatible pen table file.

SyntaxBOOL LoadPenTable(BSTR pFileName);
Parameters pFileName Name of pentable file to load.
Returns BOOL TRUE if pen table loaded.

MarkupAddFromFile
Add markup elements from an existing file.

SyntaxLONG MarkupAddFromFile(BSTR bstrFileName);
Parameters bstrFileName Name of markup file to load.
Returns LONG Non-zero if markup was loaded.

MarkupAddLayer
Add a new markup layer. You may define up to 256 layers per file.

SyntaxLONG MarkupAddLayer(BSTR LayerName, OLE_COLOR LayerColor, LONG LayerState);
Parameters LayerName Name of layer.
  LayerColor Default color for this layer.
  LayerState Active state for this layer (0 = off, non-zero = on).
Returns LONG Non-zero if layer was added.

MarkupCreateFromXML
Add one or several several elements using XML markup data.
You may find a description of the XML markup format here.
Below is sample XML data for adding a text element:

<?xml version="1.0" encoding="UTF-8"?>
<SCMarkupFormat>
<Header>
   <Unit>mm</Unit>
</Header>
<Elements>
   <Element>
      <type>Text</type>
      <layer>0</layer>
      <page>0</page>
      <insertx>10</insertx>
      <inserty>30</inserty>
      <user>Peter</user>
      <color>#FF0000</color>
      <text>This is a text</text>
      <rotation>0</rotation>
      <font height='10' facename='Times New Roman'/>
   </Element>
</Elements>
</SCMarkupFormat>   
SyntaxLONG MarkupCreateFromXML(BSTR bstrXML);
Parameters bstrXML XML data containing markups to add to active file.
Returns LONG Non-zero if markup was added.

MarkupCreateFromXMLEx
This function is equal to MarkupCreateFromXML but can be used to add a single element only.
The handle for the created element will be returned.
You may find a description of the XML markup format here.

SyntaxLONG MarkupCreateFromXMLEx(BSTR bstrXML, LONG* Handle);
Parameters bstrXML XML data containing markups to add to active file.
Handle Returns the handle for the created element.
Returns LONG Non-zero if markup was added.

MarkupCreatePictureFromStream
Load a picture from stream and add as markup picture.
The stream must contain either BMP, TIFF, PNG or JPEG data.

Syntax LONG MarkupCreatePictureFromStream(VARIANT InputStream, DOUBLE x1, DOUBLE y1, DOUBLE x2, DOUBLE y2, BSTR ID, LONG* Handle);
Parameters InputStream Stream that contains the image data.
  x1 Left position of added picture in world coordinates.
  y1 Bottom position of added picture in world coordinates.
  x2 Right position of added picture in world coordinates.
  y2 Top position of added picture in world coordinates.
  ID Optional string ID, this ID is used for caching image data.
  Handle Handle of the created markup element.
Returns LONG Non-zero if new element was created.

MarkupCounterSettings
Set counter settings and start counting. When counting is ended by the user the number of counted items will be reported by the CounterCompleted event. When a count is started the user can end it by pressing the ESC and RETURN keys, or use right-click with mouse.

SyntaxLONG MarkupCounterSettings(LONG ShapeType, DOUBLE ShapeSize, BSTR CounterLabel);
Parameters ShapeType Shape to use for this count, the following shapes are available:
  1. A filled circle.
  2. A filled square.
  3. A filled triangle.
  4. A filled diamond.
  5. A plus symbol (+).
  6. A filled 5-pointed star.
  ShapeSize Width and height of the counter shape given in millimeters.
  CounterLabelOptional parameter. This may be a label that describe what we're counting, e.g.: "Doors", "Windows", etc.
Returns LONG Non-zero if counting was started.

MarkupDefaultFont
Set default markup font properties like facename, height, weight and character set.

SyntaxLONG MarkupDefaultFont(BSTR FaceName, LONG Height, LONG Weight, LONG CharSet);
Parameters FaceName Font face name (e.g.: Arial).
  Height Height of font.
  Weight Weight of font (e.g.: FW_BOLD or 700).
  CharSet Character set to use.
Returns LONG Non-zero if layer was deleted.

MarkupDeleteElement
Delete a markup element by handle.

SyntaxLONG MarkupDeleteElement(LONG Handle);
Parameters Handle Unique element identifier.
Returns LONG Non-zero if success.

MarkupDeleteLayer
Delete a markup layer by name.

SyntaxLONG MarkupDeleteLayer(BSTR LayerName);
Parameters LayerName Name of layer to delete.
Returns LONG Non-zero if success.

MarkupDeleteLayerNumber
Delete a markup layer by layer number.

SyntaxLONG MarkupDeleteLayerNumber((LONG LayerNumber);
Parameters LayerNumber Layer number to delete.
Returns LONG Non-zero if success.

MarkupDimLineSettings
Change settings, and font, to be used for new dimension line elements.
Below is a picture that shows which part of the dimension line each settings will affect: Dimension Line Settings

SyntaxLONG MarkupDimLineSettings(BSTR FontName, DOUBLE FontHeight, LONG FontWeight, DOUBLE TermSize, LONG TermType, DOUBLE TextOffset, DOUBLE Extension, DOUBLE Offset);
ParametersFontName Fontname, also known as Facename, of font to use for dimension line text.
  FontHeight Height of font in millimeters.
  FontWeight Sets how thick or thin characters in the dimension text should be displayed. The weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.
Here is a list of some predefined values:

 WeightValue
 FW_DONTCARE0
 FW_THIN100
 FW_EXTRALIGHT200
 FW_LIGHT300
 FW_NORMAL400
 FW_MEDIUM500
 FW_SEMIBOLD600
 FW_BOLD700
 FW_EXTRABOLD800
 FW_HEAVY900
  TermSize Size of the terminators in millimeters.
  TermType Terminator type, one of the following:
  1. No terminator used.
  2. Open arrow.
  3. Closed, but not filled, arrow.
  4. Filled arrow.
  5. Filled circle (dot).
  6. Slash.
  TextOffset Distance between the text and the dimension line in millimeters.
  Extenion Length of extension line beyond the dimension line in millimeters.
  Offset Distance in millimeters, of the offset, or gap, between the extension line and actual measured point (origin).
Returns LONG Non-zero if success.

MarkupGetDimensions
Return dimension information for markup elment with given handle.
This method will only work for measurement area and dimension line element types.
The returned values are dependent on the active calibration and the currently selected measurement unit.

SyntaxLONG MarkupGetDimensions(LONG Handle, DOUBLE* Area, DOUBLE* Length);
Parameters Handle Unique element identifier. You may acquire handles by handling the NewElementCreated event, or by enumerating markup elements using the MarkupGetElementHandle method.
  Area Returned area value.
  Length Returned length value. For measurment area element this value is actually the perimeter.
Returns LONG Non-zero if information was returned.

MarkupGetElementAttributes
Get all markup element attributes, like color, with, style and more.

SyntaxLONG MarkupGetElementAttributes(LONG Handle, OLE_COLOR* DrawColor, OLE_COLOR* FillColor, LONG* FillType, DOUBLE* Width, LONG* Style, VARIANT_BOOL* Transparent);
Parameters Handle Unique element identifier. You may acquire handles by handling the NewElementCreated event, or by enumerating markup elements using the MarkupGetElementHandle method.
DrawColor Element line/outline color.
FillColor Element fill color (if element is fillable).
FillType Element fill style, see MarkupFillType for list of supported styles.
Width Element line, or outline, width in millimeters.
Style Element line, or outline, style, see MarkupLineStyle for list of supported styles.
Transparent Element transparency, if non-zero the element is transparent. If set to zero the element is opaque.
Returns LONG Non-zero if information was returned.

MarkupGetElementAttributes2
This method is equal to MarkupGetElementAttributes, but using LONG* instead of OLE_COLOR* as some environements do have problem with OLE_COLOR* parameters. Return all markup element attributes, like color, with, style and more.

SyntaxLONG MarkupGetElementAttributes2(LONG Handle, LONG* DrawColor, LONG* FillColor, LONG* FillType, DOUBLE* Width, LONG* Style, VARIANT_BOOL* Transparent);
Parameters Handle Unique element identifier. You may acquire handles by handling the NewElementCreated event, or by enumerating markup elements using the MarkupGetElementHandle method.
DrawColor Element line/outline color.
FillColor Element fill color (if element is fillable).
FillType Element fill style, see MarkupFillType for list of supported styles.
Width Element line, or outline, width in millimeters.
Style Element line, or outline, style, see MarkupLineStyle for list of supported styles.
Transparent Element transparency, if non-zero the element is transparent. If set to zero the element is opaque.
Returns LONG Non-zero if information was returned.

MarkupGetElementBg
Return background color information for the given element.
Please note that this function is only used for markup image and text element.

SyntaxLONG MarkupGetElementBg(LONG Handle, VARIANT_BOOL *Enabled, OLE_COLOR* BackgroundColor);
Parameters Handle Unique element identifier.
bEnabled Will non-zero if background color is currently used by this element.
BackgroundColor Returned background color.
Returns LONG Non-zero if information was returned.

MarkupGetElementInfo
Return information about a markup elment.

SyntaxLONG Handle, LONG* EntityType, LONG* Layer, LONG* Page, DATE* TimeModified, BSTR* ModifiedBy);
Parameters Handle Unique element identifier. You may acquire handles by handling the NewElementCreated event, or by enumerating markup elements using the MarkupGetElementHandle method.
EntityType Returned elment type.
Layer Returned element layer.
Page Returned element page.
TimeModified Last time this element was modified.
ModifiedBy Name of last user to modify this element.
Returns LONG Non-zero if information was returned.

MarkupGetLayerInfo
Return information about a markup layer.

SyntaxLONG MarkupGetLayerInfo(LONG Layer, BSTR* LayerName, OLE_COLOR* LayerColor, LONG* LayerState);
Parameters Layer Index of layer to query (0 based index).
LayerName Name of layer.
LayerColor Default layer color.
LayerState Current layer state (0=off, non-zero=on).
Returns LONG Non-zero if information was returned.

MarkupGetLayerInfo2
Return information about a markup layer. This method is equal to MarkupGetLayerInfo, but using LONG* instead of OLE_COLOR* as some environements do have problem with OLE_COLOR* parameters.

SyntaxLONG MarkupGetLayerInfo2(LONG Layer, BSTR* LayerName, LONG* LayerColor, LONG* LayerState);
Parameters Layer Index of layer to query (0 based index).
LayerName Name of layer.
LayerColor Default layer color.
LayerState Current layer state (0=off, non-zero=on).
Returns LONG Non-zero if information was returned.

MarkupGetPosition
Get the position for a markup element. Note that this function will only work for elements of following types: rectangle, cloud, circle, stamp, image, ellipse and text.
The coordinates used by this function is given in World coordinate system.

SyntaxLONG MarkupSetPosition(LONG Handle, DOUBLE *x1, DOUBLE *y1, DOUBLE *x2, DOUBLE *y2);
Parameters Handle Unique element identifier.
x1 Left position.
y1 Bottom postion.
x2 Right position.
y2 Top position.
Returns LONG Non-zero if success.

MarkupLayerProtection
Set view and edit restrictions for given markup layer.

SyntaxLONG MarkupLayerProtection(LONG Layer, VARIANT_BOOL View, VARIANT_BOOL Edit, BSTR ViewPassword, BSTR EditPassword);
Parameters Layer Index of layer to protect.
  View If true this layer can always be viewed. If set to false a password for viewing must be provided.
  Edit If true this layer can always be edited. If set to false a password for editing must be provided.
  ViewPassword The password a user must enter to be able to view any markup element placed on this layer.
  EditPassword The password a user must enter to be able to edit any markup element placed on this layer.
Returns LONG Non-zero if success.

MarkupMeasureDefaults
Set default measurement settings to use for created dimension lines and areas.

SyntaxLONG MarkupMeasureDefaults(LONG lUnitType, LONG Digits);
Parameters lUnitType Measurement unit to use for new dimension lines, measurement areas, measurement path and lines:
  1. Millimetres
  2. Centimetres
  3. Decimetres
  4. Meters
  5. Kilometres
  6. Inches
  7. Feets
  8. Yards
  9. Miles
  Digits Number of digits to use for measurement texts (default is 2).
Returns LONG Non-zero if settings applied.

MarkupMeasureFont
Set default font to use for measurement functions.

SyntaxLONG MarkupMeasureFont(BSTR FaceName, LONG FontHeight, LONG FontWeight, LONG CharSet);
ParametersFaceName FaceName, also known as Fontname, of font to use for measurement element text.
  FontHeight Height of font in millimeters.
  FontWeight Sets how thick or thin characters in the dimension text should be displayed. The weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.
Here is a list of some predefined values:

 WeightValue
 FW_DONTCARE0
 FW_THIN100
 FW_EXTRALIGHT200
 FW_LIGHT300
 FW_NORMAL400
 FW_MEDIUM500
 FW_SEMIBOLD600
 FW_BOLD700
 FW_EXTRABOLD800
 FW_HEAVY900
  CharSet Character set to use for measurement text. Should be set to 0.
Returns LONG Non-zero if settings applied.

MarkupMenuDisableItem
This method allows you to remove a item from the markup right click (context) menu.

SyntaxLONG MarkupMenuDisableItem(LONG Command);
Parameters Command The menu item to remove. The following values are available:
32768 Remove the "Properties.." menu item.
32769 Remove the "Change Layer..." menu item.
32770 Remove the "Move to Front" menu item.
32771 Remove the "Send to Back" menu item.
32772 Remove the "Transparent" menu item.
32773 Remove the "Delete" menu item.
32774 Remove the "Copy" menu item.
Returns LONG Non-zero if success.

MarkupSetElementAttributes
Modify markup element attributes like color, with, style and more.

SyntaxLONG MarkupSetElementAttributes(LONG Handle, OLE_COLOR DrawColor, OLE_COLOR FillColor, LONG FillType, DOUBLE Width, LONG Style, VARIANT_BOOL Transparent);
Parameters Handle Unique element identifier. You may acquire handles by handling the NewElementCreated event, or by enumerating markup elements using the MarkupGetElementHandle method.
DrawColor Element line, or outline, color.
FillColor Element fill color (if element is fillable).
FillType Element fill style, see MarkupFillType for list of supported styles.
Width Element line, or outline, width in millimeters.
Style Element line, or outline, style, see MarkupLineStyle for list of supported styles.
Transparent Element transparency, if non-zero the element is transparent. If set to zero (VARIANT_FALSE) the element is opaque.
Returns LONG Non-zero if information was modified.

MarkupSetElementBg
Set background color and control flag for the given element.
Please note that this function is only used for markup image and text element.

SyntaxLONG MarkupGetElementBg(LONG Handle, VARIANT_BOOL Enable, OLE_COLOR BackgroundColor);
Parameters Handle Unique element identifier.
bEnable If non-zero the given background color is will be used for this element.
BackgroundColor The new background color to use.
Returns LONG Non-zero if information was set.

MarkupSetElementInfo
Change markup element layer and page.

SyntaxLONG MarkupSetElementInfo(LONG Handle, LONG Page, LONG Layer);
Parameters Handle Unique element identifier. You may acquire handles by handling the NewElementCreated event, or by enumerating markup elements using the MarkupGetElementHandle method.
Page Set page index where this markup element is located (page index start with 0). You may set page index to -1 for displaying the markup element on all pages in a document.
Layer Set markup layer for this markup element.
Returns LONG Non-zero if information was modified.

MarkupSetLayerInfo
Modify an existing markup layer.

SyntaxLONG MarkupSetLayerInfo(LONG Layer, BSTR LayerName, OLE_COLOR LayerColor, LONG LayerState);
Parameters Layer Markup layer index for layer to be modified.
LayerName New name of layer.
LayerColor New default color to use for this layer.
LayerState New layer state. Non-zero values will make the layer visible, and zero will make the layer invisible.
Returns LONG Non-zero if information was modified.

MarkupSetLayerInfo2
Modify an existing markup layer.

SyntaxLONG MarkupSetLayerInfo(LONG Layer, BSTR LayerName, LONG LayerColor, LONG LayerState);
Parameters Layer Markup layer index for layer to be modified.
LayerName New name of layer.
LayerColor New default color to use for this layer.
LayerState New layer state. Non-zero values will make the layer visible, and zero will make the layer invisible.
Returns LONG Non-zero if information was modified.

MarkupSetPosition
Set a new position for a markup element. Note that this function will only work for elements of following types: rectangle, cloud, circle, stamp, image, ellipse and text.
The coordinates used by this function is given in World coordinate system.

SyntaxLONG MarkupSetPosition(LONG Handle, DOUBLE x1, DOUBLE y1, DOUBLE x2, DOUBLE y2);
Parameters Handle Unique element identifier.
x1 Left position.
y1 Bottom postion.
x2 Right position.
y2 Top position.
Returns LONG Non-zero if success.

MarkupShowLayerDialog
Show the markup layer dialog where you can add and edit markup layers.

SyntaxLONG MarkupShowLayerDialog(LONG ParentWindow);
Parameters ParentWindow Handle to parent window (leave to 0 for active window.
Returns LONG Non-zero if success.

MarkupSave
Save markup elements to given file name using the selected format.

SyntaxLONG MarkupSave(BSTR bstrFileName, LONG FormatType);
Parameters bstrFileName Name of file to save markup to.
FormatType Format to use for saved file. Supported values for format:
  1. Binary Format
  2. XML Format
Returns LONG Non-zero if markup was saved.

MarkupUndo
Undo last markup change. You can undo all changes by setting AllChanges to non-zero.

SyntaxLONG MarkupUndo(LONG AllChanges);
Parameters AllChanges If set to zero the last change will undone, can be called multiple times until all changes are undone.
Set to non-zero to undo all changes in one call.
Returns LONG Non-zero if markup change(s) was undone.

MergeFile
Merge an external file with the currently viewed file, either horizontally or vertically.

SyntaxLONG MergeFile(BSTR FileName, VARIANT_BOOL Horizontal);
Parameters FileName File to be merged with currently viewed file. Note that you can only merge vector with vector and raster with raster.
  Horizontal If true the files will be merged horizontally (side by side). If false the new file will be placed below the active file.
Returns LONG Non-zero if merge was successful.

PDFEncrypt
Encrypt a PDF file using password(s) and restriction settings.

SyntaxHRESULT PDFEncrypt(BSTR OriginalFile, BSTR EncryptedFile, BSTR OpenPassword, BSTR OwnerPassword, LONG Restrictions);
Parameters OriginalFile The original PDF file you want to create an encrypted copy of.
  EncryptedFile The encrypted PDF file. This will be an exact copy of the orignal file but encrypted.
  OpenPassword Optional password required to open the file.
  OwnerPassword Optional owner password.
  Restrictions Set optional user restrictions for the encrypted PDF file.
The following values are available:
  1. No restrictions.
  2. Deny printing.
  3. Deny modification of contents.
  4. Deny copying of contents.
  5. Deny commenting.
  6. Deny all.
The settings may be combined, e.g. set it to 20 (4+16) to deny printing and copying.
Returns HRESULT This function returns S_OK on success.

PDFExportToCAD
Export the active PDF file to vector formats like DXF, DWF, PLT, CGM and more.

SyntaxLONG PDFExportToCAD(BSTR FileName, BSTR Format, LONG Page);
Parameters FileName Name of destination file.
  Format Export format to use for conversion. The following formats are supported:
  • CGM (Computer Graphics Metafile)
  • DWF (Drawing Web Format)
  • DXF (AutoDesk Drawing Exchange Format)
  • GBR (Gerber RS274X)
  • PLT (HPGL/2)
  • SVG (Scalable Vector Format)
  Page Page to convert.
Returns LONG Non-zero if merge was successful.

PDFMergeAddFile
Add a PDF file to the currently merged PDF file.
All pages from the given PDF file will be added to the merged output file.
PDFMergeInit must be called before any PDF file is added.

SyntaxHRESULT PDFMergeAddFile(BSTR PDFFileName);
Parameters PDFFileNameFull path name to the PDF file to add to the currently merged PDF.
Returns HRESULT Returns S_OK if successful. Any other value indicates an error, see GetLastError for more information.

PDFMergeAddFileEx
Add a PDF file to the currently merged PDF file.
The PageInformation parameter controls which pages from the given PDF file that will be added to the merged output file. PDFMergeInit must be called before any PDF file is added.

SyntaxHRESULT PDFMergeAddFile(BSTR PDFFileName, BSTR PageInformation);
Parameters PDFFileNameFull path name to the PDF file to add to the currently merged PDF.
  PageInformationControl which pages that should be imported from the given PDF file. Use ";" to separate pages, e.g.: setting PageInformation to "1,2,10,11" will import pages 1,2,10 and 11 and add to the merged PDF file.
Returns HRESULT Returns S_OK if successful. Any other value indicates an error, see GetLastError for more information.

PDFMergeClose
Close the currently merged PDF file and output to given file name.

SyntaxHRESULT PDFMergeClose(BSTR PDFOutputName);
Parameters PDFOutputNameFull path name of the new PDF file to create.
Returns HRESULT Returns S_OK if successful. Any other value indicates an error, see GetLastError for more information.

PDFMergeInit
Start a new empty PDF file prepared for merging.
Use PDFMergeAddFile to add files, and finally call PDFMergeClose to complete the merge.

SyntaxHRESULT PDFMergeInit();
Parameters None
Returns HRESULT Returns S_OK if successful. Any other value indicates an error, see GetLastError for more information.

PDFReaderUnlock
This method is now obsolete.

SyntaxLONG PDFReaderUnlock(BSTR LicenseKey);
Parameters LicenseKey Obsolete.
Returns BOOL Always returns non-zero.

PDFSplit
Split a multi-page PDF file into smaller files based on user settings.

SyntaxHRESULT PDFSplit(BSTR InputFile, BSTR OutputFolder, BSTR FileLabel, LONG PagesPerFile);
Parameters InputFile The multi-page PDF file that will be split into smaller files.
  OutputFolder A valid folder name for the output files.
  FileLabel Optional label to add to output filenames. By default the output files will be named "inputfilename_1.pdf", "inputfilename_2.pdf" and so on. By adding "part" as label, the output files will be named "inputfilename__part_1.pdf", "inputfilename__part_2.pdf" and so on.
  PagesPerFile Number of pages per output file. If the input document contains 20 pages and you set page per file to 1, the control will create 20 files. If you set pages per file to e.g. 2, the control will output 10 files with 2 pages each.
Returns HRESULT This function returns S_OK on success.

Print
Print the loaded file. You can control the result using the following properties: PrintScale, PrintFitToPaper and PrintCenterOnPage.

SyntaxBOOL Print();
Parameters none  
Returns BOOL TRUE if file printed.

PrintDisplay
Print the current display portion of the loaded file. You can control the result using the following properties: PrintScale, PrintFitToPaper and PrintCenterOnPage.

SyntaxBOOL PrintDisplay();
Parameters none  
Returns BOOL TRUE if file printed.

PrinterName
Return the name of the printer selected by given index. You may use this method together with the InstalledPrinters property to enumerate all installed printers on a system. The returned printer name can be used as parameter to the SelectPrinter method.

SyntaxBSTR PrinterName(LONG Index)
Parameters Index Index of printer name that should be returned.
Return BSTR Name of printer.

PrintMultiPageOnSheet
Print two or more pages on a single sheet of paper. This is also know as n-up printing (2-up, 4-up etc).
E.g.: To use 4-up printing you should set both horizontal and vertical pages parameter to 2 (2x2).

SyntaxLONG PrintMultiPageOnSheet(OLE_HANDLE hDC, LONG lOptions, LONG lHorzPages, LONG lVertPages, LONG lFromPage, LONG lPages);
Parameters hDC Printer device context. Set this to NULL to either use the default printer device, or let the user select a printer.
lOptions Choose from the available options, values may be combined.
  1. Print page delimiters. Display grid lines separating each page on the sheet.
  2. Select and use the default printer device.
  3. Auto-toggle paper orientation. The control will select the paper orientation for maximum use of paper, based on the document extents.
lHorzPages Number of horizontal pages per sheet.
lVertPages Number of vertical pages per sheet.
lFromPage Start page for printing (set to 0 for first page).
lPages Number of pages to print, use the value returned from GetNumPages property to print all pages.
Returns BOOL TRUE if file printed.

PrintPoster
Print the a file using multiple sheets of paper. Usefull for print e.g A0 drawings on a A4 printer in original size (100% scaling).
You can control the number of sheets by using the PrintScale property.

SyntaxBOOL PrintPoster();
Parameters none  
Returns BOOL TRUE if succeeded.

PrintToDC
Print the loaded file using given printer device context (hdc). You can control the result using the following properties: PrintScale, PrintFitToPaper and PrintCenterOnPage.

SyntaxBOOL PrintToDC(OLE_HANDLE PrintDC, LONG PrintType);
Parameters PrintDC Printer device context.
  PrintType
  1. Normal print.
  2. Print the displayed portion of the loaded file.
  3. Print poster mode. See PrintPoster for more information.
Returns BOOL TRUE if file printed.

RasterUndo
Undo last raster operation (e.g.: DeskewImage).

SyntaxLONG RasterUndo(LONG Page);
Parameters Page Undo last raster operation for given page number.
Returns BOOL TRUE if undo was successful.

ScreenToWorld
Scale from screen (pixels) to world coordinates. World coordinates are the loaded file's native coordinate system.

SyntaxBOOL ScreenToWorld(long lScreenX, long lScreenY, long *plWorldX, long *plWorldY);
Parameters lScreenX Screen X coordinate.
  lScreenY Screen Y coordinate.
  plWorldX Transformed World X coordinate.
  plWorldY Transformed World Y coordinate.
Returns BOOL TRUE if success

SaveCompareResult
Save the result of the current comparison to a file.

Syntaxlong SaveCompareResult(BSTR bstrFileName, BSTR bstrFormat, double dScale, long lExportDPI);
Parameters bstrFileName Name of created file.
  bstrFormat Format to use for created file. The following formats are available for this feature:
  • PDF
  • TIFF
  • PNG
  • JPEG
  • PNG
  dScale Scale to use for the created, set to 1.0 for original size.
  lExportDPI DPI to use for the converted file, higher dpi will give higher quality but also larger files.
Returns BOOL TRUE if success

SelectPrinter
Select printer to use by giving Driver, Printer and Port names.
Eg.: SelectPrinter( "HPFDJC15.DRV", "HP DeskJet 895C Series Printer", "" );
NB! Will only work if UseDefaultPrinter property is set to False.

SyntaxBOOL SelectPrinter( LPCSTR szDriverName, LPCSTR szPrinterName, LPCSTR szPortName);
Parameters szDriverName Name of driver.
  szPrinterName Name of printer.
  szPortName Name of port.
Returns BOOL TRUE if success

SetConfigValue
This method can be used to change several settings that are not defined as a property.

SyntaxLONG SetConfigValue(LONG ID, LONG Value);
Parameters ID Unique ID for the setting to be changed. The following values are available:
  1. UseGDIPlus: Use GDI+ instead of GDI for markup drawing. GDI+ is by default enabled, set to 0 to disable it.
  2. CenterMeasureAreaText: If set to 1 the measurement text will be placed in center of new measurement area elements. Default value is 1.
  3. MeasureAreaUseLineWith: Set this value to 1 to use current line width as outline for created measurement area elements. If you set this value to 0 only a one pixel outline will be drawn. Default value is 0.
  4. ShowMeasurePathText: Set this value to 1 to display text for measurement line and polyline elements. If this value is set to 0, no measurement text will be displayed. Default value is 1.
  5. GdiPlusTransparency: Set default transparency value to use for new elements. This value must be between 0 and 255, where 0 is full transparency and 255 is no transparency (opaque). The default value is 200.
  6. LineCapStyle: Set line end cap style to use for new line, polyline and arrow markup elements. Supported values:
    1. Round
    2. Flat
    3. Square
    Default value is round.
  7. MeasurePathCapStyle: Set end line cap style to use for markup measurement path and line elements. Supported values:
    1. Round
    2. Flat
    3. Square
    Default value is flat.
  8. PDFVectorUseRotation: If this value is set to non-zero (true) will PDF files that are loaded as vector, be loaded using the rotation defined in the PDF file. Default value is 0.
  9. MeasureAreaTextBackgroundColor: Set color to use for measurement area text background. By default the current background color is used.
  10. MouseHoverDelay: Set mouse the hovering delay in milliseconds. Set to 0 to use the system default value which is normally 400 milliseconds. Default value is 0.
  11. MeasurePathTextBackgroundColor: Set color to use for measurement path and line text background. By default the current background color is used.
  12. UseLastSavedView: If enabled the displayed view and rotation will be stored in the markup file. When the markup file is loaded the current view including rotation will be restored. Default value is 1.
  13. MarkupFileNameConvention: Choose naming convention to use when loading markup files. The following options is available:
    1. FILENAME.VCM - This will replace any existing file extension with vcm, e.g.: test.vcm
    2. FILENAME.EXT.VCM - This will append the vcm extension to any existing extension, e.g.: test.pdf.vcm
    Please note that you will have to make sure that the correct file name convention is used when you save the markup with the MarkupSave method.
  14. HoverMarkupOnly: If enabled the MarkupMouseHover event will only be called if the mouse is over an markup element. Default value is 1.
  15. FillPolygonWhileDrawing: If enabled, polygonal shapes will be filled while drawing. Set this option to 0 to only display the outline while drawing. Default value is 1.
  16. EnableUCCommand: If enabled, UC commands will be handled. Set to 0 to disable HPGL UC command. Default value is 1.
  17. LinePointEditHandleSize: Set handle size for linepoint editing in pixels. Default value is 15.
  18. HidePlacementText: Used only by the AddImagePlaceholder function. Set to 0 to keep text after the function is used. Default value is 1 (text is hidden).
  19. MarkupImageCache: If set to 1 the control will use a cache for markup pictures loaded from file (XML). Enabling the cache will save a lot of memory if you need to load multiple copies of the same image. Default value is 1.
  20. MarkupAutoRedraw: Set to 0 to disable automatic redraw after a markup property has been changed. By setting this to 0 the application would need to call Invalidate() to redraw the markup. Default value is 1.
  21. UseFileBackColor: Set to 1 to use any background color defined by the loaded file. Many DWF files have a predefined background color, and you should set this configuration value to 1 if you want the control to use this color. Default value is 0.
  22. LoadDWFMarkup: Set to 1 to load AutoDesk Design Review markup from DWF files. If set to 0 all DWF markups will be ignored. Default value is 1.
  23. RestoreMouseAction: Set to 1 to restore previous mouse action after zoom window action is completed. Default value is 1.
  24. AutoUpdateMeasureText: Set to 1 to automatically recalculate all measurement text when calibration is changed. Default value is 1.
  Value Value to set, see specific ID for accpeted values.
Returns LONG Non-zero value if success.

SetIdleImage
Filename or URL to an image file that will displayed in the control when no file is loaded.
This image could be splash screen image or a logo.

SyntaxLONG SetIdleImage(BSTR ImageFileName);
Parameters ImageFileName UNC or URL to a valid image file. Formats supported: TIFF, PNG, BMP and JPEG.
Returns BOOL TRUE if success

SetLicenseOwner
Set the name of the license owner. Will be shown in the About dialog as "Licensed to owner".

SyntaxBOOL SetLicenseOwner( LPCSTR szOwner);
Parameters szOwner License owner.
Returns BOOL TRUE if success

SetMetaFileDPI
Set resolution to use for metafiles copied to clipboard. Default resolution is 96 dpi.

SyntaxBOOL SetMetaFileDPI(long lDPI);
Parameters lDPI Metafile resolution.
Returns BOOL TRUE if success

SetMouseAction
Set active mouse action.

SyntaxLONG SetMouseAction(LONG Action);
Parameters Action Set new active mouse action.
Valid action parameters:
  1. No Action (clear active states)
  2. Set copy as metafile to clipboard mode. Use the mouse to drag a rectangle and the area will be copied to the clipboard.
  3. Activate panning hand mode.
  4. Set edit markup mode.
  5. Set area measurement mode.
  6. Set measurement calibrate mode.
  7. Set distance measurement mode.
  8. Set save selected area to an image file mode. Use the mouse to drag a rectangle and you will then be prompted for file name and file format.
Returns LONG Non-zero if success

SetPanPosition
Set pan values. Used to together with zoom factor to control which part of the loaded file that is currently shown.

SyntaxBOOL SetPanPosition(long lPosX, long lPosY);
Parameters lPosX New horisontal position .
  lPosY New vertical position .
Returns BOOL TRUE if success

SetPDFRasterLoadSettings
Set number of colors and resolution to use if PDF files are loaded as raster. The default values used by scViewerX is 24 bit per pixel and 200 dots per inch.

SyntaxLONG SetPDFRasterLoadSettings(LONG BitsPerPixel, LONG DotsPerInch);
Parameters BitsPerPixel Number of bits per pixel, following values are supported:
  1. Monochrome (black and white only). The PDF file be dithered if it contains color information.
  2. 16 colors.
  3. 256 colors.
  4. True color (16.7 million colors).
  DotsPerInch Resolution given in pixels (dots) per inch, also known as DPI.
Returns LONG Non-zero if success.

SetPDFResourcePath
Set the directory where all the PDF fonts resoure files are located.

SyntaxLONG SetPDFResourcePath(BSTR ResourcePath);
Parameters ResourcePath Folder where PDF font resource files are located.
Returns LONG Non-zero if success.

SetPenState
Set state of the given pen.

SyntaxBOOL SetPenState(long lPen, long lState);
Parameters lPen Pen number.
  lState Pen status (0:Off/1:On).
Returns BOOL TRUE if success.

SetPenTableEntry
Set width, color and style for the given pen table entry.

SyntaxBOOL SetPenTableEntry(long lPen, double dWidth, long crColor, long lStyle);
Parameters lPen Pen number.
  dWidth Pen width in inches.
  crColor Pen Color (Windows COLORREF). When specifying an explicit RGB color, the color value has the following hexadecimal form: 0x00bbggrr.
  lStyle Windows GDI pen style.
The following styles are supported:
#define PS_SOLID       0
#define PS_DASH        1   /* -------  */
#define PS_DOT         2   /* .......  */
#define PS_DASHDOT     3   /* _._._._  */
#define PS_DASHDOTDOT  4   /* _.._.._  */
Returns BOOL TRUE if success.

SetPrintCopies
Set number of copies to use for next print job.
Please note that this method may only be used together with SelectPrinter.

SyntaxLONG SetPrintCopies(LONG Copies);
Parameters CopiesNumber of copies for the next print job.
Returns LONG Non-zero if success.

SetPrintPaperSize
Set paper size and orientation for selected printer.
Please note that this method may only be used together with SelectPrinter.

SyntaxLONG SetPrintPaperSize(LONG Size, LONG Orientation);
Parameters Size Paper format index defined by Windows. You can find a list of available values here: Paper Sizes (Microsoft link) or here Paper Sizes (local copy).
  Orientation Page Orientation to use. Accepted values:
  1. Portrait mode.
  2. Landscape mode.
Returns long Non-zero if success.

SetPropertyLong
Set a property long value.
This method is a replacement for properties with parameter, which is not supported by all programming languages.

SyntaxLONG SetPropertyLong(LONG ID, LONG Parameter, LONG Value);
Parameters ID Identifier of the property value to return. The following values are supported:
  1. Markup Layer State - Parameter is the layer index. If the value is non-zero the layer will be visible.
  2. Markup Element State - Parameter is the element handle. If the returned value is non-zero the element will be visible.
  3. Markup Element Page - Parameter is the element handle. The value is the page number where the element will be located.
  4. Markup Element Lock - Parameter is the element handle. If the value is non-zero the element will be locked, else it can be modified.
  5. Markup Layer Color - Parameter is the layer index. The value is new layer color.
  6. Markup Element opacity - Parameter is the element handle. The value is the new element opacity given in the range 0 to 100. 100 is full opacity (no transparency).
  7. Markup Element Color - Parameter is the element handle. The given value is the new outline/draw color.
  8. Markup Element Fill Color - Parameter is the element handle. The given value is the new fill color.
  Parameter Depends on the ID, see ID above for more information.
  Value New value to set, see ID above for more information.
Returns LONG Non-zero if success.

SetSerialNumber
Unlock the control to use all it's functionality and remove all evaluation messages.
The serial number to use with this method will be provided when you purchase a license.

SyntaxBOOL SetSerialNumber( LPCSTR szSerialNumber);
Parameters szSerialNumber Serial number to unlock control.
Returns BOOL TRUE if a correct serial number is provided.

SetToolWindowStyle
Set font styles and colors used by the tooltip window displayed using ShowToolWindow method.

SyntaxLONG SetToolWindowStyle(OLE_COLOR BackColor, OLE_COLOR TextColor, BSTR FontName, LONG FontSize, LONG CharSet, LONG FontWeight, LONG FontItalic);
Parameters BackColor Background color used for the tooltip window.
  TextColorColor to use for the text inside the tooltip window.
  FontNameName of the font to use.
  FontSize Size of the font in points.
  CharSet Character set to use for the font.
  FontWeight Character weight, e.g.: 0 for normal, 700 for bold (FW_BOLD).
  FontItalic Set this value to non-zero to use an italic style font.
Returns LONG Nonzero if success.

SetTranslationFile
Set full path to the translation file. You can have several translated text resource files with different languages, and can use this method to switch between them dynamically. The English translation file, named scViewerX.TextResources, can be found in the redistribution folders and can be modified using a text editor (e.g.: Notepad).

SyntaxLONG SetTranslationFile(BSTR FileName);
Parameters FileName Full path to an existing translation file.
Returns BOOL Non-zero if file was successfully loaded.

SetUserCursor
Set your own cursor to use for the different mouse functions that are available in the control.

SyntaxBOOL SetUserCursor(enumCursorType lCursorType, OLE_HANDLE hCursor);
Parameters lCursorType Select which cursor to change:
ZoomWindowCursor, PanHandCursor or PressedPanHandCursor.
  hCursorHandle to cursor loaded by LoadResPicture. Example on usage can be found in the VB demo application. Set hCursor to NULL to use the default cursor.
Returns BOOL TRUE if the cursor have been set.

SetVectorLayerState
Set new status for given vector layer.
This function is currently only supported for DWF and DWFx file format.

SyntaxLONG SetVectorLayerState(LONG lLayer, LONG lState);
Parameters lLayer Layer number.
  lState New state for the layer (0=off, 1=on)
Returns LONG Nonzero if success.

SetZoomWindowColors
Customize the colors and linestyle that will be used for the zoom window rectangle.
SetZoomWindowColors(RGB(101, 114, 224), RGB(199, 216, 248), PS_SOLID) will change the zoom window rectangle to a Windows styled zoom window.

SyntaxBOOL SetZoomWindowColors(OLE_COLOR crBorder, OLE_COLOR crFill, long ltBorder);
Parameters crBorder Color to use for the rectangle border.
  crFillFill Color to use for the rectangle.
Set to 0 for no fill.
  ltBorderLinestyle to use for the rectangle. One of the predefined Windows values, e.g. PS_SOLID.
Returns BOOL TRUE if the colors have been set.

SetViewRect
Select a rectangular area of the file that should be viewed. This function uses world coordinates.

SyntaxBOOL SetViewRect(long x1, long y1, long x2, long y2);
Parameters x1 Left coordinate of area to show.
  y1 Upper coordinate of area to show.
  x2 Right coordinate of area to show.
  y2 Lower coordinate of area to show.
Returns BOOL TRUE if success

SetZoomType

SyntaxBOOL SetZoomType(long nZoomType);
Parameters nZoomType Set Zoom Type, one of the following:
1. Zoom All
2. Zoom To Width
3. Zoom In
4. Zoom Out
5. Zoom Window
6. Pan Center
7. Panning Hand
8. Zoom In/Out mode.
9. Zoom to Height.
10.Zoom to 1:1 (Actual Size).
Returns BOOL TRUE if success

ShowToolWindow
Show a tooltip window containing a text message that you want to display to the user.
You may modify the font and colors using the SetToolWindowStyle method.

SyntaxLONG ShowToolWindow(LONG x, LONG y, BSTR MessageText, LONG TimeOut);
Parameters x Horizontal position of the tooltip window in screen coordinates.
  y Vertical position of the tooltip window in screen coordinates.
  MessageText The text you want to display in the tooltip window. The text may contain several lines, use LF (\n) to separate lines.
  TimeOut Number of milliseconds the window will stay visible until it is removed.
Returns LONG Nonzero if success.

WorldToScreen
Scale from world to screen coordinates. World coordinates are the loaded file's native coordinate system.

SyntaxBOOL WorldToScreen(long lWorldX, long lWorldY, long *plScreenX, long *plScreenY);
Parameters lWorldX World X coordinate.
  lWorldY World Y coordinate.
  plScreenX Transformed Screen X coordinate.
  plScreenY Transformed Screen Y coordinate.
Returns BOOL TRUE if success


Properties

AdjustColorFlag
If this flag is to TRUE all colors equal to, or near, the background color will be inverted to make sure the geometry is visible.
Default Value : FALSE

AntiAliaseRaster
If this flag is to TRUE all raster images will be drawn with better quality when the image is scaled down.
Default Value : TRUE

ArcResolution
Set the number of line segments a circle or arc will be drawn with.
Default Value : 60

BackColor
Set background color to use.

BorderStyle
Set style for border.

Calibration
Set calibration value to use for markup measurement functions.
If you have a drawing which is e.g.: 1:10 (1 measured millimeter equals 10 millimeters in the real world, you should set the value to 10.0.
Default Value : 1.0

CalibrationDefaultUnit
Set default calibration unit for calibration dialog.
Following values are supported if you are using metric measurement:

  1. mm
  2. cm
  3. dm
  4. m
  5. km
Following values are supported if you are using imperial measurement:
  1. inch
  2. feet
  3. yard
  4. mile
Default Value : 0

CenterImage
If this option is enabled the image will be centred on the screen when zoomed out.
The area outside the image will be filled with the color defined by WorkspaceColor property.
Default Value : FALSE

CurrentPage
Controls the page currently show in the control.
Default Value : 0

DialogEnableFlags
A flag for disabling or enabling control dialogs (e.g.: calibration).
By default all dialogs are enabled. If you disable a dialog an event will be called instead.
The following flags are supported:

  1. If bit is set the calibration dialog will be enabled.
  2. If bit is set the markup element property dialog will be displayed when double-clicking an element.
Default Value : 0xFFFFFFFF (all bits enabled, all control dialogs enabled).

DXFWriterMM
If enabled all DXF files be written using coordinates in millimeter. If disabled DXF files will use Inch coordinates.
Default Value : TRUE

DXFLineWeightFlag
This property controls how lineweights should be written to a DXF file. Please note that AutoCAD only support specific values for lineweights, but the control can be configured to write any value.
The following values is supported:

  1. Only write values supported by AutoCAD. All other values will be rounded up/down to nearest valid value.
  2. Only write values supported by AutoCAD. All other values will be set to lineweight value 0.
  3. Write any lineweight value. Using this option may cause the DXF to be incompatible with AutoCAD, but it will load in many other applications.
AutoCAD supports the following lineweight values: 0, 5, 9, 13, 15, 18, 20, 25, 30, 35, 40, 50, 53, 60, 70, 80, 90, 100, 106, 120, 140, 158, 200 and 211.
Default Value : 0

DXFLineWeights
If enabled the control will write lineweights to the DXF file (DXF code 370), if set to FALSE/zero no lineweights will be written.
See DXFLineWeightFlag for more information.
Default Value : TRUE

EnableAboutBox
The About item will be visible in the context menu if this set to TRUE.
(Only valid if control is licensed).
Default Value : TRUE

EnableContextMenu
Allows the user to use the right-click popup menu if set to TRUE.
Default Value : TRUE

EnableContextMenuPrint
The Print item will be visible in the context menu if this property set to TRUE.
Default Value : TRUE

EnableMarkupContextMenu
Disable or enable the context menu which is displayed when an user right-clicks a selected markup element.
Default Value : TRUE

ExportAlignmentH
Controls placement of exported drawing if the exported "page" width is larger than the drawing width.
Used by the ExportExtents method.
Available values : hLeft, hCenter and hRight.
Default Value : hLeft

ExportAlignmentV
Controls placement of exported drawing if the exported "page" height is larger than the drawing height.
Used by the ExportExtents method.
Available values : vTop, vMiddle and vBottom.
Default Value : vTop

Flip
Flip the image vertically if set to TRUE.
Default Value : FALSE

ForeColor
Set foreground color to use when monochrome drawing is enabled.

Grayscale
Set grayscale mode. All colors will be replaced by gray colors.
Default Value : FALSE

HaveRaster
This property will return a non-zero value if the loaded file contains raster images (e.g.: A HPGL/2 with HP-RTL information).
Default Value : Depend of loaded file

InstalledPrinters
This property will return the number of installed printers in a system. Use this property together with the PrinterName method to enumerate all printers on a system.
Default Value : System dependent

IsRasterFormat
This property will return a non-zero value if the loaded file is a raster (image) file (E.g.: TIFF, JPEG, CALS etc).
If you have a raster format you may use the DeskewImage method.
Default Value : Depend of loaded file

LoadDWFPaperSize
Set this property to non-zero (true) to configure the DWF reader to load all files with paper size settings (if available).
If you set this property to zero (false), all DWF files be will loaded with drawing extents.
Default Value : TRUE

Grayscale
Set grayscale mode. All colors will be replaced by gray colors.
Default Value : FALSE

LoadedFormatType
Returns format of currently loaded file.
One of the following values is returned:

  1. No file is loaded
  2. HPGL/2.
  3. Gerber RS-274D.
  4. Gerber RS-274X.
  5. Calcomp plotter format.
  6. CALS.
  7. TIFF.
  8. PNG.
  9. Windows BMP.
  10. JPEG.
  11. CGM (Computer Graphics Metafile).
  12. AutoDesk DWF.
  13. Adobe PDF.
  14. JEDMICS C4 (tiled group 4).
  15. WebP image format.

LoadEmbeddedRaster
Control if embedded raster (RTL) should be loaded or not.
Default Value : TRUE

MarkupIsModified
Returns TRUE if any markup elements has been modified, or are added.
Read Only

MarkupCanUndo
Returns TRUE if any markup elements has been modified and undo action is possible.
If this property returns TRUE you can undo the last change by calling the MarkupUndo method.
Read Only

MarkupDimLineWidth
Get or set line width in millimeter to use for new markup dimension line elements.
Default Value : 0.125 mm

MarkupDrawColor
Get or set draw color to use for added markup elements (lines and outlines).
Default Value : 0xFF0000

MarkupDrawElement
Set active markup element draw type.
Following values are supported:

  1. Line
  2. Freehand
  3. Rectangle
  4. Ellipse
  5. Polygon
  6. Arrow
  7. Text
  8. Picture
  9. Arrow with Text
  10. Revision Cloud
  11. Note
  12. Wave (sound)
  13. Stamp
  14. Eraser
  15. Rectangular Eraser
  16. Polygon Eraser
  17. Dimension Line
  18. Area Measurement
  19. Polyline
  20. Symbol (see note 1 below)
  21. Circle
  22. Counter (see note 2 below)
  23. Measure Line (see note 3 below)
  24. Measure Polyline (see note 4 below)
Notes:
1. Symbol element is currently not supported.
2. Counter element is only included for reference, to draw counter elements you must use the MarkupCounterSettings method.
3. Measure Line is same as line element, but with attached measurement text.
3. Measure Polyline is same as Polyline element, but with attached measurement text.

MarkupElementName
Set, or read, a unique user defined name that will be associated with the given markup element.
Parameters:
   Handle: Element identifier.
Default Value : none

MarkupElementGroup
Set, or read, a user defined group name that will be associated with the given markup element. The same name may be given to several different elements, to show that these elements belong to the same group. Sample usage: "Room 1", "Room 2" etc.
Parameters:
   Handle: Element identifier.
Default Value : none

MarkupElementLock
Lock or unlcok the given markup element.
Use value 1 to lock an element and 0 to unlock it.
A locked element cannot be modified.
Parameters:
   Handle: Element identifier.
Default Value : 0

MarkupElementOpacity
Set, or get, the opacity for the given markup element.
Opacity values are given in the range from 0.0 to 1.0, where 1.0 is 100% opacity (no transparency at all).
Parameters:
   Handle: Element identifier.
Default Value : 1.0

MarkupElementPage
Set, or get, the page number (zero index based) for the given markup element.
You may set the page number to -1 to display the element on all pages in a multi-page document.
Parameters:
   Handle: Element identifier.
Default Value : page number for which the markup element was created

MarkupElementState
Set, or get, the display state for the given markup element.
Parameters:
   Handle: Element identifier.
Default Value : 1

MarkupElementText
Get or set text for given markup handle.
Parameters:
   Handle: Unique element identifier.
Default Value : none

MarkupFillColor
Get or set fill color to use for new filled markup elements.
Default Value : 0xFF0000

MarkupFillType
Get or set fill type to use for new filled markup elements.
Following values are valid:

  1. Outlined
  2. Solid
  3. Horizontal Hatch
  4. Vertical Hatch
  5. Cross Hatch
  6. Diagonal Hatch
  7. Diagonal Cross Hatch
Default Value : 1

MarkupFolder
Get or set the current markup folder. Use this property to setup the control to use a common folder for all markup files.
Default Value : none

MarkupHatchSpacing
Set hatch pattern distance in millimeters. This distance is only used if fill type is set to type 2 to 6.
Default Value : 2.5 mm

MarkupHighlightColor
Get or set color to use for new markup highlight elements.
Default Value : 0xFFAD5B

MarkupLayer
Get or set layer number to use for created markup elements.
Default Value : 0

MarkupLayerColor
Get or set active color for given markup layer.
Parameters:
   Layer: Markup layer index.
Default Value : none

MarkupLayerState
Get or set visibility state for given markup layer.
Parameters:
   Layer: Markup layer index.
Default Value : none

MarkupLineStyle
Get or set current line style.
Following styles are supported:

  1. Solid
  2. Dash
  3. Dot
  4. Dash dot
  5. Dash dot dot
Default Value : 0

MarkupLineWidth
Get or set line width in millimetres to use for added markup elements.
Default Value : 0.125 mm

MarkupMTextColor
Get or set the color to be used for markup measurement element text content. By default all measurement elements will use the current draw color for it's text. You can use this property to set a separate text color for all created measurement elements, independent of the current draw color.
Default Value : 0xFFFFFFFF (which indicates that the current draw color will be used for the measurement text)

MarkupNumElements
Return number of markup elements.
Default Value : 0

MarkupNumLayers
Return number of available markup layers.
User defined layers can be added by using the MarkupAddLayer method.
Default Value : 1

MarkupShow
Toggle display of markup elements on/off.
Default Value : TRUE

MarkupShowDimText
Toggle display of markup dimension and measurement path text on/off.
Default Value : TRUE

MarkupShowAreaText
Toggle display of markup area measurement text on/off.
Default Value : TRUE

MarkupSnapEnable
Enables or disables snap to drawing geometry when drawing markup elements.
Default Value : TRUE

MarkupTransparency
Get or set transparency flag for added markup elements.
Default Value : TRUE

MarkupUser
Get or set name of active commenter.
Default Value : Currently logged on user.

Mirror
Mirror the image horizontally if set to TRUE.
Default Value : FALSE

Monochrome
If TRUE the loaded file will be shown in monochrome.
Default Value : FALSE

MouseWheelZoomPan
Enable or disable the use of the mouse wheel button for zooming and panning operations.
If TRUE the mouse wheel button with be used for zooming by scrolling the wheel to zoom in out, and for panning by pressing the wheel button down while moving the mouse.
Default Value : TRUE

NumMeasurePnts
Return the number of points available in the latest measurement operation.
Default Value : none

NumNamedViews
Return the number of named views in the current active file.
This property is currently only supported for DWF/DWFx files.
Default Value : none

NumVectorLayers
Return the number of vector layers in the current active file.
This property is currently only supported for DWF/DWFx files.
Default Value : none

PDFLargeFormat
Enables or disables creation of large format PDF files (files with extents beyond 5x5m).
Default Value : TRUE

PDFReadEnabled
Enables or disables loading of PDF files. If you don't have a valid PDF unlock code, you may want to disable the PDF reader.
Default Value : TRUE

PDFTransparency
Enables or disables use of transparency in exported PDF files.
Some printer drivers doesn't support transparency, and turning of transparency during PDF conversion will make sure your files will print faster.
Default Value : TRUE

PDFWriterFormat
Select PDF standard to use for converted PDF files, following options is available:

  1. PDF 1.6 (editable).
  2. PDF/A-1B.
  3. PDF/A-2B.
Default Value : 2

PrintCenterOnPaper
If TRUE the printed drawing will be centered on the paper.
Default Value : TRUE

PrintFitToPaper
If TRUE the printed drawing will scaled to fit the paper.
Default Value : TRUE

PrintScale
Scaling to use when printing the drawing. The scaling is in percentage, eg. 100 is 1:1.
NB! If PrintFitToPaper is enabled, this scale factor is ignored.
Default Value : 100.0 (100%)

RasterCanUndo
Use this property to check if there is any undoable raster operations available.
Parameters:
Page: Page number to check for raster changes.
Will be non-zero if you can undo operations like DeskewImage with the RasterUndo method.
Default Value : none

Rotation
The rotation to use when the file is displayed. Legal values is between 0.0 and 360.0.
Default Value : 0

ScalePenTable
If TRUE, the pentable widths will be scaled together with the drawing.
Default Value : TRUE

ShowScrollBars
Controls if the scrollbars should be shown or not.
Default Value : TRUE

SnapEnable
Enables or disables snap to drawing geometry.
Snapping is available for calibration, measurement and markup draw modes.
Default Value : TRUE

TIFFSingleStripMode
Controls if created TIFF files should be using a single strip, or multiple.
Single-strip TIFF files are usually smaller (in terms of file size), but may require an application to use more memory when working with the TIFF file.
Default Value : FALSE

TransparentRaster
If TRUE all raster images will be drawn using transparency.
Windows 2000/XP only.
Default Value : TRUE

TrueSize
If TRUE all polygons will be filled, and thick lines will be shown using their real width.
Default Value : TRUE

UseDefaultPrinter
If this property is set to TRUE (non-zero) the control will use the default printer when printing. If FALSE (zero), a Printer Setup Dialog box will be shown when printing is invoked.
Default Value : TRUE

UseFilePaperSize
If TRUE, the original paper size, if available, will be used when converting, instead of the calculated extents of all drawing entities.
Use this property to maintain any white space borders around the drawing.
Default Value : FALSE

UsePenTable
If TRUE, the current loaded or set pentable will be used when drawing,printing and converting.
Default Value : FALSE

WorkspaceColor
Color to use when filling area outside image area.
Default Value : Depending on the active Windows desktop theme.

ZoomFactor
Set/get current zoom factor.


ScViewerX Events

AfterPrint
void AfterPrint(long lHDC, long lPage)
Called after the loaded file has been printed but before the page is sent to the printer.
This event allows client application to add information to the page by using the given hdc (Windows GDI device context). The lPage parameter contains the number for the page that is printed.

CalibrationComplete
void CalibrationComplete(DOUBLE MeasuredValue)
Called after user calibration is completed. The user have selected two points in the drawing, and the parameter MeasuredValue is the distance between these points in millimeters.

CounterCompleted
void CounterCompleted(LONG Count, BSTR CounterLabel)
Called after a count of items have been completed.
The number of counted items are available in the Count parameter.
The CounterLabel parameter will be the same text that was passed to MarkupCounterSettings.

DeleteElementConfirm
void DeleteElementConfirm(LONG Handle, LONG *Action)
Called before an element is about to be deleted.
You may show a dialog, or a messagebox, to the user where the user is asked to confirm the deletion.
Parameter Handle is a unique identifier to the deleted element.
You may return 3 different values using the Action paramter:

  1. Do not delete element. The element will stay selected.
  2. Delete the item and add it to the undo buffer.
  3. Delete the item but do not add it to the undo buffer.

ElementDeleted
void ElementDeleted(long Handle)
Called each time a markup element is deleted.
Parameter Handle is a unique identifier to the deleted element.

ElementModified
void ElementModified(long Handle)
Called each time a markup element is modified by the user or your application.
Parameter Handle is a unique identifier to the modified element.

FileLoadComplete
void FileLoadComplete( void )
This event is called when the file is completely loaded.

FileOpenPassword
void FileOpenPassword( BSTR *Password)
This event is called when the file the uses tries to open do require a password (e.g.: Password protected PDF file).
The event will be called 3 times, or until a correct password is provided.

MarkupMouseHover
void MarkupMouseHover( LONG x, LONG y, LONG handle)
Called when mouse is hovering on top of a markup element.
The x and y parameters is the actual screen position of the mouse cursor.
The handle parameter is the markup elements unique identifier. You may pass the handle parameter to functions like MarkupGetElementInfo to obtain more information about the markup element.

MeasureComplete
void MeasureComplete(LONG MesureType, DOUBLE Length, DOUBLE Area, DOUBLE Perimeter)
Called after a user measurement is completed. The MeasureType parameter will tell if this an area or a distance measurement.
MeasureType can contain the following values:

  1. Area Measurement (Mouse action type 10)
  2. Distance Measurement multiple points (Mouse action type 12)
  3. Distance Measurement two points (Mouse action type 9)
All measurement values are scaled using the active calibration.

MeasuredValue
void MeasureComplete(LONG MesureType, DOUBLE Length, DOUBLE Area, DOUBLE Perimeter)
Called during measurement each time the mouse is moved.
This can be used to display the current measured value to the user in e.g.: status bar.
The MeasureType parameter will tell if this an area or a distance measurement.
MeasureType can contain the following values:

  1. Area Measurement (Mouse action type 10)
  2. Distance Measurement multiple points (Mouse action type 12)
  3. Distance Measurement two points (Mouse action type 9)
All measurement values are scaled using the active calibration.

MouseDown
void MouseDown(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y)
Called each time user has pressed a mouse button.
Stock Property.

MouseMove
void MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y)
Called each time user moves the mouse.
Stock Property.

MouseUp
void MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y)
Called each time user frees a pressed mouse button.
Stock Property.

NewElementCreated
void NewElementCreated(LONG Handle)
Called each time a new markup element is created.
Parameter Handle is a unique identifier to the new element.

Progress
void Progress(long lPercent)
Called during load time. Allows the client to show a progress meter.

ZoomChanged
void ZoomChanged(void)
Called each time scaling and pan parameters are changed.


Context Menu

The context menu is shown when the user clicks the right mouse button inside the control's window. You can use the EnableContextMenu property to disable or enable the menu.
The image below shows the context menu. To the right of the image you will see a brief description of each item in the menu:
scviewerx context menu
Zoom All Show the whole image inside the control window.
Zoom In Increase scaling factor by 50%.
Zoom Out Decrease scaling factor by 50&.
Zoom Window Select a region with the mouse that will fit the control window.
Pan Hand Move around the image by pressing left mouse button and moving the cursor.
Print Print the image using current settings. This item can be hidden (see EnableContextMenuPrint).
About Shows information about the program and company. This item can be hidden (see EnableAboutBox).

©Software Companions

http://www.softwarecompanions.com