Small PDF
Small PDF is a Portable Document Format sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
small.pdfDocument
Portable Document Format is a document format commonly identified by .pdf. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.
25 50 44 46 2D %PDF-SIGNATURE = bytes.fromhex("255044462d")
OFFSET = 0
def is_pdf(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x25, 0x50, 0x44, 0x46, 0x2d];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isPdf(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var ispdfSignature = []byte{0x25, 0x50, 0x44, 0x46, 0x2d}
const ispdfOffset = 0
func IsPdf(b []byte) bool {
end := ispdfOffset + len(ispdfSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[ispdfOffset:end], ispdfSignature)
}const SIGNATURE: &[u8] = &[0x25, 0x50, 0x44, 0x46, 0x2d];
const OFFSET: usize = 0;
fn is_pdf(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x25\x50\x44\x46\x2d";
$offset = 0;
function is_pdf(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}Portable Document Format is used for data exchange, imports, exports, parser testing, and validation workflows. Encoding, delimiters, versions, and container structure often change implementation behavior.
Document formats may include scripts, attachments, macros, or external references. Sandbox previews and conversions, and avoid opening untrusted files directly.
11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.
Small PDF is a Portable Document Format sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
small.pdfPDF with Metadata is a Portable Document Format sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
note-with-metadata.pdfBlue Sky PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.pdfe4c697ed1efd7fc82f69d9b69461ff3d0a10ac86fab771fa9734dd6227fe58ddFlower Garden PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.pdf7d924c973b66969ea3c4fb2fc53c1bbb3ff04ce03999bc28215295aa9616c156Navy Blue Sky PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.pdff4cd44f622ebdb47b094f20f038863d6ecd8e092d3e283f4b989ea579e357ebdNature of the Sky PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.pdf454a460c2673d8e93f7158c851c1af39b9adfd585663bac7d59a3d24a4205e51Sky Landscape PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.pdf4b1fa5611d64d91b474b2373ad44df768be2e3b7a4e61bc48571fe0e1d3615e0Starry Sky PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.pdf54cf9824543461bb44d900b3dd35e263a14130365e7dd32264b8319f41e7d7adBlue Night Sky PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.pdf8bddc3e2dbfcea5f81616ead2af7e08d7b9c4de91f72a2facb3756b5898f2226Hibiscus Flower PDF is a Portable Document Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
08-hibiscus-flower.pdf6ed98d6bd8b56da3977af81b40a9f3b73b64e2fc568934488f1b3a4e6f577b81NASA Blue Marble PDF is a Portable Document Format sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.
nasa-blue-marble-2012-east.pdff3368791d86a5b759647de15e92b666d9f137152aceaf457ab461304f2d9c27cPortable Document Format files begin with the byte signature 25 50 44 46 2D ("%PDF-"). Detect the format by reading these leading bytes rather than trusting the file extension alone.
The MIME type for Portable Document Format is application/pdf.
Portable Document Format files use the .pdf extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.