gerbv(1)
๐ gerbv โ Gerber Viewer ๐
okay bestie, welcome to the gerbv(1) page, aka the General Commands Manual moment for the Gerber Viewer. yes it's a real manual page, yes it's long, and yes we're doing the whole thing. grab a snack ๐
โจ NAME โจ
gerbv โ Gerber Viewer. that's it, that's the name, she's iconic ๐
๐ฆ SYNOPSIS ๐ฆ
gerbv [OPTIONS] [gerberfile[s]]
like. you give her options, you give her files, she renders. simple as that ๐
๐ธ DESCRIPTION ๐ธ
so gerbv is a viewer for RS274-X files, which everyone just calls Gerber files because who has time. these RS274-X files get generated by all the different PCB CAD programs out there, and they're what gets used in the actual printed circuit board manufacturing process. so like, they matter fr fr.
and she doesn't stop there โ gerbv also supports Excellon/NC drill files as well as XY (centroid) files produced by the program PCB (that's http://pcb.geda-project.org/). multi-talented. ate. ๐
๐ OPTIONS ๐
โ ๏ธ Warning! On some platforms, which hasn't long option available, only short options are available. so like, if your platform is being difficult, the long options might just not exist. keep that in mind bestie ๐ซถ
๐ gerbv General options:
-V,--versionโ prints the version number ofgerbvand then exits. quick little flex โจ-h,--helpโ prints a brief usage guide and exits. the classic "help me" move ๐-b<hex>,--background=<hex>โ sets the background color to<hex>.<hex>is written as an html-color code, like#FF0000for Red. ๐จ-f<hex>,--foreground=<hex>โ sets the foreground color to<hex>, also an html-color code, like#00FF00for Green. and listen, if you also want to set the alpha (that's when you're rendering with Cairo), you can write it as an#RRGGBBAAcode. use multiple-fflags to set the color for multiple layers. one per layer, queen ๐-l <filename>,--log=<filename>โ all error messages etc are stored in a file with filename<filename>. receipts, basically ๐งพ-t <filename>,--tools=<filename>โ reads Excellon tools from the file<filename>.-p <project filename>,--project=<project filename>โ loads a stored project. please note that the project file must be stored in the same directory as the Gerber files. she's picky like that ๐ญ
๐ gerbv Export-specific options:
the following commands can be used in combination with the -x flag. so like, -x is the main character and these are her supporting cast ๐
-B<b>,--border=<b>โ sets the border around the image to<b>percent of the width and height. default<b>is5%. ๐ผ๏ธ-D<XxY>or<R>,--dpi=<XxY>or<R>โ resolution (Dots per inch) for the output bitmap. use<XxY>when you want different resolutions for the width and the height (only when compiled with Cairo as render engine). use<R>when you want the same resolution in both directions. defaults to72DPI in both directions. ๐-T<XxYrR|X;YrR>,--translate=<XxYrR|X;YrR>โ translate the image by X and Y, and rotate by R degree. use multiple-Tflags to translate multiple files. the distance defaults to inches but may be changed with--units. only evaluated when exporting as RS274X or drill. โจ-O<XxY|X;Y>,--origin=<XxY|X;Y>โ sets the lower left corner of the exported image to coordinate<XxY>. coordinates default to inches but may be changed with--units.-a,--antialiasโ use antialiasing for the generated output-bitmap. smooth edges, slay โจ-o <filename>,--output=<filename>โ export to<filename>.-u<inch/mm/mil>,--units=<inch/mm/mil>โ use the given unit for coordinates. defaults to inches.-W<WxH>,--window_inch=<WxH>โ window size in inches<WxH>for the exported image.-w<WxH>,--window=WxH>โ window size in pixels<WxH>for the exported image. autoscales to fit if no resolution is specified (note that the default72DPI also changes in that case). if a resolution is specified, it will clip the image to this size. ๐ช-x<png/pdf/ps/svg/rs274x/drill>,--export=<png/pdf/ps/svg/rs274x/drill>โ export to a file and set the format for the output file.
๐ GTK Options
--gtk-module=MODULEโ load an additional GTK module--g-fatal-warningsโ make all warnings fatal--gtk-debug=FLAGSโ GTK debugging flags to set--gtk-no-debug=FLAGSโ GTK debugging flags to unset--gdk-debug=FLAGSโ GDK debugging flags to set--gdk-no-debug=FLAGSโ GDK debugging flags to unset--display=DISPLAYโ X display to use--syncโ make X call synchronous--no-xshmโ don't use X shared memory extension--name=NAMEโ program name as used by the window manager--class=CLASSโ program class as used by the window manager
๐ GENERAL ๐
when you start gerbv you can give her the files to be loaded right there on the command line, either as each file separated with a space, or by using wildcards. easy ๐
the user interface is graphical. simply press and drag the middle mouse button (that's the scroll wheel, bestie) and the image will pan as you move the mouse. to manipulate a layer, right-click on one of the rightmost list items. that brings up a pop-up menu where you can select what you want to do with that layer โ reload file, change color, etc. you get the vibe โจ
and if you hold the mouse button over one of the rightmost buttons, a tooltip will show you the name of the file loaded on that layer. cute little peek ๐
๐ฆ ACTIVATION AND DEACTIVATION OF LAYERS ๐ฆ
you can load several files at one time, no big deal. then you can turn the displaying of the layers on and off by clicking on one of the check boxes near the layer names. toggling, iconic ๐
you can also control this from the keyboard. press Ctrl, enter the number of the layer you want to activate/deactivate on the numerical keypad, and then release the Ctrl key. keyboard shortcuts are the moment โจ๏ธ
๐ง ALIGNING OF LAYERS ๐ง
you can align two layers by selected elements. select one element on each of two layers and click Align layers from the context menu. match made in heaven fr fr ๐ซถ
๐ ZOOMING ๐
zooming can be handled by either menu choices, keypressing, or mouse scroll wheel. here's the tea:
- press
zand you will zoom in - press
Shift+z(i.e.Z) and you will zoom out - scroll wheel works if you enabled that in your X server and mapped it to button 4 and 5
- you can make the image fit by pressing
f(there's also a menu alternative for this, don't worry) - if Pan, Zoom, or Measure Tool is selected you can press the right mouse button for zoom in, and if you press
Shiftand the right mouse button you will zoom out
you can also do zooming by outline. select Zoom Tool, press mouse button, draw, release. the dashed line shows how the zooming will be dependent on the resolution of the window. the non-dashed outline will show what you actually selected. and if you change your mind when you've started to mark the outline, you can always abort by pressing escape. no take-backsies needed, just escape ๐
and ooh โ by holding down the Shift key when you press the mouse button, you will select an area where the point you started at will be the center of your selection. main character positioning ๐
๐ MEASUREMENTS ๐
you can do measurements on the image displayed. select Measure Tool and the cursor changes to a plus. by using the left mouse button you can draw the lines that you want to measure. the result of the last measurement is also displayed on the statusbar. all measurements stay in the drawing until you select another Tool. and to measure the distance between elements, select two of them and switch to Measure Tool. math girlie era ๐งฎ
the statusbar shows the current mouse position on the layer in the same coordinates as in the file. i.e. if you have (0,0) in the middle of the image in the Gerber files, the statusbar will show (0,0) at the same place. consistent, we love that ๐ซถ
๐ SUPERIMPOSING ๐
when you load several Gerber files, you can display them "on top of each other", i.e. superimposing. the general way to display them is that upper layers cover the layers beneath, which is called copy (GTK+ terms). stacking, but make it circuit boards โจ
the other ways selectable are and, or, xor and invert. they map directly to corresponding functions in GTK. and in GTK they are described as: "For colored images, only GDK_COPY, GDK_XOR and GDK_INVERT are generally useful. For bitmaps, GDK_AND and GDK_OR are also useful." no cap ๐ฏ
๐ PROJECTS ๐
gerbv can also handle projects. a project consists of a bunch of loaded layers with their respective color and the background color. the easiest way to create a project is to load all the files you want into the layer you want, set all the colors etc, and do a "Save Project As...". easy peasy ๐ธ
you load a project either from the menu bar or by using the commandline switches -p or --project.
โ ๏ธ currently there is a limit in that the project file must be in the same directory as the Gerber files to be loaded. yeah, she's particular about it ๐ญ
๐ง SCHEME ๐ง
the project files are simple Scheme programs that are interpreted by a built in Scheme interpreter. the Scheme interpreter is TinyScheme and it needs a Scheme program called init.scm to initialize itself.
the search path for init.scm is, in the following order:
/usr/share/gerbv/scheme- the directory with the executable
gerbv - the directory
gerbvwas invoked from - finally, according to the environment variable
GERBV_SCHEMEINIT
she's thorough like that ๐
๐ง TOOLS FILE ๐ง
not every Excellon drill file is self-sufficient, bestie. some CADs produce .drd files where tools are only referenced, but never defined (like, what diameter of the tool is??). Eagle CAD is one of such CADs, and there are more since many board houses require Tools files. ๐
a Tools file is a plain text file which you create in an editor. each line of the file describes one tool (the name and the diameter, in inches):
T01 0.024
T02 0.040
...
these are the same tools (T01 etc.) that are used in the Drill file. a standard practice with Eagle is to create an empty Tools file, run the CAM processor, and the error report tells you which tools you "forgot". then you put these tools into the file and rerun the CAM processor. the plot twist โจ
you load a tool file by using the commandline switches -t or --tools. the file can have any name you wish, but Eagle expects the file type to be .drl, so it makes sense to keep it this way. some board houses are still using CAM software from the DOS era, so you may want to exercise caution before going beyond the 8.3 naming convention. ancient tech fr ๐ญ
when gerbv reads the Tools file it also checks that there are no duplicate definitions of tools. this does happen from time to time as you edit the file by hand, especially if you, during design, add or remove parts from the board and then have to add new tools into the Tools file.
๐ the duplicate tools are a very serious error which will stop (HOLD) your board until you fix the Tools file and maybe the Excellon file. gerbv will detect duplicate tools if they are present, and will exit immediately to indicate such a fatal error in a very obvious way. a message will also be printed to standard error.
if your Excellon file does not contain tool definitions then gerbv will preconfigure the tools by deriving the diameter of the drill bit from the tool number. this is probably not what you want, and you will see warnings printed on the console. consider yourself warned, bestie ๐ซถ
๐ PICK&PLACE FILE ๐
supported comma separated file (CSV) with fixed order of data:
# X,Y in mils.
Designator,"Description","Value",X,Y,"Rotation (deg)",top/bottom
or
Designator,"Footprint","Mid X","Mid Y","Ref X","Ref Y",
"Pad X","Pad Y",T/B,"Rotation","Comment"
units can be specified in the format # X,Y in mils. or as a suffix for X/Y-coordinates, i.e. ,10mil,. supported units: in, mil, cmil, dmil, km, m, dm, cm, mm, um, nm. so many units, we're spoiled honestly โจ
๐ฟ ENVIRONMENT ๐ฟ
GERBV_SCHEMEINITโ defines where theinit.scmfile is stored. used by the scheme interpreter, which is used by the project reader. ๐ง
โจ AUTHOR โจ
okay so this whole thing was literally built by some absolute legends and we're gonna give them their flowers fr fr ๐
- Stefan Petersen (
spetm at users.sourceforge.net) โ overall hacker and project leader ๐ the main character, honestly. the whole vibe is his. - Andreas Andersson (
e92_aan at e.kth.se) โ drill file support and general hacking ๐ฅ he's the reason your drill files don't just sit there being sad. - Anders Eriksson (
aenfaldor at users.sourceforge.net) โ X and GTK+ ideas and hacking ๐ the aesthetic department, the window-dressing genius, the one making the GUI not look like a potato.
like, three dudes, one gerber viewer, and a dream. iconic behaviour, no notes. ๐
๐ COPYRIGHT ๐
Copyright ยฉ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Stefan Petersen
bestie, this document can be freely redistributed according to the terms of the GNU General Public License version 2.0. so yeah โ share it, spread it, be free with it, that's the whole point. ๐ฆ
just a lil reminder to respect the license terms, mwah ๐
and that's the whole page, bestie โ you made it to the end, which is giving dedication ๐ซถ
this lil masterpiece comes from gerbv, and the page itself is dated Jule 13, 2013 (yes that's how it's spelled, we don't question the vibes ๐ธ). go look at some gerber files, you earned it. ๐
๐ฆ where this page comes from
- debian bookworm: gerbv 2.9.6-1 ยท GPL-2.0-only
- debian trixie: gerbv 2.10.0-1+b1 ยท GPL-2.0-only
- opensuse-leap 16.0: gerbv 2.10.0-bp160.1.12 ยท GPL-2.0-only
- opensuse-leap 16.0: gerbv 2.10.0-bp160.1.12 ยท GPL-2.0-only
- opensuse-leap 16.0: gerbv 2.10.0-bp160.1.12 ยท GPL-2.0-only
- opensuse-leap 16.0: gerbv 2.10.0-bp160.1.12 ยท GPL-2.0-only
- ubuntu jammy: gerbv 2.8.2-1 ยท GPL-2.0-only
- ubuntu noble: gerbv 2.10.0-1build2 ยท GPL-2.0-only
- ubuntu questing: gerbv 2.10.0-2
- ubuntu resolute: gerbv 2.10.0-2build1 ยท GPL-2.0-only
- ubuntu stonking: gerbv 2.10.0-2build1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms