EXTRACTBB(1)

πŸ’– EXTRACTBB(1) πŸ’–

okay bestie, welcome to the DVIPDFMx corner of the manual, where we talk about extractbb (and its little twin ebb) πŸŽ€


✨ NAME ✨

extractbb, ebb β€” extract bounding box information from graphics files πŸ–ΌοΈβœ¨


🌸 SYNOPSIS 🌸

extractbb [-v|-q] [-O] [-m|-x] file...

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe. for every JPEG, PNG, or PDF file you hand it on the command line, extractbb pulls out the bounding box information and writes it into a file with the extension .xbb, plus some header info on top. those files then get used by dvipdfmx or other programs, iykyk. πŸ“¦

for PDF files specifically, it also reports the number of pages and the PDF version number. slay. and the input filename extension? upper case or lower case, it literally does not care. πŸ‘‘

if you call it as ebb, the output gets written in the ``bb'' format instead (with the extension .bb), exactly like dvipdfm used to do it. and heads up β€” Xbb might be defined as a synonym for extractbb on your system. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -v β€” be verbose. spill the tea, tell me everything. πŸ—£οΈ
  • -q β€” be quiet. not a word. 🀫
  • -O β€” write the output to standard output instead. πŸ‘€
  • -m β€” write the output in dvipdfm's ``bb'' format.
  • -x β€” write the output in dvipdfmx's ``xbb'' format, which is the default, and which is the same one pdfTeX uses. ✨

πŸ’œ OUTPUT FORMATS πŸ’œ

here's the deeper lore on the bb and xbb formats, bestie, sit down πŸ“

the original ebb (the one from dvipdfm) straight up ignored density information in bitmap images, and generated bounding boxes assuming 100px = 72bp = 1in. and unfortunately β€” especially with screenshots β€” that approach tends to look bad. 😭 like, genuinely tragic.

so extractbb (the one from dvipdfmx) uses density information if it's present. if it's not present, it generates the bounding box with 100px = 100bp. and that? that's exactly what pdfTeX does. periodt. πŸ’…


πŸ’€ BUGS πŸ’€

ngl, there is currently no way to specify which bounding box gets taken for PDF files. it will always be the first one from this list, in this order:

  1. ArtBox
  2. TrimBox
  3. BleedBox
  4. MediaBox

(and often only MediaBox is even defined, so πŸ™ˆ)

also, the reported bounding box always refers to the first page in a PDF file. no cap.

πŸ‘‘ AUTHOR πŸ‘‘

extractbb was written by the DVIPDFMx project team <dvipdfmx@ktug.or.kr>, based on the program ebb by Mark A. Wicks. 🫢

this manual page was also written by the DVIPDFMx project team, based on a manual page Frank Küster <frank@kuesterei.ch> wrote for the Debian GNU/Linux system. and the best part? it may be used, modified, and/or redistributed by others without contacting the authors. iconic behavior fr fr 🌈


okay that's the whole page bestie, you ate that πŸ’– this was the DVIPDFMx extractbb manual, dated 20120420 / 20 April 2012, and you can find it living under EXTRACTBB(1). go forth and extract those bounding boxes, main character βœ¨πŸ‘‘πŸŽ€