Controlling pdfTeX Output Mode and PDF Version with \pdfoutput and \pdfminorversion
How to use pdfTeX's \pdfoutput and \pdfminorversion primitives to control output format and PDF version, with a working preamble example, verification via pdfinfo, and common pitfalls.
19 Jan 2026, 23:46 UTC

If you need a PDF/A-friendly file, a specific PDF version for a print shop, or DVI output for a legacy PostScript workflow, pdfTeX gives you two low-level primitives: \pdfoutput selects the output format, and \pdfminorversion selects the PDF version written into the file header. Set them at the very top of your document, before anything is typeset, and you control exactly what comes out of the engine.
What \pdfoutput actually does
\pdfoutput is an integer primitive built into the pdfTeX engine (the engine behind the common pdflatex command). The well-established values are:
0— produce DVI output, like classic TeX. Useful if your toolchain goes TeX → DVI → PostScript → PDF (e.g., viadvipsandps2pdf), which some PSTricks-heavy documents still require.1— produce PDF output directly. This is the default when you runpdflatex,pdftex, orlatexmk -pdf.
You may encounter third-party descriptions claiming additional modes (2, 3) with distinct feature levels. That does not match mainstream pdfTeX behavior — treat such claims as unverified and check your own engine's manual (texdoc pdftex) before relying on them. In standard pdfTeX, PDF features such as hyperlinks and embedded fonts are available whenever \pdfoutput=1; there is no separate "full" mode.
A worked configuration
Place the settings before \documentclass so they take effect before the output routine is initialized:
% Must come first, before \documentclass
\pdfoutput=1 % PDF mode (0 would give DVI)
\pdfminorversion=7 % write a PDF 1.7 header
\documentclass{article}
\usepackage{hyperref}
\begin{document}
Hello, versioned PDF.
\end{document}
Run this with pdflatex file.tex from a terminal in the document's directory. No special permissions are needed beyond write access to the working folder. The same lines work in plain pdfTeX documents (without \documentclass).
Valid \pdfminorversion values correspond to PDF 1.n: 4 gives PDF 1.4, 5 gives 1.5, 7 gives 1.7. pdfTeX's default has historically been 1.5; newer TeX Live releases may default higher, so set it explicitly if a publisher or printer demands a specific version.
Verifying the result
Two quick checks, both run from the command line after compiling:
pdfinfo file.pdf(part of Poppler, available in most Linux distributions and via Homebrew/MacPorts on macOS). ThePDF version:line should match your\pdfminorversionsetting, andProducer:should mention pdfTeX.- Open the PDF in a plain text editor and look at the first line: the header reads
%PDF-1.7(or whichever version you set). This is the value PDF readers use for compatibility decisions.
If the header does not match, the most common cause is that the primitive was set too late — after the first page was shipped out — and silently had no effect on the document-level version.
Limits and common mistakes
- Too late is too late. Both primitives must be set before the first page is written (before the first shipout). Setting
\pdfoutputin the preamble after packages have loaded, or mid-document, risks inconsistent output or is ignored outright. Put both lines at the very top of the file. - \pdfminorversion only matters in PDF mode. If
\pdfoutput=0(DVI), the version setting is meaningless — DVI files have no PDF version header. - Don't set the version higher than your features need. A very new minor version can trip older print-shop RIPs and legacy viewers. PDF 1.4 or 1.5 is the safest target for maximum compatibility unless you need a newer feature such as object streams or certain encryption levels.
- Engine mismatch. These primitives are pdfTeX-specific. Under XeLaTeX or LuaLaTeX they are absent or behave differently; LuaLaTeX uses
\outputmodeand\pdfvariable minorversioninstead. Check which engine your build actually runs (pdflatexvslualatex) before adding these lines. - Package interference. Some classes and PDF/A packages set these values themselves. If you use
pdfxfor archival output, let the package manage the version rather than overriding it.
Used early and verified with pdfinfo, these two primitives are a reliable, dependency-free way to pin down exactly what your pdfTeX build produces.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.