xref: /freebsd/contrib/file/magic/Magdir/printer (revision ae316d1d1cffd71ab7751f94e10118777a88e027)
1
2#------------------------------------------------------------------------------
3# $File: printer,v 1.36 2024/08/27 18:50:57 christos Exp $
4# printer:  file(1) magic for printer-formatted files
5#
6
7# PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
80	string		%!		PostScript document text
9!:mime	application/postscript
10!:apple	ASPSTEXT
11>2	string		PS-Adobe-	conforming
12>>11	string		>\0		DSC level %.3s
13>>>15	string		EPS		\b, type %s
14>>>15	string		Query		\b, type %s
15>>>15	string		ExitServer	\b, type %s
16>>>15   search/1000		%%LanguageLevel:\040
17>>>>&0	string		>\0		\b, Level %s
18# Some PCs have the annoying habit of adding a ^D as a document separator
190	string		\004%!		PostScript document text
20!:mime	application/postscript
21!:apple	ASPSTEXT
22>3	string		PS-Adobe-	conforming
23>>12	string		>\0		DSC level %.3s
24>>>16	string		EPS		\b, type %s
25>>>16	string		Query		\b, type %s
26>>>16	string		ExitServer	\b, type %s
27>>>16   search/1000		%%LanguageLevel:\040
28>>>>&0	string		>\0		\b, Level %s
290	string		\033%-12345X%!PS	PostScript document
30
31# DOS EPS Binary File Header
32# From: Ed Sznyter <ews@Black.Market.NET>
33# Update:	Joerg Jenderek
34# URL:		http://fileformats.archiveteam.org/wiki/Encapsulated_PostScript
35# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/eps-adobe.trid.xml
36# Note:		called "Encapsulated PostScript binary" by TrID and
37#		verified partly by ImageMagick `identify -verbose *` as EPT (Encapsulated PostScript with TIFF preview)
380       belong          0xC5D0D3C6
39# skip DROID fmt-122-signature-id-174.eps fmt-123-signature-id-178.eps fmt-124-signature-id-180.eps
40# by looking for content after header
41# GRR: in version 5.44 unequal and not endian variant not working!
42>32	ulelong		>0		DOS EPS Binary File
43!:mime	image/x-eps
44# TODO: check that "long" is false on big endian machines
45# Postscript often (850/857) comes after header; so values like: 30 32 or 2788 10644 43350 71828
46>>4      long            >0              at byte %d
47# 1 space char after length value to get phrase like "length 263893 PostScript document text"
48>>>8     long            >0              length %d
49# PostScript document text handled by ./printer
50>>>>(4.l)	indirect		x
51# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/e/eps-wmf.trid.xml
52# Note:		called "Encapsulated PostScript binary (with WMF preview)" by TrID
53#		verified partly by XnView `nconvert -info *.EP?` as TIFF epsp
54>>>>12   long            >0               at byte %d
55!:ext	eps
56# GRR: in file version 5.44 calling indirect of ./msdos produce phrase like "length 452\012- Windows metafile"
57>>>>16  long            >0              length %d
58# Windows metafile data handled by ./msdos
59>>>>>(12.l)	indirect		x
60# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/e/eps-tiff.trid.xml
61# Note:		called "Encapsulated PostScript binary (with TIFF preview)" by TrID
62>>>>20   long            >0              at byte %d
63# For the variant with the TIFF preview image sometimes the file extension ept is used
64!:ext	eps/ept
65# GRR: in file version 5.44 calling indirect of ./images produce phrase like "length 43320\012- TIFF image data,"
66>>>>>24  long            >0              length %d
67# TIFF image data handled by ./images
68>>>>>>(20.l)	indirect		x
69
70# Summary: Adobe's PostScript Printer Description File
71# Extension: .ppd
72# Reference: https://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf, Section 3.8
73# Submitted by: Yves Arrouye <arrouye@marin.fdn.fr>
74#
750	string		*PPD-Adobe:\x20	PPD file
76>&0	string		x		\b, version %s
77!:ext	ppd
78!:mime	application/vnd.cups-ppd
79
80# HP Printer Job Language
810	string		\033%-12345X@PJL	HP Printer Job Language data
82# HP Printer Job Language
83# The header found on Win95 HP plot files is the "Silliest Thing possible"
84# (TM)
85# Every driver puts the language at some random position, with random case
86# (LANGUAGE and Language)
87# For example the LaserJet 5L driver puts the "PJL ENTER LANGUAGE" in line 10
88# From: Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
89# Rick Richardson <rickrich@gmail.com>
90
91# For Fuji-Xerox Printers - HBPL stands for Host Based Printer Language
92# For Oki Data Printers - HIPERC
93# For Konica Minolta Printers - LAVAFLOW
94# For Samsung Printers - QPDL
95# For HP Printers - ZJS stands for Zenographics ZJStream
96>0	search/10000	@PJL\ ENTER\ LANGUAGE=HBPL	- HBPL
97>0	search/10000	@PJL\ ENTER\ LANGUAGE=HIPERC	- Oki Data HIPERC
98>0	search/10000	@PJL\ ENTER\ LANGUAGE=LAVAFLOW	- Konica Minolta LAVAFLOW
99>0	search/10000	@PJL\ ENTER\ LANGUAGE=QPDL	- Samsung QPDL
100>0	search/10000	@PJL\ ENTER\ LANGUAGE\ =\ QPDL	- Samsung QPDL
101>0	search/10000	@PJL\ ENTER\ LANGUAGE=ZJS	- HP ZJS
102# From: Stefan Thurner <thurners@nicsys.de>
103>&0	search/10000	%!			PJL encapsulated PostScript document text
104# Summary:	Hewlett-Packard printer firmware update
105# From:		Joerg Jenderek
106# URL:		https://support.hp.com/us-en/drivers/selfservice/hp-envy-6000e-all-in-one-printer-series/2100187505/model/2100187513
107# Note:		firmware update tested with ENVY 6000 All-in-One Printer
1080	string		@PJL\ ENTER\ LANGUAGE=FWUPDATE2	HP Printer firmware update
109#!:mime	application/octet-stream
110#!:mime	application/x-hp-firmware
111# https://ftp.hp.com/pub/softlib/software13/printers/en6000/2214/EN6000_2214B.exe
112# vasari_base_dist_pp1_001.2214B_nonassert_appsigned_lbi_rootfs_secure_signed.ful2
113!:ext	ful2
114
115# HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
1160	string		\033E\033	HP PCL printer data
117>3	string		\&l0A		- default page size
118>3	string		\&l1A		- US executive page size
119>3	string		\&l2A		- US letter page size
120>3	string		\&l3A		- US legal page size
121>3	string		\&l26A		- A4 page size
122>3	string		\&l80A		- Monarch envelope size
123>3	string		\&l81A		- No. 10 envelope size
124>3	string		\&l90A		- Intl. DL envelope size
125>3	string		\&l91A		- Intl. C5 envelope size
126>3	string		\&l100A		- Intl. B5 envelope size
127>3	string		\&l-81A		- No. 10 envelope size (landscape)
128>3	string		\&l-90A		- Intl. DL envelope size (landscape)
129
130# IMAGEN printer-ready files:
1310	string	@document(		Imagen printer
132# this only works if "language xxx" is first item in Imagen header.
133>10	string	language\ impress	(imPRESS data)
134>10	string	language\ daisy		(daisywheel text)
135>10	string	language\ diablo	(daisywheel text)
136>10	string	language\ printer	(line printer emulation)
137>10	string	language\ tektronix	(Tektronix 4014 emulation)
138# Add any other languages that your Imagen uses - remember
139# to keep the word `text' if the file is human-readable.
140# [GRR 950115:  missing "postscript" or "ultrascript" (whatever it was called)]
141#
142# Now magic for IMAGEN font files...
1430	string		Rast		RST-format raster font data
144>45	string		>0		face %s
145# From Jukka Ukkonen
1460	string		\033[K\002\0\0\017\033(a\001\0\001\033(g	Canon Bubble Jet BJC formatted data
147
148# From <mike@flyn.org>
149# These are the /etc/magic entries to decode data sent to an Epson printer.
1500       string          \x1B\x40\x1B\x28\x52\x08\x00\x00REMOTE1P        Epson Stylus Color 460 data
151
152
153#------------------------------------------------------------------------------
154# zenographics:  file(1) magic for Zenographics ZjStream printer data
155# Rick Richardson <rickrich@gmail.com>
1560	string		JZJZ
157>0x12	string		ZZ		Zenographics ZjStream printer data (big-endian)
1580	string		ZJZJ
159>0x12	string		ZZ		Zenographics ZjStream printer data (little-endian)
160
161
162#------------------------------------------------------------------------------
163# Oak Technologies printer stream
164# Rick Richardson <rickrich@gmail.com>
1650       string          OAK
166>0x07	byte		0
167>0x0b	byte		0	Oak Technologies printer stream
168
169# This would otherwise be recognized as PostScript - nick@debian.org
1700	string		%!VMF 		SunClock's Vector Map Format data
171
172#------------------------------------------------------------------------------
173# HP LaserJet 1000 series downloadable firmware file
1740	string	\xbe\xefABCDEFGH	HP LaserJet 1000 series downloadable firmware
175
176# From: Paolo <oopla@users.sf.net>
177# Epson ESC/Page, ESC/PageColor
1780	string	\x1b\x01@EJL	Epson ESC/Page language printer data
179
180# Summary:	Hewlett-Packard Graphics Language
181# From:		Joerg Jenderek
182# URL:		http://fileformats.archiveteam.org/wiki/HP-GL
183#		https://en.wikipedia.org/wiki/HPGL
184# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/h/hpg.trid.xml
185# Note:		called "Hewlett-Packard Graphics Language" by TrID and
186#		"Hewlett Packard Graphics Language" by DROID via PUID x-fmt/293 and
187#		HPGL by XnView command `nconvert -info *`
188# initialize, start a plotting job
1890	string	IN;
190>0		use		hpgl
191# fill.plt
1920	string	INPS
193>0		use		hpgl
194# http://ftp.funet.fi/index/graphics/packages/hpgl2ps/hpgl2ps.tar.Z/hpgl2ps/test1.hpgl
1950	string	DF;
196>0		use		hpgl
197# http://ftp.funet.fi/index/graphics/packages/hpgl2ps/hpgl2ps.tar.Z/hpgl2ps/test3.hpgl
198# Select Pen n; If no pen number or 0, the controller performs an end of file command; n in range between -32767 and 32768 like: 6
1990	string	SP
200# skip text Linux-syscall-note inside qemu sources starting with SPDX-Exception-Identifier: Linux-syscall-note
201# by checking for valid Pen number
202>2	regex	\^([0-9]{1,5})
203#>2	regex	\^([0-9]{1,5})	PEN_NUMBER=%s
204>>0		use		hpgl
205# charsize.hp pages.hp	set the scaling points (P1 and P2) to their default positions
2060	string	IP0
207>0		use		hpgl
208# ci.hp
2090	string	CO\040
210>0		use		hpgl
211# iw.hp 286x192.5_lh.hpg 286x192.5_lq.hpg
2120	string	PS\040
213>0		use		hpgl
214# thick.hp
2150	string	PS9
216>0		use		hpgl
217# ul.hp
2180	string	PS4
219>0		use		hpgl
220# la.hp
221# Too weak
222#0	string	BP
223#>0		use		hpgl
224# miter.hp
225# Plot Absolute x,y{,x,y{...}}; x and y in range between -32767 and 32768 like: PA4000,3000;
2260	string	PA
227# skip shell scripts test_msa_run_32r5eb.sh test_msa_run_32r5eb.sh with variable PATH_TO_QEMU
228# by checking for valid x coordinate
229>2	regex	\^([-]{0,1}[0-9]{1,5})
230#>2	regex	\^([-]{0,1}[0-9]{1,5})	COORDINATE=%s
231>>0		use		hpgl
232# pw.hpg	number of pens x
233# Too weak
234#0	string	NP
235#>0		use		hpgl
236# win_1.hp
237#0	string	\003INCA		WHAT_IS_THAT
238#>0		use		hpgl
239# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/h/hpgl2.trid.xml
240# Note:		called "Hewlett-Packard Graphics Language 2" by TrID
2410	string	\033%-1B		Hewlett-Packard Graphics Language 2
242!:mime	application/vnd.hp-HPGL
243# like: dt.plt
244!:ext	plt
245#!:ext	plt/gl2/hpg2/spl
246# remaining part after escsape sequnce
247>5	string	x			with "%-.10s"
248#	display Hewlett-Packard Graphics Language vector graphic information
2490	name				hpgl
250>0	string	x			Hewlett-Packard Graphics Language
251#!:mime	vector/x-hpgl
252# https://www.iana.org/assignments/media-types/application/vnd.hp-HPGL
253!:mime	application/vnd.hp-HPGL
254# no example with HPL suffix found
255!:ext	hpgl/hpg/hp/plt
256# like: "IN;" "DF;IN;LT;PU1000,1000;PD2000,10" "SP6;DI0,1;SR0.70,1.90;SC0,800,"
257# "CO Concentric circles drawn with different linewidths;"
258>0	string	x			\b, starting with "%-.54s"
259# continue but not for 1 long line without CR or LF
260>>&0	ubyte	<0x0E
261#>>&0	ubyte	<0x0E			TERMINATOR=%x
262# second line after 1 terminator character
263>>>&0	string	>\r			with "%-.10s"
264# next character again CR or LF
265>>>&0	ubyte	<0x0E
266#>>>&0	ubyte	<0x0E			2ND_CHARACTER=%x
267# second line after 2 terminator characters
268>>>>&0	string	>\r			with "%-.10s"
269