What's GerbMagic
What's New
Screenshots
RID Specification
How to Register
Pricing
GerbMagic3.6

GerbLib (DLL)

Command line tool

 

GerbLib 3.5 

(NOTE: GerbLib 3.5 requires GerbMagic 3.6 to work)

GerbLib is a DLL (GerbLib.dll) that exports a group of library functions which can be used to convert Gerber files to PDF, Postscript, TIFF, BMP or RID file formats. With GerbLib, it is easy to develop a customized conversion tool  for your own purpose.

The simplest way to convert a Gerber file is to call GbxConvert with the last parameter set to TRUE. In this case GbxConvert does not return until the conversion is finished. For example:

GbxConvert ("foo.gbr", "foo.pdf", TRUE);

This converts foo.gbr to foo.pdf. 

Sometimes the Gerber file can be very large, it may take several minutes for the conversion to finish, especially when converting to a raster image format like BMP with high resolution. To avoid hanging your program while waiting for the operation to finish, call GerbConvert with the last parameter set to FALSE. This makes GbxConvert work asynchronously. It starts the operation  in the background and returns immediately. You can then call GbxCheckState to check if the operation has finished. You can also call GbxAbort to abort the operation in progress.

GerbLib is a DLL that relies on GerbMagic to do the conversion in the background. To use GerbLib, you need to install GerbMagic 3.6 or later. If GerbMagic has expired on your computer and you want to do more evaluation of the programs, please install both GerbMagic and GerbLib on a new computer.

GerbLib exports a set of functions to manipulate the parameters such as resolution, page width/height. You can also change these parameters from GerbMagic's menu (Run GerbMagic and select "File"=>"System Option").

The list of functions exported by GerbLib is as follows:

Library Function

Description

GbxConvert Converts a RS274x Gerber file to PDF, Postscript, TIFF, BMP or RID formats.
GbxCheckState Checks the state of the conversion operation in progress.
GbxAbort Aborts the conversion operation  in progress.
GbxGetResolution Gets the currently used resolution.
GbxSetResolution Sets the currently used resolution.
GbxGetPageSize Gets the current page size.
GbxSetPageSize Sets the current page size.
GbxSetLeftRightMargin Sets the left and right margin of the image. 
GbxGetLeftRightMargin Gets the left and right margin of the image. 
GbxSetTopBottomMargin Sets the top and bottom margin of the image. 
GbxGetTopBottomMargin Gets the top and bottom margin of the image. 
GbxSetOutputMode Sets the output mode.
GbxGetOutputMode Gets the output mode.
GbxGetImgSize  Retrieves the size of the image described by a Gerber file.

For a sample C program that uses GerbLib, see Gbcvt

Download GerbLib 3.5
Download GerbMagic

 

 

Copyright (c) 2002, Bronzware Inc.  All trademarks are the property of their respective owners.