file stringlengths 19 39 | pages float64 1 120 ⌀ | pdf_version float64 1.5 1.7 ⌀ | xref stringclasses 2
values | open_password stringclasses 1
value | page_sizes_pt stringlengths 7 959 ⌀ | page_rotate stringclasses 8
values | markers stringlengths 16 3.85k ⌀ | features stringlengths 10 155 | a_correct_merge_keeps stringlengths 9 107 | bytes int64 0 60.9k | note stringclasses 6
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
files/plain_a4_3p.pdf | 3 | 1.7 | table | null | 595x842 595x842 595x842 | 0 0 0 | [plain_a4_3p p1/3] [plain_a4_3p p2/3] [plain_a4_3p p3/3] | baseline: A4 portrait, classic xref table | all pages in order | 2,112 | null |
files/letter_2p.pdf | 2 | 1.7 | table | null | 612x792 612x792 | 0 0 | [letter_2p p1/2] [letter_2p p2/2] | baseline: US Letter portrait | page size 612x792 (not resized to A4) | 1,652 | null |
files/mixed_sizes_3p.pdf | 3 | 1.7 | table | null | 842x595 420x595 612x1008 | 0 0 0 | [mixed_sizes_3p p1/3] [mixed_sizes_3p p2/3] [mixed_sizes_3p p3/3] | A4 landscape (by MediaBox), A5, US Legal in one file | each page keeps its own size and orientation | 2,132 | null |
files/rotated_3p.pdf | 3 | 1.7 | table | null | 842x595 842x595 595x842 | 90 270 0 | [rotated_3p p1/3] [rotated_3p p2/3] [rotated_3p p3/3] | page /Rotate 90; /Rotate 270 inherited through a nested page tree node; 0 | every TOP arrow still points up (inherited Rotate must be copied onto the page) | 2,286 | null |
files/bookmarks_6p.pdf | 6 | 1.7 | table | null | 595x842 595x842 595x842 595x842 595x842 595x842 | 0 0 0 0 0 0 | [bookmarks_6p p1/6] [bookmarks_6p p2/6] [bookmarks_6p p3/6] [bookmarks_6p p4/6] [bookmarks_6p p5/6] [bookmarks_6p p6/6] | outline: 6 bookmarks in 2 levels, explicit /XYZ destinations, opens with the outline panel | all 6 bookmarks, nested the same way, each jumping to its page in the merged file | 4,396 | null |
files/links_a_4p.pdf | 4 | 1.7 | table | null | 595x842 595x842 595x842 595x842 | 0 0 0 0 | [links_a_4p p1/4] [links_a_4p p2/4] [links_a_4p p3/4] [links_a_4p p4/4] | page 1 has 3 link annotations to named destinations section-1..3 (same names in links_a_4p and links_b_4p) | links on each contents page still open that file's own sections (name clash must be resolved) | 3,247 | null |
files/links_b_4p.pdf | 4 | 1.7 | table | null | 595x842 595x842 595x842 595x842 | 0 0 0 0 | [links_b_4p p1/4] [links_b_4p p2/4] [links_b_4p p3/4] [links_b_4p p4/4] | page 1 has 3 link annotations to named destinations section-1..3 (same names in links_a_4p and links_b_4p) | links on each contents page still open that file's own sections (name clash must be resolved) | 3,236 | null |
files/page_labels_7p.pdf | 7 | 1.7 | table | null | 595x842 595x842 595x842 595x842 595x842 595x842 595x842 | 0 0 0 0 0 0 0 | [page_labels_7p p1/7] [page_labels_7p p2/7] [page_labels_7p p3/7] [page_labels_7p p4/7] [page_labels_7p p5/7] [page_labels_7p p6/7] [page_labels_7p p7/7] | page labels i, ii, iii, 1, 2, 3, A-1 | labels of these 7 pages (offset by the pages before them) | 4,019 | labels: i ii iii 1 2 3 A-1 |
files/form_a_1p.pdf | 1 | 1.7 | table | null | 595x842 | 0 | [form_a_1p p1/1] | AcroForm with fields name, email, agree (checkbox), filled, with appearance streams; form_a_1p and form_b_1p use the same field names with different values | both forms show their own values after merging (fields renamed, or flattened) | 2,874 | values: Alice Example / alice@example.com / agree=True |
files/form_b_1p.pdf | 1 | 1.7 | table | null | 595x842 | 0 | [form_b_1p p1/1] | AcroForm with fields name, email, agree (checkbox), filled, with appearance streams; form_a_1p and form_b_1p use the same field names with different values | both forms show their own values after merging (fields renamed, or flattened) | 2,867 | values: Bob Example / bob@example.com / agree=False |
files/xref_stream_3p.pdf | 3 | 1.5 | stream | null | 595x842 595x842 595x842 | 0 0 0 | [xref_stream_3p p1/3] [xref_stream_3p p2/3] [xref_stream_3p p3/3] | PDF 1.5: cross-reference stream and an object stream (no classic xref table) | all pages | 1,660 | null |
files/incremental_update_3p.pdf | 3 | 1.7 | table | null | 595x842 595x842 595x842 | 0 0 0 | [incremental_update_3p p1/3] [incremental_update_3p p2/3] [incremental_update_3p p3/3] | two revisions: revision 2 replaces page 1 (DRAFT -> FINAL) and appends page 3 | the latest revision: page 1 says FINAL, 3 pages | 2,866 | revision 1 alone has 2 pages and says DRAFT |
files/broken_xref_2p.pdf | 2 | 1.7 | table | null | 595x842 595x842 | 0 0 | [broken_xref_2p p1/2] [broken_xref_2p p2/2] | xref table offsets are all 7 bytes wrong (common after bad FTP/text-mode copies or editing) | readers that rebuild the xref open it; a merger should repair it or report a clear error | 1,664 | null |
files/junk_before_header_2p.pdf | 2 | 1.7 | table | null | 612x792 612x792 | 0 0 | [junk_before_header_2p p1/2] [junk_before_header_2p p2/2] | 80 bytes of mail headers before %PDF (offsets counted from %PDF) | both pages (Acrobat and most readers accept junk within the first 1024 bytes) | 1,767 | null |
files/encrypted_no_open_password_2p.pdf | 2 | 1.7 | table | null | 595x842 595x842 | 0 0 | [encrypted_no_open_password_2p p1/2] [encrypted_no_open_password_2p p2/2] | RC4 128-bit, empty user password, owner password set, permissions deny print/modify/copy/assemble | both pages after decryption; the tool should ask for the password (second file) and must not output garbage | 2,036 | null |
files/encrypted_password_test_2p.pdf | 2 | 1.7 | table | test | 595x842 595x842 | 0 0 | [encrypted_password_test_2p p1/2] [encrypted_password_test_2p p2/2] | RC4 128-bit, open password is: test | both pages after decryption; the tool should ask for the password (second file) and must not output garbage | 2,020 | null |
files/shared_resources_120p.pdf | 120 | 1.7 | table | null | 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 420x595 ... | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | [shared_resources_120p p1/120] [shared_resources_120p p2/120] [shared_resources_120p p3/120] [shared_resources_120p p4/120] [shared_resources_120p p5/120] [shared_resources_120p p6/120] [shared_resources_120p p7/120] [shared_resources_120p p8/120] [shared_resources_120p p9/120] [shared_resources_120p p10/120] [shared_r... | 120 A5 pages that all share one Resources dictionary, one font and one logo XObject | one copy of the shared resources: merging this file twice should give about 2x the size, not 120x | 60,928 | null |
files/contents_variants_3p.pdf | 3 | 1.7 | table | null | 595x842 595x842 595x842 | 0 0 0 | [contents_variants_3p p2/3] [contents_variants_3p p3/3] | page 1 has no /Contents (a valid blank page); page 2 /Contents is an array of 3 streams | 3 pages, page 1 blank | 2,483 | page 1 is blank by design, so it has no marker text |
files/metadata_unicode_2p.pdf | 2 | 1.7 | table | null | 595x842 595x842 | 0 0 | [metadata_unicode_2p p1/2] [metadata_unicode_2p p2/2] | Info and XMP title in UTF-16 (Cyrillic, Japanese, Spanish), Unicode bookmark titles | bookmark titles readable (not mojibake) | 2,903 | null |
files/attachment_1p.pdf | 1 | 1.7 | table | null | 595x842 | 0 | [attachment_1p p1/1] | embedded file order.csv (document level attachment) | the page; ideally the attachment too (many mergers drop it, worth knowing) | 1,623 | null |
files/annotations_2p.pdf | 2 | 1.7 | table | null | 595x842 595x842 | 0 0 | [annotations_2p p1/2] [annotations_2p p2/2] | page 1: sticky note, highlight (no appearance stream), external URI link | all 3 annotations on page 1 | 2,183 | null |
files/truncated_3p.pdf | null | null | null | null | null | null | null | plain_a4_3p.pdf cut at 2/3: no xref, no trailer, last object incomplete | a clear error message (or, for the truncated file, the pages that can be recovered); no crash | 1,408 | invalid input |
files/zero_bytes.pdf | null | null | null | null | null | null | null | empty file | a clear error message (or, for the truncated file, the pages that can be recovered); no crash | 0 | invalid input |
files/png_named_pdf.pdf | null | null | null | null | null | null | null | a 1x1 PNG with a .pdf extension | a clear error message (or, for the truncated file, the pages that can be recovered); no crash | 70 | invalid input |
PDF Merge Test Files
24 small PDF files (130 KB in total) that each break PDF mergers in a different way, and 16 merge cases with the
expected result. Every page prints a marker such as [bookmarks_6p p3/6], so after merging you can check page order
with plain text extraction, or by eye from the coloured band at the top of each page.
The set covers rotated pages (including /Rotate inherited from a nested page tree node), mixed page sizes,
bookmarks, links to named destinations that clash between two files, form fields with the same names in two files,
page labels, PDF 1.5 cross-reference streams, an incremental update, a broken xref table, junk before the header,
two encrypted files, 120 pages sharing one set of resources, pages with no content or split content, Unicode
metadata, an attachment, annotations, and three files that are not valid PDFs at all.
All files were written byte by byte by a script. No third-party documents. CC0.
Why this dataset
Merging looks like "copy the pages one after another", and on clean files that works. Real files are not clean: they come from scanners, mail clients, form tools and old editors, and the bugs show up as missing bookmarks, links that jump to the wrong file, forms where both copies suddenly show the same name, upside down pages, or a 60 KB input turning into a 7 MB output. This set is useful for:
- Testing a merge feature in a library, a web app or a command line tool.
merge_cases.csvlists which files to merge, how many pages must come out and the markers in the expected order, plus what else to look at. - Regression tests. The files are tiny and deterministic, so they fit into a repository and a CI run.
- Checking robustness of PDF parsers. The damaged and invalid files should give a clear error or a repaired result, never a crash or an empty output.
- Seeing what gets lost. Bookmarks, page labels, attachments and form fields are often dropped silently. Each
row of
files.csvsays what a correct merge keeps, so you can decide knowingly what your tool supports.
Layout
files.csv one row per file
merge_cases.csv 16 suggested merges with the expected result
files/<name>.pdf the test files
| file | what it tests |
|---|---|
plain_a4_3p, letter_2p |
baselines: A4 and US Letter |
mixed_sizes_3p |
A4 landscape, A5 and US Legal in one file |
rotated_3p |
/Rotate 90 on a page, /Rotate 270 inherited from a nested Pages node, no rotation |
bookmarks_6p |
6 bookmarks in two levels, opens with the bookmark panel |
links_a_4p, links_b_4p |
a contents page linking to named destinations section-1..3; both files use the same names |
form_a_1p, form_b_1p |
filled form fields name, email, agree with the same names and different values |
page_labels_7p |
page labels i, ii, iii, 1, 2, 3, A-1 |
xref_stream_3p |
PDF 1.5 cross-reference stream and object stream, no classic xref table |
incremental_update_3p |
revision 2 replaces page 1 (DRAFT becomes FINAL) and appends page 3 |
broken_xref_2p |
every xref offset is 7 bytes wrong |
junk_before_header_2p |
mail headers before %PDF |
encrypted_no_open_password_2p |
RC4 128-bit, opens without a password, owner restrictions on print, copy, modify and assemble |
encrypted_password_test_2p |
RC4 128-bit, open password test |
shared_resources_120p |
120 A5 pages sharing one Resources dictionary, font and logo |
contents_variants_3p |
page 1 has no /Contents (a valid blank page), page 2 has an array of three content streams |
metadata_unicode_2p |
title and author in Cyrillic, Japanese and Spanish in Info and XMP, Unicode bookmarks |
attachment_1p |
a document level attachment order.csv |
annotations_2p |
sticky note, highlight and an external link on page 1 |
truncated_3p, zero_bytes, png_named_pdf |
not valid PDFs: cut at two thirds, empty, a PNG with a .pdf extension |
files.csv columns: pages, pdf_version, xref (table or stream), open_password, page_sizes_pt (as
displayed, after rotation), page_rotate, markers (expected marker text per page), features,
a_correct_merge_keeps, bytes, note.
merge_cases.csv columns: case, inputs (in order), expected_pages, expected_markers, what_to_check.
Invalid files count as zero pages in expected_pages.
How the files were checked
- pdf.js opened every valid file (with the password where needed) and found the right number of pages, the markers in order, the displayed page sizes and rotation, the latest revision of the incremental update, 6 bookmarks, the page labels, the form fields, the attachment, the three annotations and links that land on pages 2, 3 and 4. The password protected file refuses to open without the password.
- pypdf 5.1 merged all 16 cases. Every result had the expected page count and the markers in the expected order
(checked again with pdf.js). Merging
shared_resources_120ptwice gave 124 KB from a 61 KB input. pypdf rejected the three invalid files with an error, and openedbroken_xref_2pandjunk_before_header_2ponly after repairing them. - Pages were rendered in Chrome and looked at.
What is not here
No AES-256 encryption, no XFA forms, no digital signatures, no linearized files, no tagged PDF structure trees and no optional content layers. Files are small on purpose, so this is not a performance benchmark.
Merging these files in a browser
To merge some of these files by hand, use https://toolster.net/merge_pdf : add the files, drag pages into order, rotate or remove pages, and save. The files are processed in the browser and are not uploaded.
- Downloads last month
- 55