{"success":true,"data":{"ext":"pdf","name":"Adobe Portable Document Format","description":"Portable Document Format (PDF) is a file format created by Adobe Systems and now maintained as an open standard by ISO for representing documents independently of software and hardware. It is used for distributing reports, forms, manuals, books, and other fixed-layout documents across desktop and mobile applications. PDFs can include embedded media, scripts, and links, so files from untrusted sources should be opened with current readers and security features enabled.","mime":["application/pdf"],"risk_level":"Safe","signatures":[{"hex":"25 50 44 46 2D","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"},{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"25 50 44 46","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"},{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Pdf.cs"}]},{"hex":"EF BB BF 25 50 44 46 2D","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"25 25","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"25 50 44 46 2D 31 2E","offset":1,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"25 50 44 46 2D 32 2E","offset":1,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["eps","epub","mobi","oxps","ps","xps"],"usage":{"python":"def is_pdf(file_path: str) -> bool:\n    \"\"\"Check if file is a valid PDF by magic bytes.\"\"\"\n    signature = bytes([0x25, 0x50, 0x44, 0x46, 0x2D])\n    with open(file_path, \"rb\") as f:\n        return f.read(5) == signature","node":"function isPDF(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x25, 0x50, 0x44, 0x46, 0x2D]);\n  return buffer.subarray(0, 5).equals(signature);\n}","go":"func IsPDF(data []byte) bool {\n    signature := []byte{0x25, 0x50, 0x44, 0x46, 0x2D}\n    if len(data) < 5 {\n        return false\n    }\n    return bytes.Equal(data[:5], signature)\n}"},"category":"Documents"}}