Skip to content

Commit

Permalink
Merge pull request #289 from gabriel-vasile/pdf
Browse files Browse the repository at this point in the history
Add missing PDF signatures
  • Loading branch information
gabriel-vasile authored May 16, 2022
2 parents fe5b52f + 62fd23c commit 14adc29
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/magic/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ import "bytes"

var (
// Pdf matches a Portable Document Format file.
Pdf = prefix([]byte{0x25, 0x50, 0x44, 0x46})
// https://github.com/file/file/blob/11010cc805546a3e35597e67e1129a481aed40e8/magic/Magdir/pdf
Pdf = prefix(
// usual pdf signature
[]byte("%PDF-"),
// new-line prefixed signature
[]byte("\012%PDF-"),
// UTF-8 BOM prefixed signature
[]byte("\xef\xbb\xbf%PDF-"),
)
// Fdf matches a Forms Data Format file.
Fdf = prefix([]byte("%FDF"))
// Mobi matches a Mobi file.
Expand Down

0 comments on commit 14adc29

Please sign in to comment.