Vio-PDF 1.0
A viewer for PDF documents on Violyx, by Merecete.

Vio-PDF reads PDF files itself, without any library: the objects and cross-reference tables
(also as streams, with object streams, incremental updates and linearised files), damaged files
(the objects are searched for), encrypted documents (RC4 40 and 128 bit, AES 128 and 256 bit;
a password is asked for when one is needed) and all common stream filters. It draws the pages
with smooth edges:

  Text        TrueType, OpenType/CFF, Type 1 and Type 3 fonts, composite fonts (CID, Identity
              and embedded CMaps), also Japanese, Chinese and Korean when the font is embedded.
              Fonts that are not embedded are replaced by Liberation Sans, Serif and Mono (with
              the same widths as Helvetica, Times and Courier) and DejaVu Sans for Symbol and
              ZapfDingbats.
  Graphics    paths, lines with joins, caps and dashes, clipping, colours in grey, RGB, CMYK,
              Lab, ICC, Indexed, Separation and DeviceN, axial, radial and function shadings,
              triangle meshes and patches, tiling patterns, transparency (alpha, groups, soft
              masks, blend modes), optional content (hidden layers stay hidden)
  Images      JPEG (also progressive and CMYK), Flate, LZW, fax (CCITT G3 and G4), any number
              of bits and colour spaces, masks and soft masks. Big images are made smaller while
              they are read.
  Forms       the appearances of form fields and other annotations

Not yet: images in JPEG 2000 (JPX) and JBIG2 show as a light grey area.

Viewing
  Vio-PDF takes the whole screen and shows the page at the width of the window. It takes
  memory only as a document needs it (a few dozen MB for most). It opens the
  document of last time at its page, or asks for a file.
  Page Down/Up, Space        next / previous page (long pages scroll first)
  Arrows                     move; at the end of a page on to the next
  Home / End                 first / last page
  G                          go to a page
  + / -                      bigger / smaller (an A4 page up to about 350 %)
  B / S                      page width / whole page
  D                          turn by 90 degrees
  I                          table of contents (bookmarks): arrows and Enter jump
  / or Ctrl+F                find text; N next, P previous find (marked on the page)
  O or Ctrl+O                open a PDF
  E                          properties: title, author, producer, pages, version, encryption
  F                          full screen
  F1                         all keys
  Esc                        closes a window, then Vio-PDF
  The same in the menu (F10): Vio-PDF > Open, Go to page, Contents, Find, ..., Info.
  Info shows the version and the licences (L).

Install
  Copy viopdf.vpk to Violyx and press Enter on it in Files, or type: install viopdf.vpk

Build
  Copy viopdf.c, the pdf_*.h files and viopdf-icon.png into the examples folder of the Violyx
  SDK (sdk/ in the Violyx source) and run there:

  make APP=examples/viopdf NAME=viopdf TITLE=Vio-PDF EXTRA='-Ihelpers/inc' VPKFLAGS='--cols 76 --rows 20 --version 1.0 --author Merecete --icon "▐▀▀▀▀▌|▐PDF ▌|▐▄▄▄▄▌" --icon-png examples/viopdf-icon.png'

  Two headers are made by scripts in tools/ (Python 3 with fontTools and pypdf):
  pdf_tables.h   python3 tools/gen_tables.py pdf_tables.h
                 the encodings of PDF, the Adobe Glyph List, the standard strings of CFF
  pdf_fonts.h    python3 tools/gen_fonts.py /usr/share/fonts/truetype/liberation /usr/share/fonts/truetype/dejavu pdf_fonts.h
                 subsets of the Liberation fonts and of DejaVu Sans, compressed

The parts of the source
  viopdf.c       the viewer: screen, keys, panels, opening, finding
  pdf_base.h     memory in arenas, strings, matrices
  pdf_filter.h   inflate, LZW, ASCII85, ASCIIHex, RunLength, predictors
  pdf_crypt.h    MD5, SHA-256/384/512, RC4, AES
  pdf_parse.h    lexer, objects, cross-reference, object streams, repair, decryption
  pdf_doc.h      pages, information, outline, text in code page 437
  pdf_raster.h   paths, strokes, filling with smooth edges, clipping, blend modes
  pdf_font.h     TrueType, CFF and Type 1 programs, glyph outlines
  pdf_pfont.h    the fonts of a PDF: encodings, widths, CMaps, substitutes
  pdf_jpeg.h     JPEG decoder
  pdf_ccitt.h    CCITT fax decoder
  pdf_color.h    functions and colour spaces
  pdf_image.h    images and masks
  pdf_shade.h    shadings
  pdf_render.h   the content streams, forms, patterns, groups, annotations
  pdf_text.h     the text of a page, for finding

Licence
  Vio-PDF: BSD 3-Clause License, see LICENSE. Copyright (c) 2026, Merecete.
  The fonts for PDFs without their own: Liberation (SIL Open Font License 1.1, as subsets
  without their names) and DejaVu Sans (Bitstream Vera licence), see LICENSE-FONTS.
  The Adobe Glyph List in pdf_tables.h: BSD 3-Clause License, Copyright 2002-2019 Adobe,
  see LICENSE-FONTS.
