#------------------------------------------------------------------------------
# $File: pdf,v 1.21 2026/10/22 15:59:50 christos Exp $
# pdf: file(1) magic for Portable Document Format
#
0 name pdf
# LOCAL(qjerome): upstream's ">8 search /Count >>&0 regex [1-9]([0-9]+)?
# \b, %s page(s)" rule dropped here. /Count is not exclusive to the Pages
# tree (also used by Outline/bookmark dictionaries), so it can report a
# bookmark count as a page count. Do not reintroduce on future syncs.
>8 search/512 /Filter/FlateDecode/ (zip deflate encoded)
0 string %PDF- PDF document
!:mime application/pdf
!:strength +60
!:ext pdf
>5 regex \^[0-9][.][0-9] \b, version %s
>0 use pdf
0 string \012%PDF- PDF document
!:mime application/pdf
!:strength +60
!:ext pdf
>6 regex \^[0-9][.][0-9] \b, version %s
>0 use pdf
0 string \xef\xbb\xbf%PDF- PDF document (UTF-8)
!:mime application/pdf
!:strength +60
!:ext pdf
>8 regex \^[0-9][.][0-9] \b, version %s
>0 use pdf
# From: Nick Schmalenberger <nick@schmalenberger.us>
# Forms Data Format
0 string %FDF- FDF document
!:mime application/vnd.fdf
!:strength +60
!:ext pdf
>5 byte x \b, version %c
>7 byte x \b.%c
0 search/1024 %PDF- PDF document
!:mime application/pdf
!:strength +60
!:ext pdf
>&0 regex \^[0-9][.][0-9] \b, version %s
>0 use pdf