#compdef mupdf

local -a ext=(
  cbt
  cbz
  tar
  zip
  epub
  gproof
  fb2
  htm
  html
  xhtml
  xml
  bmp
  gif
  hdp
  j2k
  jfif
  jfif-tbnl
  jp2
  jpe
  jpeg
  jpg
  jpx
  jxr
  pam
  pbm
  pgm
  png
  pnm
  ppm
  tif
  tiff
  wdp
  pdf
  pclm
  ai
  svg
  oxps
  xps
)

_arguments -S -s -A '-*' \
  '-b[Use the given page box (MediaBox, CropBox, BleedBox, TrimBox, or ArtBox)]' \
  '-c[Set the display ICC profile to the one in the named file]' \
  '-p+[Uses the given password to open an encrypted PDF file]' \
  '-r[Changes the initial zoom level, specified as the resolution in dpi]' \
  '-A+[Changes the anti-aliasing quality, specified as a number of bits between 0]' \
  '-B[Sets the full-page black tint using hexadecimal color syntax]' \
  '-C+[Sets the full-page white tint using hexadecimal color syntax]' \
  '-H[Page height in points for EPUB layout]' \
  '-I[Invert colors]' \
  '-J[Disable JavaScripts in PDF forms]' \
  '-R[Enable reflow and set the text extraction options]' \
  '-S+[Font size in points for EPUB layout]' \
  '-U+[User style sheet for EPUB layout]' \
  '-W+[Page width in points for EPUB layout]' \
  '-X[Disable document styles fro EPUB layout]' \
  '-Y[Set the UI scaling factor]' \
  ': :_files -g "*(#i).(${(j:|:)ext})(-.)"'
