CDLABELGEN(1)
πΏ CDLABELGEN(1) β bestie's guide to cdlabelgen β¨
User Contributed Perl Documentation Β· CDLABELGEN(1)
okay so. sit down, grab a strawberry π, because this one is a big one and it's genuinely iconic. this is the manual for cdlabelgen, and by the end you're gonna be making CD/DVD labels, jewel case inserts, and envelopes like it's nothing. no cap.
πΈ NAME πΈ
cdlabelgen β CD/DVD labels, jewel case inserts, and envelopes creator. Generates frontcards and traycards for CD cases, single-cd envelopes, DVD case inserts, as well as output suitable for direct printing on CD/DVD. π
β¨ SYNOPSIS β¨
cdlabelgen [ -c <category> -s <subcategory> -i <item1%item2%etc> -f
<itemsfile> -v <num_items_cover> -e <cover_epsfile> -S
<cover_eps_scaleratio>[,<image_x_offset>,<image_y_offset_inches>] -E
<tray_epsfile> -T
<tray_eps_scaleratio>[,<image_x_offset>,<image_y_offset_inches>] -d
<date> -D -o <outputfile> -t <template> -b -C -w -h -m -M -O -p -y
<page_offset_inches> -l <line_width_points>] --create-dvd-inside
--create-dvd-outside --slim-double-case --double-case --create-cdlabel
--rotate-endcaps --plaque-color <r,g,b> --category-color <r,g,b>
--subcategory-color <r,g,b> --text-color <r,g,b> -n <volume/number in
set> --rows-columns <row_count_for_items,column_count_for_items>
--tray-overlay <overlay_epsfile> --tray-overlay-scaleratio
<tray_overlay_image_scaleratio>[,<image_x_offset>,<image_y_offset_inches>]
it's giving "so many flags." it's giving "main character energy." we love her. π«Ά
π VERSION π
Version 4.2.0, April 2012. yes she's an elder but she's still slaying.
π¦ DESCRIPTION π¦
cdlabelgen's purpose in life is twofold, and honestly? relatable queen:
- To be run automatically and swiftly from a shell script and automatically generate a frontcard and a traycard for a cd β usually data archive cd's. The traycard (which goes behind the CD itself) is U-shaped and the ends of the CD case bear the label of what the CD is. Inside inserts for DVDs are also supported.
- To have a minimum of dependencies β
cdlabelgenonly requires perl. periodt. π
cdlabelgen was designed to simplify the process of generating labels for CD's. It originated as a program to allow auto generation of frontcards and traycards for CD's burned via an automated mechanism (specifically for archiving data), but has now become popular for labelling CD compilations of mp3's, and copies of CDs. Note that cdlabelgen does not actually print anything β it just spits out postscript, which you can then do with as you please. It can also be combined with output from other programs such as "barcodegen" β to print a barcode as a tray overlay image. π₯
The latest version of cdlabelgen as well as this document can be found at http://www.aczoom.com/tools/cdinsert/. The software package includes CGI scripts that can be used to serve cdlabelgen over the internet. An older version may be available at: http://www.red-bean.com/~bwf/software/cdlabelgen/.
cdlabelgen comes with several eps images for you to use on your labels. π¨ These images can be found in /usr/local/lib/cdlabelgen or /usr/share/cdlabelgen or /opt/lib/cdlabelgen/ or /usr/local/share/cdlabelgen, depending on your installation. Included are a Recycling icon, an mp3 icon, the Compact Disc icon (with and without 'Digital' on it), Tux the penguin π§, and the new Debian 'swirl' logo. Two color background images called Music Notes are also available. π΅
CDs: cdlabelgen prints a 'tongue' as part of the traycard. This folds around and is viewable from the front in jewel boxes that are entirely clear (CD holder piece is not opaque). If you do not have a clear CD holder in your jewel box, you may find it easier to just cut the 'tongue' off β it's a bit easier to fold without it. βοΈ
Paper Sizes: Normal CD cases, Slim CD cases, DVD inside inserts can be printed on a letter or A4 sized page. CD/DVD Envelopes and DVD outside inserts will not fit on a letter sized paper, a larger paper size will be needed to make it fit. π
cdlabelgen requires Perl Version 5.003 or greater. Ghostscript is not required, but is recommended so that you can test out your labels without wasting paper. π
π SWITCHES π
the options, bestie
-c,--category <category>β Set the category (title) for the CD. π-s,--subcategory <subcategory>β Set the subcategory (subtitle) for the CD. β¨-i,--items <items>βitemsshould be a'%'separated list of items to print on the traycard of the CD. Note that if the number of items are too many to fit on the tray card,cdlabelgenwill leave out some items at the end.cdlabelgenautomatically flows the items into 2, 3, 4, or 5 columns and scales the fontsize accordingly, unless the-Poption is used. You can insert blank lines by inserting 2 percent signs in a row into the items list.-f,--items-from-file <filename>β Get item names from file named filename. Each item should be on its own line separated by carriage returns.cdlabelgenautomatically flows the items into 2, 3, 4, or 5 columns and scales the fontsize or clips the items as needed. You can insert blank lines by placing blank lines between items in this file. π
Special commands can be embedded in the file, all of these commands should be present starting at the first column of the line. The codes are used to change the font for an item, the code itself is not printed in the output. π
{#BI} - make the item bold and italic
{#I} - make the item italic
{#B} - make the item bold
{#M} - make the item mono-spaced (Courier font)
{#MB} - make the item monospaced and bold (Courier-Bold font)
Example:
{#MB} Text 1 Item
would print the line " Text 1 Item" in a monospaced bold font. ate. π
-v,--cover-items <number_of_items_for_cover>β Normally, all the items are printed on the tray card. But if you have a large number of items, you may wish to print some items on the cover, and rest on the tray card. This option provides a way of specifying how many items should be printed on the cover. Default is0(i.e., print no item on the cover, print all items on the tray). The items to be printed on the cover are taken from the list of items, from the top of the list. Note that if the number of items is too many to fit on the cover, it will result in items being dropped. π As of Jan 2002, around 250-300 items can be fitted on the cover or the tray, depending on whether a title/subtitle/date is used or not.-d,--date <date>β Set the date to be used as 'date' if not set or not overridden with the-Dflag, today's date will be used (default is today's date). Use this option if you don't likecdlabelgen's default format ofYYCC-MM-YY, for example. π-D,--no-dateβ Do not print any date (overrides-das well). π«-e,--cover-image <cover_epsfile>β Filename of eps file to print on cover. Note thatcdlabelgenrequires that the eps file contain a proper'%%BoundingBox LLx LLy URx URy'declaration according to the PostScript Document Structuring Conventions.cdlabelgenuses this line to determine the dimensions of the eps graphic so that it can position it appropriately on the cover. Note thatcdlabelgenfirst looks for this file in your working directory. If it doesn't find it there, it will look in the list of directories where the default eps files are stored (see@where_is_the_template). This makes it easy to use the images shipped withcdlabgelgenwithout typing miles of pathnames. πΌοΈ-S,--cover-image-scaleratio <cover_eps_scaleratio [,image_x_offset,image_y_offset_inches]>β The ratio by which you want to scale the epsfile that appears on the cover. If you omit this flag,cdlabelgenassumes a scaleratio of1.0. This flag allows you to squeeze larger graphics into the cover or expand smaller graphics to fill the cover. Scaleratio must be a number (int or float).
If the scale value passed is 0 (or 0.0), then the logo is used as a background image β it will be scaled as required to fit the entire cover.
The -S option also takes optional translate arguments. Normally images are printed on the cover and the tray so that the bottom-right of the image is anchored to the bottom-right of the cover or tray. To move the images away from the bottom and right borders, use this option. For example, to leave two inches of gap between the image and the bottom border, and 0.5 inches from the left border, and use 1.0 scaleratio, use this:
-S 1.0,-2,0.5
This offset only applies when the image is being used as a logo β i.e., image is not being used as background to fill the entire cover or tray.
-E,--tray-image <tray_epsfile>β Filename of eps file to print on traycard. Note thatcdlabelgenrequires that the eps file contain a proper'%%BoundingBox LLx LLy URx URy'declaration according to the PostScript Document Structuring Conventions.cdlabelgenuses this line to determine the dimensions of the eps graphic so that it can position it appropriately on the cover. Note thatcdlabelgenfirst looks for this file in your working directory. If it doesn't find it there, it will look in the list of directories where the default eps files are stored (see@where_is_the_template). This makes it easy to use the images shipped withcdlabgelgenwithout typing miles of pathnames. πΌοΈ-T,--tray-image-scaleratio <tray_eps_scaleratio [,image_x_offset,image_y_offset_inches]>β The ratio by which you want to scale the epsfile that appears on the traycard. If you omit this flag,cdlabelgenassumes a scaleratio of1. This flag allows you to squeeze larger graphics into the traycard or expand smaller graphics to fill the traycard. Scaleratio must be a positive number (int or float) specifying the scale.
If the scale value passed is the word fill1, then the image is used as a background β it is scaled so that it completely fills the interior tray card region. The value 0 (or 0.0) works same as the fill1 argument.
If the value passed is the word fill2, then the image is used as a background to fill more than just the tray. For normal CD cases, the image is scaled so that it completely fills both the tray card region, and the two endcaps (but not the extreme right-hand 'tongue-cap') for normal cd cases. For Slim CD cases or DVD Inside/Outside covers, the tray image will fill both the tray and cover regions (including any spines). For directly printing on a CD (--create-cdlabel), fill2 option works like the fill1 option.
The -T option also takes optional translate arguments. Normally images are printed on the cover and the tray so that the bottom-right of the image is anchored to the bottom-right of the cover or tray. To move the images away from the bottom and right borders, use this option. For example, to leave two inches of gap between the image and the bottom border, and 0.5 inches from the left border, and use 1.0 scaleratio, use this:
-T 1.0,-2,0.5
This offset only applies when the image is being used as a logo β i.e., when the image is not being used as a background to fill the entire cover or tray. π
-o,--output-file <outputfile>β bestie, if you pass-o, cdlabelgen writes to outputfile instead ofSTDOUT. No more surprise text in your terminal π-t,--template <template>β ok so this one lets you say exactly which template to use, out loud, on purpose. Iconic uses: debugging the PostScript code inside the template, using a totally different template, or flexing your own custom template instead of the one that ships with cdlabelgen. β¨-b,--no-tray-plaqueβ suppresses printing of the Plaque on the traycard. Translation: more room for your items, or a slightly bigger font size for them. Win-win, no cap. π¦-C,--no-cover-plaqueβ suppresses printing of the plaque on the front cover. This means your cover image can fill the entire front cover, while still showing category and sub-category info in all the other usual places. Main character image energy π-h,--helpβ prints out the usage message. The classic. π«Ά-w,--tray-word-wrapβ enables word wrapping of the items that print on the traycard.
β οΈ heads up bestie: this is not extensively tested and may be buggy! Make sure you preview your label before printing it if you use this flag. π
And if there's a problem with -w, the best option right now is to split lines in the input itself, and to omit the -w option. fr fr.
-m,--slim-caseβ creates covers suitable for use in slim cd-cases. What that means: no tray card (the tray card is now the inside front cover). This creates a two page, folding cover insert. Could also be used in normal cd cases as an inside insert. πΈ
Slim case option can be used with outside dvd inserts (--create-dvd-outside) also β in which case the outside insert is created for half-height DVD case. Love a multitasker π
-O,--outside-foldoutβ outputs slim cd cover cases (or dvd inserts) with the order of the pages switched so the folding line lies on the outside of a normal case. Can be used when printing either the slim-cd-case or dvd-inside inserts.
This option is best used along with option -m (--slim-case) or --create-dvd-inside. They're a package deal π
--rotate-endcapsβ endcap text is rotated by 180 degrees, to flip the text around. Yes queen, turn it π-M,--create-envelopeβ creates covers suitable for use as envelopes for a CD. Guide lines are printed, to aid in folding the printout correctly. Crafty era βοΈ--create-dvd-insideβ creates inserts suitable for use as inside insert for a normal DVD case. Guide lines are printed, to aid in folding the printout correctly.
π Note: DVD inserts may not print fully on Letter or A4 sized paper printers; it may require larger paper sizes.
--create-dvd-outsideβ creates inserts suitable for use as outside cover inserts for a normal DVD case. Guide lines are printed, to aid in folding the printout correctly.
π Note: DVD inserts may not print fully on Letter or A4 sized paper printers; it may require larger paper sizes.
Slim case option (--slim-case) can be used with outside dvd inserts also β in which case the outside insert is created for half-height DVD case.
--double-caseβ create covers for double-sided DVD cases that hold 6 DVDs. Only double-width DVD cases are supported; double-width CD cases are not supported. Therefore, using--double-casealso implies the--create-dvd-outsideoption.
π Note: DVD inserts may not print fully on Letter or A4 sized paper printers; it may require larger paper sizes.
--slim-double-caseβ create covers for double-sided DVD cases that hold 6 DVDs in boxes 1.5 times the depth of normal dvd cases. Only DVD cases are supported with this option; slim-double-width CD cases are not supported. Therefore, using--slim-double-casealso implies the--create-dvd-outsideoption.
π Note: DVD inserts may not print fully on Letter or A4 sized paper printers; it may require larger paper sizes.
--create-cdlabelβ for directly printing on a CD or DVD. As of January 2005, there are inkjets printers that can print on certain types of blank CD/DVD discs. Only a small number of items can be printed on the CD, and the number of characters in the title and subtitle is also limited.
β οΈ Always check the output visually by using PostScript viewers or printing on paper, before printing on the CD. Please bestie, preview first π
With this option, the top portion of the disc represents the "cover" area β so arguments related to the cover: title (--category), subtitle (--subcategory), --no-cover-plaque, --cover-items, --cover-image, etc all apply to the top area. The bottom portion of the disc represents the "tray" area, so arguments related to the tray: --no-tray-plaque, --tray-image, etc all apply to the bottom area. The date (--date) string, if present, is printed along the bottom curved edge of the disc.
Background images can be specified using the --cover-image option, modified as need by the --cover-image-scaleratio. If --tray-image is also specified, note that the cover image is printed first, then the tray image overwrites the cover image. The title/items text is then finally printed over all the images. Layering, it's giving Photoshop π
The --no-tray-plaque and/or --no-cover-plaque (along with --cover-items) option is also recommended with --create-cdlabel, otherwise there may be no space for any items to be printed on the disc.
The --clip-items option is also recommended.
-p,--clip-itemsβ enables clipping of items; uses a fixed font size for all items. Normally, thetemplate.psused by cdlabelgen will try to fit an item in a given column by reducing the font size if needed. This is ok if done for one or two items, but if done too often, it makes the tray card look ugly, with text of varying font sizes. Not the aesthetic we're going for π
Use this option to use a fixed width font for all items. If the item is too large to fit in a column, the text will be clipped instead.
-y,--page-offset [<page_x_offset_inches,]<page_y_offset_inchesβ use this to move the entire output up or down (y_offset), to make the output fit on appropriate sized paper. For letter sized paper,0.8works well, and for A4 paper,1.5works well. The value is in units of inches. An optional X-axis offset can also be specified. Default values:1inch for X-axis,0.8inches for Y-axis. Nudge nudge π-l,--line-width <line_width_points>β specify size in points of the edge and interior lines of the cover and tray card. If this is0, then the lines are omitted for both the cover and tray (but guide cut lines are still printed). The size is specified in points (1 point is 1/72 inch). π--plaque-color <r,g,b>β specify a color to fill plaque. Color must be specified using the rgb components, each value should be between0and255. π¨--category-color <r,g,b>β specify a color for category. Color must be specified using the rgb components, each value should be between0and255.--subcategory-color <r,g,b>β specify a color for subcategory. Color must be specified using the rgb components, each value should be between0and255.--text-color <r,g,b>β specify a color for text β this is used for the list of items, and the date display under the plaque and in the end-caps. Color must be specified using the rgb components, each value should be between0and255. Slay the color palette π-n,--number-in-set <string>β append volume information to the end of the date string. This should be a single string. If used in conjuction with-D, it will be in place of the date; otherwise, it is appended to the date as" - <number-in-set>". Collector energy π--rows-columns <row_count_for_items,column_count_for_items>β the--rows-columnsoptions forces the list of items to be printed using that many rows, and that many columns. Both numbers have to be provided, no spaces, for example:--rows-columns=11,3
The list of items is laid out in top-down, left-to-right fashion. Use blank items in the input, to get appropriately aligned columns. π
--rows-columns applies to the list of items wherever they are printed β normally on the tray only, but may include cover, or the top and bottom portions of the round printouts for direct CD label printing. Same values apply to all these variations, so if you need different number of rows/columns for cover vs tray, you can use two different runs of cdlabelgen, to get two postscript files, and pick the cover from one printout, and tray from the other. This will work for jewel-case inserts, but may not work for direct CD label printing.
--tray-overlay overlay_epsfileβ filename of eps file to print as overlay on traycard. This image is printed over the background image (tray-image) as well as the list of items. Therefore, this is useful for things like barcodes. In terms of EPS file requirements, see the--tray-imageoption description. π--tray-overlay-scaleratio tray_overlay_image_scaleratio[,image_x_offset,image_y_offset_inches]β the ratio by which you want to scale the epsfile that is used with the--tray-overlayoption, and optionally to translate the overlay. Normally overlay image is printed on the tray so that the bottom-right of the image is anchored to the bottom-right of the tray. To move the images away from the bottom and right borders, use this option. For example, to leave0.1inches of gap between the image and the bottom border, and0.2inches from the right border, and use1.0scaleratio (no scaling), use this:--tray-overlay-scaleratio 1.0,-0.2,0.1π
β¨ EXAMPLES β¨
Ok bestie, copy-paste inspo time, these are verbatim π«Ά
cdlabelgen -c "My Filesystem"
-s "/usr/local/foo"
-e postscript/recycle.eps > foo.ps
cdlabelgen -c "title of cd"
-s "subtitle"
-i "Item 1%and Item 2%a third item here perhaps"
-e postscript/recycle.eps -o bar.ps
cdlabelgen -c "Fitz"
-s "home directory"
-o qux.ps
cdlabelgen -c "Backups"
-s "home directory"
-n "4 of 5"
Direct printing on a CD or DVD, if file "example5.txt" has list of items:
cdlabelgen --clip-items --no-tray-plaque --date "Jan 2005"
-c "Collections 12" -s "- english songs -"
--cover-image "music2.eps" --cover-image-scaleratio 0.0
--tray-image "mp3.eps" --tray-image-scaleratio 0.5,-0.5,2
--page-offset 0.5,0.5 -f example5.txt -o test.ps
π CHARACTER ENCODINGS - using ogonkify π
okay so bestie, here's the tea on text: cdlabelgen uses the Helvetica family of fonts for all the various text items, and it rocks the default encoding of ISO-Latin1. that's the vibe by default π
but what if you need a different encoding?? no worries. you can use a program called ogonkify β it's a package you can grab at http://www.pps.jussieu.fr/~jch/software/ogonkify/ β¨
the move is: pipe the output from cdlabelgen straight into ogonkify. here's the example for Latin2 encoding, periodt:
cdlabelgen <args> | ogonkify -H -eL2 > <outputfilename>
and if you wanna see all the other possible values for the encoding, go check out the man page for ogonkify π«Ά
π‘ Hint: if you always work with one particular encoding, you can just runogonkifyontemplate.psβ and then use that output as your newtemplate.ps. iconic, honestly.
ogonkify -H -eL2 template.ps > template-enc.ps
this way ogonkify only has to run once, and the cdlabelgen output will contain the correctly encoded fonts from the modified template.ps π use the -t cdlabelgen option to point at the new template-enc.ps file β or, alternatively, save the old template.ps and rename template-enc.ps to template.ps. (yes the original spells it "renmae", we love a typo, it's part of the lore π)
π¨οΈ PRINTING π¨οΈ
so when you're using tools like Adobe Acrobat to print the .ps or a .pdf file, you MUST make sure that the "Fit To Paper" option is unchecked. also uncheck any option that would scale the cdlabelgen output file up or down. not me being dramatic β this is real π«
β οΈ if you don't do this, you will get incorrect size printouts. that's it. that's the consequence. π
Paper Sizes: Normal CD cases, Slim CD cases, and DVD inside inserts can all be printed on a letter or A4 sized page, easy πΈ but CD/DVD Envelopes and DVD outside inserts will not fit on a letter sized paper β you're gonna need a larger paper size to make it fit, bestie. no cap.
and when you're using different sized paper, you might need to experiment with the -y (also: --page-offset) [<page_x_offset_inches,]<page_y_offset_inches> option to place the image in the printable region of the paper π
π AUTHOR π
Avinash Chopde <avinash@aczoom.com>
Original author: B. W. Fitzpatrick <fitz@red-bean.com>
π THANKS π
shoutout to the whole squad, fr fr π«Ά
- Karl Fogel, for general encouragement and that free software vibe
- Adam Di Carlo, for bug testing, help and making the
.deb - Greg Gallagher, for bug testing, coding, and tons of suggestions
- Goran Larsson, for feedback and date fixes
- Jens Claussen, for the patch to allow arbitrary
ISO-Latin1characters - Bernard Quatermass, for contributing several excellent new features
- Sebastian Wenzler <sick@home.and.drunk.at> for reports, tests, RPM
['01] - Peter Bieringer <pb@bieringer.de> for RPM
.specfile['02] - Ronald Rael Harvest <number6@cox.net> for original envelope template
['02] - Alessandro Dotti Contra <alessandro.dotti@libero.it> for color support, man page and other improvements
['02] - Mathias Herberts
- Mathias Herberts <Mathias.Herberts@iroise.net>, for slim cdcase foldout
- Stephan Grund <Stephan.Grund@isst.fraunhofer.de>, for monospaced font and for rotated-end-caps text support
- Dominique Dumont <dod@debian.org>
- for half-height DVD case support
- for slim-double depth DVD case support
- (patches forwarded by Juan Manuel Garcia Molina <juanma@debian.org>)
- Peter Bieringer <pb@bieringer.de> for testing CD label printint
['05](yes, "printint", the typo lives on, we cherish her π) - Andras Salamon <asalamon@chello.hu> for double-width DVD support
['08]
πΈ TODO πΈ
the things we're still dreaming about, bestie:
- β Word wrap does not work well at all. It will clip lines, or it will auto-reduce the font size β and both of those options look bad. π
- β Ability to change the text style on a given line:
{#B}Track# {#P}Title {#I} Text...
(Workaround available: just use multi columns input, use blank lines to spread out input items into columns)
- β Ability to select or specify fonts for the text/items
and that's a wrap, bestie π this lil page is from perl v5.10.0, dated 2012-04-15, and it's the CDLABELGEN(1) manual page itself. slay, go make some iconic CD labels π
β¨π¦
π¦ where this page comes from
- fedora 43: cdlabelgen 4.3.0-24.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 44: cdlabelgen 4.3.0-26.fc44 Β· LicenseRef-Callaway-BSD-with-advertising
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms