xref: /dragonfly/contrib/file/magic/Magdir/pdf (revision 8f2ce533)
1
2#------------------------------------------------------------------------------
3# $File: pdf,v 1.16 2021/07/30 11:47:07 christos Exp $
4# pdf:  file(1) magic for Portable Document Format
5#
6
70	name	pdf
8>8	search		/Count
9>>&0	regex		[0-9]+		\b, %s pages
10>8	search/512	/Filter/FlateDecode/	(zip deflate encoded)
11
120	string		%PDF-		PDF document
13!:mime	application/pdf
14!:strength +60
15!:ext	pdf
16>5	byte		x		\b, version %c
17>7	byte		x		\b.%c
18>0	use		pdf
19
200	string		\012%PDF-	PDF document
21!:mime	application/pdf
22!:strength +60
23!:ext	pdf
24>6	byte		x		\b, version %c
25>8	byte		x		\b.%c
26>0	use		pdf
27
280	string		\xef\xbb\xbf%PDF-	PDF document (UTF-8)
29!:mime	application/pdf
30!:strength +60
31!:ext	pdf
32>6	byte		x		\b, version %c
33>8	byte		x		\b.%c
34>0	use		pdf
35
36# From: Nick Schmalenberger <nick@schmalenberger.us>
37# Forms Data Format
380       string          %FDF-           FDF document
39!:mime application/vnd.fdf
40!:strength +60
41!:ext	pdf
42>5      byte            x               \b, version %c
43>7      byte            x               \b.%c
44
450	search/256	%PDF-		PDF document
46!:mime	application/pdf
47!:strength +60
48!:ext	pdf
49>&0	byte		x		\b, version %c
50>&2	byte		x		\b.%c
51>0	use		pdf
52