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.

UNICODEint scCheckFormat( WCHAR *InputFile, long *Format );
ANSIint scCheckFormatA( CHAR *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
  13. WebP Image Format
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.

scConvertFile

Convert the input file to a new file using the selected output format.

UNICODEint scConvertFile( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, WCHAR *Format, double Scale, long BitsPerPixel, long DPI );
ANSIint scConvertFileA( CHAR *SerialNumber, CHAR *InputFile, CHAR *OutputFile, CHAR *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)
  • WEBP (Google Image 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.

scConvertFilePage

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

UNICODEint scConvertFile( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, WCHAR *Format, long Page, double Scale, long BitsPerPixel, long DPI );
ANSIint scConvertFileA( CHAR *SerialNumber, CHAR *InputFile, CHAR *OutputFile, CHAR *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)
  • WEBP (Google Image 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 Scale factor.
  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.

scConvertToImageFile

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

UNICODEint 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 );
ANSIscConvertToImageFileA( 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 );
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 Following flag bits are supported:
1. The original Gerber offsets will be used during conversion.
2. The output file will be scaled to fit the given output size.
  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.

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.

UNICODEint scConvertToPaperSize( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, WCHAR *Format, LONG PaperSizeIndex, BOOL KeepPaper, LONG Page, LONG BitsPerPixel, LONG DPI );
ANSIint scConvertToPaperSize( char *SerialNumber, char *InputFile, char *OutputFile, char *Format, LONG PaperSizeIndex, BOOL bKeepPaper, 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)
  • WEBP (Google Image 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 numbering 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.

scGetFileDimensions

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

UNICODEint scGetFileDimensions( WCHAR *InputFile, long Page, double *OffsetX, double *OffsetY, double *Width, double *Height, long *Rotation );
ANSIint scGetFileDimensionsA( CHAR *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.

scGetNumFilePages

Return the number of pages in the given file.

UNICODEint scGetNumFilePages( WCHAR *InputFile, long *Pages);
ANSIint 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 definition, if available, from input file.
  2. Background color. Set the active background color to use for the conversion methods.
  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. If set to 1 then monochrome (black & white) conversion is enabled..
  5. PDF output standard selection. Select a PDF standard to use for exported PDF files, following options are available:
    0. PDF 1.6 (editable)
    1. PDF/A-2B
  6. PDF large format mode. Enables or disables creation of large format PDF files. Large format files are files with width or height beyond 5x5m. .
  7. PDF Layers. Enable or disable creation of layered PDF files. If set to non-zero, layers and pens in input files will be converted to individual PDF layers.
  8. PDF monochrome raster compression. Select the compression method to use for monochrome (1-bit) raster images in exported PDF files. The following compression methods are available:
    0. Deflate.
    1. CCITT Group 4.
    2. JBIG2.
  9. TIFF single strip mode. See the scSetTIFFSingleStrip function 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.
  12. Searchable PDF. If set to 1 the exported PDF files will include searchable text, if the source file contains text.
  13. DXF Loadunit. Not used.
  14. PDF to CAD Rotation. If set to 1 the PDF to CAD conversion will honor PDF page rotation if present.
  15. DXF Ignore White Areas. If set to non-zero, all filled white areas will be ignored when the DXF files is written. This may be useful if you're converting PDF files to DXF because white areas may give problems in AutoCAD.
  16. DXF Write Metric. If set to 1 DXF files will be written using millimeters, else Inches will be used.
  17. PDF Transparency. Enable or disable use of transparency in exported PDF files.Some printer drivers doesn't support transparency, and turning off transparency for exported PDF files may make your files print faster.
  18. Grayscale mode. If set to 1 then grayscale conversion is enabled.
  19. DXF Force Line to LWPolyline. If set to 1 all line elements will be written as LWPolyline instead of Line. This will increase file size, but makes it possible to write lines with width.

scImportersPath

Set path to where the additional file importers are located.

UNICODEvoid scImportersPath( WCHAR *Path );
ANSIvoid scImportersPathA( CHAR *Path );
Parameters Enable String containing path to file importer location.
Returns void

scPDFConform

Conform, or convert, an existing PDF file to selected PDF/A standard.

UNICODEint scPDFConform(WCHAR *SerialNumber, WCHAR *InputFile, int ConformType, WCHAR *OutputFile, BSTR *Errors);
ANSIN/A
Parameters SerialNumber Your serial number.
InputFile The original PDF file you want to create a conformed copy of.
  ConformType Selected PDF/A standard.
The following values are available:
  1. PDF/A-1b.
  2. PDF/A-2b.
  3. PDF/A-3b.
  4. Normalize.
  OutputFileThe conformed PDF file.
  Errors Some PDF files cannot be converted to PDF/A standard, in this case any error message will be returned in this parameter.
Returns int This function returns zero on success.

scPDFEncrypt

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

UNICODEint PDFEncrypt(WCHAR *OriginalFile, WCHAR *EncryptedFile, WCHAR *OpenPassword, WCHAR *OwnerPassword, LONG Restrictions);
ANSIint PDFEncryptA(char *OriginalFile, char *EncryptedFile, char *OpenPassword, char *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 original 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.

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.

UNICODEint scPDFMergeAddFile(WCHAR *PDFFileName);
ANSIint scPDFMergeAddFileA(char *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.

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.

UNICODEHRESULT PDFMergeAddFile(WCHAR *PDFFileName, WCAHR *PageInformation);
ANSIint scPDFMergeAddFileExA(char *PDFFileName, char *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.

scPDFMergeClose

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

UNICODEint scPDFMergeClose(WCHAR *PDFOutputName);
ANSIint scPDFMergeClose(char *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.

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.

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

scPDFOptimize

Optimize a PDF file for faster loading and rendering. The optimize process will rescale images and rebuild the structure of the input file. The function rebuilds the content streams of all pages, templates and, annotations. Useless operators as well as errors in content streams will be removed. The resulting content streams are error free and usually smaller. How much the optimization takes effect depends on the quality of the original content streams.

Syntaxint PDFOptimize(WCHAR *InputFile, WCHAR * OutputFile, long MonoDPI, long ColorDPI, long MonoCompression, long lColorCompression);
Parameters SerialNumber Your serial number.
InputFile The original PDF file you want optimize.
OutputFile The optimized output PDF file.
MonoDPI Resolution to use for monochrome images in output file. Any image larger than the set resolution will be rescaled to fit this setting.
ColorDPI Resolution to use for color images in output file. Any image larger than the set resolution will be rescaled to fit this setting.
  MonoCompression Set compression method to use for monochrome images:
The following values are available:
  1. Flate Compression (ZIP)
  2. CCITT Group 3 Fax
  3. CCITT Group 4 Fax
  4. JBIG2
  ColorCompression Set compression method to use for color images:
The following values are available:
  1. Flate Compression (ZIP)
  2. JPEG
  3. LZW
  4. JPEG2000
Returns int Returns 0 if successful. Any other value indicates an error, see GetLastError for more information.

scPDFSplit

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

UNICODEint scPDFSplit(WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFolder, WCHAR *FileLabel, LONG PagesPerFile);
ANSIint scPDFSplitA(char *SerialNumber, char *InputFile, char *OutputFolder, char *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.

scPDFToCAD

Convert a PDF file to an editable vector format file, for example Autodesk DXF.

UNICODEint scPDFToCAD( WCHAR *SerialNumber, WCHAR *InputFileName, long PageNo, WCHAR *Format, WCHAR *OutputFileName);
ANSIint scPDFToCADA( CHAR *SerialNumber, CHAR *InputFileName, long PageNo, CHAR *Format, CHAR *OutputFileName);
Parameters SerialNumber Your serial number.
  InputFile Name of the PDF file to convert.
  PageNo PDF page that will converted to vector format.
  Format Export format to use for conversion. Supported formats:
  • CGM (Computer Graphics Metafile)
  • DWF (Drawing Web Format)
  • DXF (Autodesk Drawing Exchange Format)
  • GBR (Gerber RS274X)
  • PLT (HPGL/2)
  • SVG (Scalable Vector Format)
  OutputFileName Name of the exported vector file.
Returns int Returns zero if successful. Any other value indicates an error, see GetLastError for more information.

scSetGerberApertureFileName

Set filename for an existing Gerber aperture table file that are to be used when loading RS-274D Gerber data.

UNICODEvoid scSetGerberApertureFileName( WCHAR *ApertureFile);
ANSIvoid scSetGerberApertureFileNameA( CHAR *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 Milimeters.
  SuppressLeadingZeros Leading zeros are suppressed if set to true.
  SuppressTrailingZeros Trailing zeros are suppressed if set to true.
Returns void  

scSetGrayscale

Enables or disables grayscale (shades of gray) conversion.

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

scSetMargins

Add margins to the converted file.

Syntaxvoid scSetMargins( BOOL AddMargins, DOUBLE Left, DOUBLE Top, DOUBLE Right, DOUBLE Bottom );
Parameters AddMargins If TRUE margins will be added to the converted file. Set to FALSE to disable margins.
  Left Set left margin in millimeters.
  Top Set top margin in millimeters.
  Right Set right margin in millimeters.
  Bottom Set bottom margin in millimeters.
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

Set a property to the given long value.

Syntaxint scSetProperty( long ID, long Value );
Parameters ID Value for the the property to modify. See scGetProperty for a list of available ID's.
Value See scGetProperty for a list of available properties and the values they accept.
Returns int Returns zero if successful. Any other value indicates an error, see GetLastError for more information.

scSetTIFFCompression

Set compression types to use for exported TIFF files.

Syntaxint scSetTIFFCompression( LONG Monochrome, LONG Color, LONG TrueColor );
Parameters Monochrome Set compression type to use for monochrome, 1-bit, files. Supported values:
ValueCompression method
1No compression
4CCITT Group 4 Fax
5LZW
8Deflate Compression (ZIP)
32773Packbits
32946Deflate (same as 8)
  Color Set compression type to use for color, 4-bit and 8-bit, files. Supported values:
ValueCompression method
1No compression
5LZW
8Deflate Compression (ZIP)
32773Packbits
32946Deflate (same as 8)
  TrueColor Set compression type to use for true color, 24-bit, files. Supported values:
ValueCompression method
1No compression
5LZW
7JPEG
8Deflate Compression (ZIP)
32773Packbits
32946Deflate (same as 8)
Returns int always returns 0.

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

scTIFFSplit

Split a multi-page TIFF file into multiple single paged files (one per page).

UNICODEint scTIFFSplit( WCHAR *InputFile, WCHAR *OutputFolder, WCHAR *FileLabel );
ANSIint scTIFFSplitA( char *InputFile, char *OutputFolder, char *FileLabel );
Parameters InputFile The multi-page TIFF 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.tif", "inputfilename_2.tif" and so on. By adding "part" as label, the output files will be named "inputfilename__part_1.tif", "inputfilename__part_2.tif" and so on.
Returns HRESULT This function returns S_OK if success.

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