Oninit Logo
The Down System Specialists
+1-913-732-8892
+44-2081-337529
Partnerships Contact
Overview
Output Modes
HTML JSON PDF
Try It
Convert SQL
Download
Download
Reference
Glossary

Oninit® QueryLens — PDF output

-p <path> (or --pdf <path>) emits a bookmarked PDF. The PDF mirrors the structure and link semantics of the HTML output — a cover page, a hyperlinked summary, the syntax-highlighted source as the body, and a two-level outline tree for quick navigation. Internal references in the source body are clickable link annotations that jump to the corresponding CREATE statement.

sql2html --pdf schema.pdf -h "Production schema" -2 < schema.sql
gunzip -c sysmaster.gz | sql2html --pdf sysmaster.pdf -h "sysmaster"

A path is required because PDF is binary and is not piped to stdout.

Document structure

SectionContents
CoverTitle from -h <title> (or "Untitled Schema"), generation timestamp, default dbname / dbserver / owner, and per-category object counts.
SummaryOne or more pages listing every registered object grouped by category, each entry hyperlinked to its anchor in the source body. PDF always includes the summary — the HTML -s flag has no PDF effect.
SourceThe entire input rendered in monospace, with the same per-token-class colours as the HTML output. Each CREATE keyword is the destination of a named anchor; each resolved reference is a clickable link to that destination.

Outline / bookmark tree

The PDF outline is a two-level tree:

- Summary
- Source
  - User Defined Types
    - <udt name>
  - Tables
    - <table name>
  - Temporary Tables / Synonyms / Views / Routines / Aggregates /
    Indexes / Triggers / Constraints
    - ...

Unlike the HTML summary, the PDF outline includes Indexes, Triggers, Temporary Tables, and Constraints as additional categories — the outline is the primary navigation aid in a PDF reader. Empty categories are omitted. The "Source" top-level node is opened by default; the category sub-trees are collapsed so large schemas render compactly on first open.

Anchor parity

Each leaf bookmark and every inline cross-reference targets a PDF named destination identified by {type}_{name} (or {type}_{name}_{line} for temp tables) — the same string used by the HTML <A NAME="..."> anchor and the JSON anchor field. A tool that knows the HTML anchor scheme — the JSON output, external link generators — can deep-link straight into the PDF.

Link rendering

Hyperlinks in the source body keep their underlying token colour (navy keywords, teal datatypes, black identifiers, and so on) and are rendered without the default thin-blue link border so the rendered source still reads as code. Forward references resolve cleanly in two-pass mode (-2) — the link annotations are created after the destinations exist, so they never point at nothing.

What every conforming PDF satisfies

ElementGuarantee
Document titleEquals the -h argument (or "Untitled Schema" if absent).
OutlineA non-empty outline / bookmark tree per the structure above.
HTML anchorsEvery HTML anchor is present as a PDF named destination, sharing the same identifier string.
HTML cross-referencesEvery HTML cross-reference is present as a PDF link annotation targeting the matching destination.
Source bodyUses the HTML token-colour palette.

Implementation notes

The PDF emitter is embedded in the binary — it writes PDF directly from the same token stream that drives HTML. No external converter, no intermediate HTML pass, no runtime dependency on browser engines. Page size is US Letter; fonts are the built-in PDF Type-1 fonts (Helvetica for chrome, Courier for the source body), so the binary embeds no font data and the resulting PDFs open cleanly in any reader.

To discuss how Oninit ® can assist please call on +1-913-732-8892 or alternatively just send an email specifying your requirements.


You get all this for free.. think about what you get if you pay us