xref: /freebsd/contrib/file/magic/Magdir/printer (revision 4b9d6057)
1
2#------------------------------------------------------------------------------
3# $File: printer,v 1.34 2023/06/16 19:27:12 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#
900	string		\033%-12345X@PJL	HP Printer Job Language data
91>&0	string		>\0			%s
92>>&0	string		>\0			%s
93>>>&0	string		>\0			%s
94>>>>&0	string		>\0			%s
95#>15	string		\ ENTER\ LANGUAGE\ =
96#>31	string		PostScript		PostScript
97
98# From: Stefan Thurner <thurners@nicsys.de>
990	string		\033%-12345X@PJL
100>&0	search/10000	%!			PJL encapsulated PostScript document text
101
102# Rick Richardson <rickrich@gmail.com>
103
104# For Fuji-Xerox Printers - HBPL stands for Host Based Printer Language
105# For Oki Data Printers - HIPERC
106# For Konica Minolta Printers - LAVAFLOW
107# For Samsung Printers - QPDL
108# For HP Printers - ZJS stands for Zenographics ZJStream
1090	string		\033%-12345X@PJL	HP Printer Job Language data
110>0	search/10000	@PJL\ ENTER\ LANGUAGE=HBPL	- HBPL
111>0	search/10000	@PJL\ ENTER\ LANGUAGE=HIPERC	- Oki Data HIPERC
112>0	search/10000	@PJL\ ENTER\ LANGUAGE=LAVAFLOW	- Konica Minolta LAVAFLOW
113>0	search/10000	@PJL\ ENTER\ LANGUAGE=QPDL	- Samsung QPDL
114>0	search/10000	@PJL\ ENTER\ LANGUAGE\ =\ QPDL	- Samsung QPDL
115>0	search/10000	@PJL\ ENTER\ LANGUAGE=ZJS	- HP ZJS
116# Summary:	Hewlett-Packard printer firmware update
117# From:		Joerg Jenderek
118# URL:		https://support.hp.com/us-en/drivers/selfservice/hp-envy-6000e-all-in-one-printer-series/2100187505/model/2100187513
119# Note:		firmware update tested with ENVY 6000 All-in-One Printer
1200	string		@PJL\ ENTER\ LANGUAGE=FWUPDATE2	HP Printer firmware update
121#!:mime	application/octet-stream
122#!:mime	application/x-hp-firmware
123# https://ftp.hp.com/pub/softlib/software13/printers/en6000/2214/EN6000_2214B.exe
124# vasari_base_dist_pp1_001.2214B_nonassert_appsigned_lbi_rootfs_secure_signed.ful2
125!:ext	ful2
126
127# HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
1280	string		\033E\033	HP PCL printer data
129>3	string		\&l0A		- default page size
130>3	string		\&l1A		- US executive page size
131>3	string		\&l2A		- US letter page size
132>3	string		\&l3A		- US legal page size
133>3	string		\&l26A		- A4 page size
134>3	string		\&l80A		- Monarch envelope size
135>3	string		\&l81A		- No. 10 envelope size
136>3	string		\&l90A		- Intl. DL envelope size
137>3	string		\&l91A		- Intl. C5 envelope size
138>3	string		\&l100A		- Intl. B5 envelope size
139>3	string		\&l-81A		- No. 10 envelope size (landscape)
140>3	string		\&l-90A		- Intl. DL envelope size (landscape)
141
142# IMAGEN printer-ready files:
1430	string	@document(		Imagen printer
144# this only works if "language xxx" is first item in Imagen header.
145>10	string	language\ impress	(imPRESS data)
146>10	string	language\ daisy		(daisywheel text)
147>10	string	language\ diablo	(daisywheel text)
148>10	string	language\ printer	(line printer emulation)
149>10	string	language\ tektronix	(Tektronix 4014 emulation)
150# Add any other languages that your Imagen uses - remember
151# to keep the word `text' if the file is human-readable.
152# [GRR 950115:  missing "postscript" or "ultrascript" (whatever it was called)]
153#
154# Now magic for IMAGEN font files...
1550	string		Rast		RST-format raster font data
156>45	string		>0		face %s
157# From Jukka Ukkonen
1580	string		\033[K\002\0\0\017\033(a\001\0\001\033(g	Canon Bubble Jet BJC formatted data
159
160# From <mike@flyn.org>
161# These are the /etc/magic entries to decode data sent to an Epson printer.
1620       string          \x1B\x40\x1B\x28\x52\x08\x00\x00REMOTE1P        Epson Stylus Color 460 data
163
164
165#------------------------------------------------------------------------------
166# zenographics:  file(1) magic for Zenographics ZjStream printer data
167# Rick Richardson <rickrich@gmail.com>
1680	string		JZJZ
169>0x12	string		ZZ		Zenographics ZjStream printer data (big-endian)
1700	string		ZJZJ
171>0x12	string		ZZ		Zenographics ZjStream printer data (little-endian)
172
173
174#------------------------------------------------------------------------------
175# Oak Technologies printer stream
176# Rick Richardson <rickrich@gmail.com>
1770       string          OAK
178>0x07	byte		0
179>0x0b	byte		0	Oak Technologies printer stream
180
181# This would otherwise be recognized as PostScript - nick@debian.org
1820	string		%!VMF 		SunClock's Vector Map Format data
183
184#------------------------------------------------------------------------------
185# HP LaserJet 1000 series downloadable firmware file
1860	string	\xbe\xefABCDEFGH	HP LaserJet 1000 series downloadable firmware
187
188# From: Paolo <oopla@users.sf.net>
189# Epson ESC/Page, ESC/PageColor
1900	string	\x1b\x01@EJL	Epson ESC/Page language printer data
191
192# Summary:	Hewlett-Packard Graphics Language
193# From:		Joerg Jenderek
194# URL:		http://fileformats.archiveteam.org/wiki/HP-GL
195#		https://en.wikipedia.org/wiki/HPGL
196# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/h/hpg.trid.xml
197# Note:		called "Hewlett-Packard Graphics Language" by TrID and
198#		"Hewlett Packard Graphics Language" by DROID via PUID x-fmt/293 and
199#		HPGL by XnView command `nconvert -info *`
200# initialize, start a plotting job
2010	string	IN;
202>0		use		hpgl
203# fill.plt
2040	string	INPS
205>0		use		hpgl
206# http://ftp.funet.fi/index/graphics/packages/hpgl2ps/hpgl2ps.tar.Z/hpgl2ps/test1.hpgl
2070	string	DF;
208>0		use		hpgl
209# http://ftp.funet.fi/index/graphics/packages/hpgl2ps/hpgl2ps.tar.Z/hpgl2ps/test3.hpgl
210# 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
2110	string	SP
212# skip text Linux-syscall-note inside qemu sources starting with SPDX-Exception-Identifier: Linux-syscall-note
213# by checking for valid Pen number
214>2	regex	\^([0-9]{1,5})
215#>2	regex	\^([0-9]{1,5})	PEN_NUMBER=%s
216>>0		use		hpgl
217# charsize.hp pages.hp	set the scaling points (P1 and P2) to their default positions
2180	string	IP0
219>0		use		hpgl
220# ci.hp
2210	string	CO\040
222>0		use		hpgl
223# iw.hp 286x192.5_lh.hpg 286x192.5_lq.hpg
2240	string	PS\040
225>0		use		hpgl
226# thick.hp
2270	string	PS9
228>0		use		hpgl
229# ul.hp
2300	string	PS4
231>0		use		hpgl
232# la.hp
2330	string	BP
234>0		use		hpgl
235# miter.hp
236# Plot Absolute x,y{,x,y{...}}; x and y in range between -32767 and 32768 like: PA4000,3000;
2370	string	PA
238# skip shell scripts test_msa_run_32r5eb.sh test_msa_run_32r5eb.sh with variable PATH_TO_QEMU
239# by checking for valid x coordinate
240>2	regex	\^([-]{0,1}[0-9]{1,5})
241#>2	regex	\^([-]{0,1}[0-9]{1,5})	COORDINATE=%s
242>>0		use		hpgl
243# pw.hpg	number of pens x
2440	string	NP
245>0		use		hpgl
246# win_1.hp
247#0	string	\003INCA		WHAT_IS_THAT
248#>0		use		hpgl
249# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/h/hpgl2.trid.xml
250# Note:		called "Hewlett-Packard Graphics Language 2" by TrID
2510	string	\033%-1B		Hewlett-Packard Graphics Language 2
252!:mime	application/vnd.hp-HPGL
253# like: dt.plt
254!:ext	plt
255#!:ext	plt/gl2/hpg2/spl
256# remaining part after escsape sequnce
257>5	string	x			with "%-.10s"
258#	display Hewlett-Packard Graphics Language vector graphic information
2590	name				hpgl
260>0	string	x			Hewlett-Packard Graphics Language
261#!:mime	vector/x-hpgl
262# https://www.iana.org/assignments/media-types/application/vnd.hp-HPGL
263!:mime	application/vnd.hp-HPGL
264# no example with HPL suffix found
265!:ext	hpgl/hpg/hp/plt
266# like: "IN;" "DF;IN;LT;PU1000,1000;PD2000,10" "SP6;DI0,1;SR0.70,1.90;SC0,800,"
267# "CO Concentric circles drawn with different linewidths;"
268>0	string	x			\b, starting with "%-.54s"
269# continue but not for 1 long line without CR or LF
270>>&0	ubyte	<0x0E
271#>>&0	ubyte	<0x0E			TERMINATOR=%x
272# second line after 1 terminator character
273>>>&0	string	>\r			with "%-.10s"
274# next character again CR or LF
275>>>&0	ubyte	<0x0E
276#>>>&0	ubyte	<0x0E			2ND_CHARACTER=%x
277# second line after 2 terminator characters
278>>>>&0	string	>\r			with "%-.10s"
279