Exported Functions

The DLL exports several function for that may be called directly without any use of COM. Most languages can use these functions, for example C++, VB.Net, C#, Java and much more. In this section you will find a description of all the exported functions that are available.
A C++ sample that demonstrates how to use the exported functions can be found here.

scCheckFormat

Check if the given file can be opened by the converter.
Unicode version.

Syntaxint scCheckFormat( WCHAR *InputFile, long *Format );
Parameters InputFile Name of the file to check.
Format Returned file format identifier if file can be opened by this converter.
One of the following values is returned:
  1. Unknown file format
  2. HPGL/2
  3. TIFF
  4. CALS
  5. PNG.
  6. JPEG.
  7. Windows BMP.
  8. CGM (Computer Graphics Metafile).
  9. Calcomp Plot Format
  10. Autodesk DWF.
  11. Gerber Plot Format.
  12. Adobe PDF.
Returns int Error code, zero if success. If successfully checked the file format identifier will be returned using the Format parameter.
Please see GetLastError for a description of possible error codes.

scCheckFormatA

Check if the given file can be opened by the converter.
Multibyte version.

Syntaxint scCheckFormat( CHAR *InputFile, long *Format );

Please see scCheckFormat above for a description of the different parameters.

scConvertFile

Convert the input file to a new file using the given format.
Unicode version.

Syntaxint scConvertFile( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, WCHAR *Format, double Scale, long BitsPerPixel, long DPI );
Parameters SerialNumber Your serial number.
inputFileName Name of file to convert.
outputFileName Name of destination file.
  Format Select output format to use.
The following formats are supported:
  • BMP (Windows Bitmap)
  • CALS (CALS Type 1 CCITT-G4 Raster Format)
  • CGM (Computer Graphics Metafile)
  • DWF (Drawing Web Format)
  • DXF (AutoDesk Drawing Exchange Format)
  • EMF (Windows Enhanced Metafile)
  • GBR (Gerber RS274X)
  • HPRTL(HP-RTL)
  • JPEG (JFIF Compliant)
  • PCX (Paintbrush Format)
  • PDF (Acrobat PDF)
  • PDFRASTER (Acrobat PDF raster).
  • PNG (Portable Network Graphics)
  • PS (Adobe Postscript)
  • SVG (Scalable Vector Format)
  • TIFF (Tagged Image File Format)
  • WMF (Windows Metafile)
  dScale Scalefactor.
  lBitsPixel Bits Per Pixel (Used for raster only).
  lDPI Pixels per Inch (Used for raster only).
Returns int Error code, zero if file was successfully converted.
Please see GetLastError for a description of possible error codes.

scConvertFileA

Convert the input file to a new file using the given format.
Multibyte version.

Syntaxint scConvertFile( CHAR *SerialNumber, CHAR *InputFile, CHAR *OutputFile, CHAR *Format, double Scale, long BitsPerPixel, long DPI );

Please see scConvertFile above for a description of the different parameters.

scConvertFilePage

Convert a single page from the input file into a new file using the given format.
Unicode version.

Syntaxint scConvertFile( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, WCHAR *Format, long Page, double Scale, long BitsPerPixel, long DPI );
Parameters SerialNumber Your serial number.
inputFileName Name of file to convert.
outputFileName Name of destination file.
  Format Select output format to use.
The following formats are supported:
  • BMP (Windows Bitmap)
  • CALS (CALS Type 1 CCITT-G4 Raster Format)
  • CGM (Computer Graphics Metafile)
  • DWF (Drawing Web Format)
  • DXF (AutoDesk Drawing Exchange Format)
  • EMF (Windows Enhanced Metafile)
  • GBR (Gerber RS274X)
  • HPRTL(HP-RTL)
  • JPEG (JFIF Compliant)
  • PCX (Paintbrush Format)
  • PDF (Acrobat PDF)
  • PDFRASTER (Acrobat PDF raster).
  • PNG (Portable Network Graphics)
  • PS (Adobe Postscript)
  • SVG (Scalable Vector Format)
  • TIFF (Tagged Image File Format)
  • WMF (Windows Metafile)
  Page Index of the page to extract from the input file, and convert to a new output file. First page number is 0 (zero indexed).
  Scale Scalefactor.
  BitsPixel Bits Per Pixel (Used for raster only).
  DPI Pixels per Inch (Used for raster only).
Returns int Error code, zero if file was successfully converted.
Please see GetLastError for a description of possible error codes.

scConvertFilePageA

Convert the input file to a new file using the given format.
Multibyte version.

Syntaxint scConvertFile( CHAR *SerialNumber, CHAR *InputFile, CHAR *OutputFile, CHAR *Format, long Page, double Scale, long BitsPerPixel, long DPI );

Please see scConvertFile above for a description of the different parameters.

scConvertToImageFile

Convert the input file to a new image file of the given file format. This function gives better control of the created image.
Unicode version.

Syntaxint scConvertToImageFile( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, WCHAR *Format, long Page, double Scale, long ImageWidth, long ImageHeight, long BitsPerPixel, long DPI, long Flags, double dOffsetX, double dOffsetY );
Parameters SerialNumber Your serial number.
Parameters InputFile Name of file to convert.
OutputFile Name of destination file.
  Format Select output format to use.
The following formats are supported by this method:
  • BMP (Windows Bitmap)
  • CALS (CALS Type 1 CCITT-G4 Raster Format)
  • JPEG (JFIF Compliant)
  • PCX (Paintbrush Format)
  • PDF (Acrobat PDF)
  • PDFRASTER (Acrobat PDF raster).
  • PNG (Portable Network Graphics)
  • TIFF (Tagged Image File Format)
  Page Page number to convert to image.
  ScaleFactor Scalefactor to use for conversion, 1.0 is original size.
  ImageWidth Width of the destination image file in pixels.
  ImageHeight Height of the destination image file in pixels.
  BitsPixel Bits Per Pixel.
  DPI Pixels per Inch.
  Flags Reserved (set to 0).
  OffsetX Left offset in pixels.
  OffsetY Top offset in pixels.
Returns int Error code, zero if file was successfully converted.
Please see GetLastError for a description of possible error codes.

scConvertToImageFileA

Convert the input file to a new image file of the given file format. This function gives better control of the created image.
Multibyte version.

SyntaxscConvertToImageFileA( char *SerialNumber, char *InputFile, char *OutputFile, char *Format, long Page, double Scale, long ImageWidth, long ImageHeight, long BitsPerPixel, long DPI, long Flags, double dOffsetX, double dOffsetY );

Please see scConvertToImageFile above for a description of the different parameters.

scConvertToPaperSize

Convert the input file to a new file using the given format. The output file will be scaled to fit the given paper index.
Unicode version.

Syntaxint scConvertToPaperSize( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, WCHAR *Format, LONG PaperSizeIndex, BOOL KeepPaper, LONG Page, LONG BitsPerPixel, LONG DPI );
Parameters SerialNumber Your serial number.
InputFileName Name of file to convert.
OutputFileName Name of destination file.
  Format Select output format to use.
The following formats are supported:
  • BMP (Windows Bitmap)
  • CALS (CALS Type 1 CCITT-G4 Raster Format)
  • CGM (Computer Graphics Metafile)
  • DWF (Drawing Web Format)
  • DXF (AutoDesk Drawing Exchange Format)
  • EMF (Windows Enhanced Metafile)
  • GBR (Gerber RS274X)
  • HPRTL(HP-RTL)
  • JPEG (JFIF Compliant)
  • PCX (Paintbrush Format)
  • PDF (Acrobat PDF)
  • PDFRASTER (Acrobat PDF raster).
  • PNG (Portable Network Graphics)
  • PS (Adobe Postscript)
  • SVG (Scalable Vector Format)
  • TIFF (Tagged Image File Format)
  • WMF (Windows Metafile)
  PaperSizeIndex The index of the predefined paper size to use for conversion. Please see ConvertToPaperSize method for a list of available paper sizes.
  KeepPaper If enabled margins will be added if necessary, to make sure the output use the exact paper size.
  Page Page number to convert. Page numerbring starts at 0. Set this parameter to -1 convert all pages in a multi-page document.
  BitsPixel Bits Per Pixel (Used for raster only).
  DPI Pixels per Inch (Used for raster only).
Returns int Error code, zero if file was successfully converted.
Please see GetLastError for a description of possible error codes.

scConvertToPaperSizeA

Convert the input file to a new file using the given format. The output file will be scaled to fit the given paper index.
Multibyte version.

Syntaxint scConvertToPaperSize( char *SerialNumber, char *InputFile, char *OutputFile, char *Format, LONG PaperSizeIndex, BOOL bKeepPaper, LONG Page, LONG BitsPerPixel, LONG DPI );

Please see scConvertToPaperSize above for a description of the different parameters.

scGetFileDimensions

Return dimensions of the given page in the given file.
All returned values are in millimeters.
Unicode version.

Syntaxint scGetFileDimensions( WCHAR *InputFile, long Page, double *OffsetX, double *OffsetY, double *Width, double *Height, long *Rotation );
Parameters InputFile Full path to the file to inspect.
Page Selected page number.
OffsetX Original file x offset of the selected page.
OffsetY Original file y offset of the selected page.
Width Width of the selected page.
Height Height of the selected page.
Rotation File rotation in angles (only returned for HPGL/2 files - RO instruction).
Returns int Error code, zero if file was successfully inspected.
Please see GetLastError for a description of possible error codes.

scGetFileDimensionsA

Return dimensions of the given page in the given file.
All returned values are in millimeters.
Multibyte version.

Syntaxint scGetFileDimensions( CHAR *InputFile, long Page, double *OffsetX, double *OffsetY, double *Width, double *Height, long *Rotation );

Please see scGetFileDimensions above for a description of the different parameters.

scGetNumFilePages

Return the number of pages in the given file.

Syntaxint scGetNumFilePages( WCHAR *InputFile, long *Pages);
Parameters InputFile Full path to the file to inspect.
Pages Number of pages in the given file.
Returns int This function returns zero if successful.

scGetNumFilePagesA

Return the number of pages in the given file.

Syntaxint scGetNumFilePagesA( char *InputFile, long *Pages);
Parameters InputFile Full path to the file to inspect.
Pages Number of pages in the given file.
Returns int This function returns zero if successful.

scGetProperty

Return the value of the property with the give ID.

Syntaxint scGetProperty( long ID );
Parameters IDValue for the the property to read, the following values are available:
  1. Use Paper Size defintion, if available, from input file.
  2. Background color. See Background COM property for more information.
  3. Adjust colors.If enabled, a color that's too close to he background color, will be inverted. E.g. A white line on white background will be drawn with black color if this option is enabled.
  4. Monochrome mode. See Monochrome COM property for more information.
  5. PDF output standard selection. See PDFWriterFormat COM property for more information.
  6. PDF large format mode. See PDFLargeFormat COM property for more information.
  7. PDF Layers. See PDFLayers COM property for more information.
  8. PDF monochrome raster compression. See the PDFMonoRasterCompression COM property for more information.
  9. TIFF single strip mode. See the TIFFSingleStrip COM property for more information.
  10. Use RO instruction. See the scUseROInstruction function for more information.
  11. Load DWF Markup. If set to 1 markup created by Autodesk Design Review will be loaded and included in the conversion. Set this property to 0 to ignore markup created by Autodesk Design Review.

scImportersPath

Set path to where the additional file importers are located.
Unicode version.

Syntaxvoid scImportersPath( WCHAR *Path );
Parameters Enable Unicode string containing path to additional file importer location.
Returns void

scImportersPathA

Set path to where the additional file importers are located.
ANSI (multibyte) version.

Syntaxvoid scImportersPath( CHAR *Path );
Parameters Enable Multibyte string containing path to additional file importer location.
Returns void

scPDFEncrypt

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

Syntaxint PDFEncrypt(WCHAR *OriginalFile, WCHAR *EncryptedFile, WCHAR *OpenPassword, WCHAR *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 int This function returns zero on success.

scPDFEncryptA

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

Syntaxint PDFEncryptA(char *OriginalFile, char *EncryptedFile, char *OpenPassword, char *OwnerPassword, LONG Restrictions);

Please see scPDFEncrypt above for a description of the parameters.

scPDFMergeAddFile

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

Syntaxint scPDFMergeAddFile(WCHAR *PDFFileName);
Parameters PDFFileNameFull path name to the PDF file to add to the currently merged PDF.
Returns int Returns 0 if successful. Any other value indicates an error, see GetLastError for more information.

scPDFMergeAddFileA

Add a PDF file to the currently merged PDF file.
All pages from the give file will be added to the merged output file.
scPDFMergeInit must be called before any PDF file is added.
Multibyte version.

Syntaxint scPDFMergeAddFileA(char *PDFFileName);

Please see scPDFMergeAddFile above for a description of the parameters.

scPDFMergeAddFileEx

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(WCHAR *PDFFileName, WCAHR *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 int Returns 0 if successful. Any other value indicates an error, see GetLastError for more information.

scPDFMergeAddFileExA

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.
Multibyte version.

Syntaxint scPDFMergeAddFileExA(char *PDFFileName, char *PageInformation);

Please see scPDFMergeAddFileEx above for a description of the parameters.

scPDFMergeClose

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

Syntaxint scPDFMergeClose(WCHAR *PDFOutputName);
Parameters PDFOutputNameFull path name of the merged PDF file that will be created.
Returns int Returns 0 if successful. Any other value indicates an error, see GetLastError for more information.

scPDFMergeCloseA

Close the currently open PDF file and output the merged result to the given file name.
Multibyte version.

Syntaxint scPDFMergeClose(char *PDFOutputName);

Please see scPDFMergeCloseA above for a description of the parameters.

scPDFMergeInit

Create a new empty PDF file prepared for merging.
Use scPDFMergeAddFile and scPDFMergeAddFileEx to add files, and finally call PDFMergeClose to complete the merge.

Syntaxint PDFMergeInit(WCHAR *SerialNumber);
Parameters SerialNumber Your serial number.
Returns int Returns 0 if successful. Any other value indicates an error, see GetLastError for more information.

scPDFMergeInitA

Create a new empty PDF file prepared for merging.
Use scPDFMergeAddFileA and scPDFMergeAddFileExA to add files, and finally call PDFMergeCloseA to complete the merge.

Syntaxint PDFMergeInit(char *SerialNumber);

Please see scPDFMergeInit above for a description of the parameters.

scPDFSplit

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

Syntaxint scPDFSplit(WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFolder, WCHAR *FileLabel, LONG PagesPerFile);
Parameters SerialNumber Your serial number.
  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 int Returns zero if successful. Any other value indicates an error, see GetLastError for more information.

scPDFSplitA

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

Syntaxint scPDFSplitA(char *SerialNumber, char *InputFile, char *OutputFolder, char *FileLabel, LONG PagesPerFile);

Please see scPDFSplit above for a description of the parameters.

scSetGerberApertureFileName

Set filename for an Gerber aperture table to be used when loading RS274D Gerber data.

Syntaxvoid scSetGerberApertureFileName( const WCHAR *ApertureFile);
Parameters ApertureFile Full path to aperture file that will be used.
Returns void  

scSetGerberFormatSettings

Change settings that are needed to load RS-274D Gerber files correctly.

Syntaxvoid scSetGerberFormatSettings(BOOL Incremental, LONG NumDigits, LONG NumDecimals, LONG Units, BOOL SuppressLeadingZeros, BOOL SuppressTrailingZeros);
Parameters Incremental If true the Gerber files contains incremental coordinates. Set to false for absolute coordinates.
  Preceding Number of digits before decimal point.
  Succeeding Number of digits after decimal point.
  Units Units used in Gerber file. Set to 0 for Inch and 1 for Milimetres.
  SuppressLeadingZeros Leading zeros are suppressed if set to true.
  SuppressTrailingZeros Trailing zeros are suppressed if set to true.
Returns void  

scSetMonochrome

Enables or disables monochrome (black & white) conversion.

Syntaxvoid scSetMonochrome( long Enable );
Parameters Enable Set to non-zero (true) to enable monochrome conversion.
Returns void

scSetPDFLargeFormat

Enables or disables creation of large format PDF files (up to 60x60 meters).

Syntaxvoid scSetPDFLargeFormat( long Enable );
Parameters Enable If set to non-zero large format PDF files are supported.
Returns void

scSetPDFLayers

Enable or disable creation of layered PDF files.

Syntaxvoid scSetPDFLayers( long Enable );
Parameters Enable If set to non-zero pens will be mapped to PDF layers.
Returns void

scSetPDFWriteFormat

Select PDF standard to use for converted files.

Syntaxvoid scSetPDFWriteFormat( long FormatIdentifier );
Parameters FormatIdentifier Set PDF standard to use for converted files, following options is available:
  1. Create an editable PDF file (version 1.6).
  2. create a PDF/A file for archiving. PDF/A files are write-protected and cannot be edited.
Returns void

scSetProperty

Return the value of the property with the give ID.

Syntaxint scGetProperty( long ID );
Parameters ID Value for the the property to read. See scGetProperty for a list of available values.
Value Use a non-zero value to enable a property, and a 0 (null) value to disable it.

scSetTIFFSingleStrip

Enable or disable creation of single-strip TIFF files. By default the component will create multi-strip files.
Single-strip files are usually smaller (in terms of file size) than multi-strip files. A multi-strip file may however have some advantages (depends on application):

Syntaxvoid scSetTIFFSingleStrip( long Enable );
Parameters Enable Set to non-zero to create single-strip TIFF files.
Returns void

scUseROInstruction

Enable or disable use of RO (rotation) instruction in HPGL/2 files.

Syntaxvoid scUseROInstruction( long Enable );
Parameters Enable If set to non-zero if RO instruction should be used during conversion.
Returns void