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