printer 11 KB

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