DJVUDIGITAL(1)

πŸ’– DJVUDIGITAL β€” the DjVuLibre-3.5 era glow-up, bestie πŸ’–

okay so. this is the manual page for djvudigital from DjVuLibre-3.5, and honestly? it's giving "make pretty compressed documents out of your boring old PS and PDF files." sit down, grab a boba, and let's get into it πŸ§‹βœ¨


🌸 NAME 🌸

djvudigital β€” creates DjVu files from PS or PDF files.

like. it takes your PostScript or PDF and turns it into a DjVu. that's the whole personality. periodt. πŸ’…


✨ SYNOPSIS ✨

djvudigital [options] inputfile [outputfile]

yes bestie, inputfile is required, outputfile is optional, and [options] is where all the fun lives. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

This program creates a DjVu file from the PostScript (.ps), GZipped PostScript (.ps.gz), Encapsulated PostScript (.eps), or Portable Document Format (.pdf) file inputfile.

The output file name is either given by argument outputfile, or β€” and this is the lowkey iconic part β€” it gets generated by replacing the input file name suffixes with the DjVu suffix (.djvu). automatic naming?? we love to see it 😌


🫢 PREREQUISITES 🫢

This program depends on a specific GhostScript driver. If your GhostScript program does not provide this driver, please check http://djvu.sourceforge.net/gsdjvu.html.

fr fr, no driver = no vibes. go check that link, bestie.

πŸ’… OPTIONS πŸ’…

the main character section. buckle up. 🎒

  • --verbose, -v β€” Displays more informational messages while converting the file. it's chatty. it wants to tell you everything. we support it.
  • --quiet, -q β€” Do not display informational messages while converting the file. the "do not perceive me" setting πŸ™ˆ
  • --dpi=resolution β€” Specify the desired resolution to resolution dots per inch. The default is 300 dpi.
  • --psrotate=angle β€” Rotate the PostScript file by angle degrees clockwise. Only the values 0, 90, 180, and 270 are supported. This option only applies to PostScript files. PDF files are always converted according to their native orientation. so PDFs? they said "i'm built different" and kept their own orientation. no cap.
  • --epsf=disposition β€” Specify how to handle Encapsulated PostScript files. Argument disposition can take the values crop, fit, and ignore. The default disposition crop creates a DjVu file whose size matches the bounding box of the Encapsulated PostScript file. Value fit rescales the graphics to the default page size. Value ignore disables all Encapsulated PostScript specific code. This option requires Ghostscript 7.07 or better. πŸ‘‘
  • --exact-color β€” Enables a more accurate rendering of the colors. This option requires GhostScript 6.52 or better. accurate colors are, and i say this with love, the moment. 🌈
  • --threshold=thres β€” Specify a threshold for the foreground/background separation code. Acceptable values of thres range from 0 to 100. Larger values place more information into the foreground layer. The default threshold value is 80.
  • --bg-subsample=sub β€” Specify the background subsampling ratio. Argument sub must be an integer between 1 and 6. The default value is 3.
  • --bg-slices=n+...+n β€” Specify the encoding quality of the background layer. The syntax for the argument is similar to that described for the -slice option of command c44. The default is 72+11+10+10. yes it really is plus signs. no i don't make the rules. πŸ“
  • --fg-colors=ncolors β€” Specify the maximum number of distinct colors in the foreground layer. Argument ncolors can take integer values between 1 and 4000. The default value is 256.
  • --fg-image-colors=ncolors β€” Specify the maximum number of distinct colors in an image for considering encoding it into the foreground layer. Argument ncolors can take integer values between 1 and 4000. The default value is 256. (yes, twin to the one above, but for images. they're sisters, not the same person πŸ’œ)
  • --words β€” Extract the text from the PostScript code and incorporates this information into the DjVu file. This option records the location of every word. every. single. word. meticulous queen πŸ’–
  • --lines β€” Extract the text from the PostScript code and incorporates this information into the DjVu file. This option saves a few bytes by only recording the location of each line. budget-friendly and still slaying πŸ’€
  • --gsarg=arg1[,arg2,...,argN] β€” Insert extra arguments on the GhostScript command line.
  • --cseparg=arg1[,arg2,...,argN] β€” Insert extra arguments on the command line of program csepdjvu or msepdjvu.
  • --poppler=keywords β€” This option causes djvudigital to extract additional information from PDF files using the tool pdftotext that comes bundled with the Poppler library. Selected information is then added to the djvu file as a postprocessing step. This option is ignored when the input file is not a PDF file. Argument keywords is a comma separated list of keywords. When this list contains keyword meta, the metadata extracted by pdftotext is inserted into the djvu file. When this list contains keyword text, the textual information extracted by pdftotext is inserted into the djvu file, possibly replacing the information gathered using the options --words or --lines. This is useful for instance when a scanned PDF file contains a hidden text layer that is not recognized by Ghostscript and therefore not passed to the djvudigital backend. it's giving "found the secret lore that was hiding in plain sight" πŸ“œβœ¨
  • --sepfile β€” Produces a separated data file instead of a DjVu file. Program csepdjvu can then convert the separated data file into a DjVu file.
  • --check β€” Display the names of the two auxiliary programs found by djvudigital, namely a suitable ghostscript interpreter and a suitable backend encoder. See the next two section for details.
  • --dryrun β€” Simply display the ghostscript command line generated by djvudigital without running it. No output file is produced. it's all talk, no action. and honestly? sometimes you need that 🫢
  • --help β€” Display the manual page for djvudigital.

πŸ‘» GHOSTSCRIPT ISSUES πŸ‘»

Program djvudigital internally relies on a specific Ghostscript driver named djvusep. This driver analyzes the logical structure of the sequence of PostScript rendering commands and decides to execute each command into either the foreground or the background layer. The GhostScript driver produces a separated data file that is then compressed using the DjVuLibre program csepdjvu.

Before processing the input file, program djvudigital searches a Ghostscript executable providing the djvusep driver. The search starts with the file specified by the environment variable GSDJVU and continues with command line executables named gs and gsdjvu.

The DjVuLibre source code contains instruction to compile such a GhostScript executable. More information can be obtained from http://djvu.sourceforge.net/gsdjvu.html.

so basically: it goes looking for GSDJVU first, then gs, then gsdjvu. like checking your bestie's story, then your group chat, then your texts. in that order. πŸ’Œ

πŸ”₯ CSEPDJVU ISSUES πŸ”₯

The output of the djvusep GhostScript driver must be processed by the DjVuLibre program csepdjvu. This program can also be replaced by the the proprietary Lizardtech program msepdjvu. Before processing the input file, program djvudigital searches such an executable. The search starts with the file specified by the environment variable CSEPDJVU and continues with command line executables named msepdjvu and csepdjvu.


🌟 OTHER PROGRAMS 🌟

The option --poppler=keywords relies on the tool pdftotext that comes with the Poppler library and the tool djvused that comes with djvulibre. Only recent versions of pdftotext that accept the option -bbox are supported. Both tools are searched by first trying the files specified by the environment variables PDFTOTEXT and DJVUSED, and then trying executables named pdftotext or djvused found along the shell executable path.


πŸ’ CREDITS πŸ’

The first version of this converter was written by LΓ©on Bottou <leonb@users.sourceforge.net> in AT&T Labs. The DjVuLibre version is derived from code graciously released by Lizardtech in January 2004.

shoutout to LΓ©on Bottou for laying down the blueprint, and Lizardtech for the January 2004 drop. legends only πŸ‘‘πŸ’œ

πŸ’€ BUGS πŸ’€

Program djvudigital can only process input files that GhostScript can process properly.

yeah. that's the whole bug section. it's short, it's honest, it's giving "if gs can't read it, i can't help you." 😭

πŸ¦‹ SEE ALSO πŸ¦‹

djvu(1), csepdjvu(1), c44(1), gs(1), gzip(1)


and that's the page, bestie 🫢 this was DjVuLibre-3.5, dated 1/31/2004 β€” so go forth, convert your files, and remember: if GhostScript can't handle it, nobody can. mwah πŸ’‹βœ¨πŸŽ€