Initial commit: FoFreeXit Phase 1 (Viewer) + Phase 2 (Annotate)

PDF viewer (render/search/text-select/thumbnails/outline) and annotation
engine (Highlight/Underline/Strikeout/Square/FreeText/Note) over PDFium +
lopdf, with Unicode font embedding for Vietnamese text and undo/redo.
This commit is contained in:
2026-06-17 22:34:06 +07:00
commit 274012f854
52 changed files with 28479 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# Corpus PDF mẫu
Bộ file PDF dùng để test & hồi quy. Sẽ mở rộng dần theo roadmap.
| File | Mô tả | Dùng cho |
|------|-------|----------|
| `hello.pdf` | PDF tối giản 1 trang, text Helvetica, xref hợp lệ | Smoke test render (Phase 1) |
| `sample-multipage.pdf` | 3 trang Letter, nội dung biết trước + outline (Chapter 1/2/3 → trang 0/1/2) | Test page_dims, extract_text, search, outline; demo viewer |
| `big-1000.pdf` | 1000 trang ("Trang N"); trang index 500 có "ZZMARKER" | Stress-test hiệu năng/lazy-load (mở 55ms, render 110ms, search 79ms) |
## Cần bổ sung (các phase sau)
- File nhiều trang (100+, 1000+) — hiệu năng & lazy load.
- File scan (ảnh) — OCR (Phase 7).
- File mã hoá (mật khẩu) — bảo mật (Phase 5).
- File hỏng/xref sai — kiểm thử độ bền parser.
- File tiếng Việt (font nhúng, tổ hợp dấu), CJK, RTL — edit text (Phase 4).
- File có AcroForm — form (Phase 6).
> Lưu ý bản quyền: chỉ thêm file tự tạo hoặc có giấy phép cho phép phân phối.
+11020
View File
File diff suppressed because one or more lines are too long
+31
View File
@@ -0,0 +1,31 @@
%PDF-1.7
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Resources << /Font << /F1 5 0 R >> >> /Contents 4 0 R >>
endobj
4 0 obj
<< /Length 57 >>
stream
BT /F1 24 Tf 72 700 Td (Hello FoFreeXit - Phase 1) Tj ET
endstream
endobj
5 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
xref 6
0000000000 65535 f
0000000009 00000 n
0000000058 00000 n
0000000115 00000 n
0000000241 00000 n
0000000347 00000 n
trailer
<< /Size 6 /Root 1 0 R >>
startxref
417
%%EOF
+69
View File
@@ -0,0 +1,69 @@
%PDF-1.7
1 0 obj
<< /Type /Catalog /Pages 2 0 R /Outlines 7 0 R >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R 4 0 R 5 0 R] /Count 3 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Resources << /Font << /F1 6 0 R >> >> /Contents 11 0 R >>
endobj
4 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Resources << /Font << /F1 6 0 R >> >> /Contents 12 0 R >>
endobj
5 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Resources << /Font << /F1 6 0 R >> >> /Contents 13 0 R >>
endobj
6 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
7 0 obj
<< /Type /Outlines /First 8 0 R /Last 10 0 R /Count 3 >>
endobj
8 0 obj
<< /Title (Chapter 1) /Parent 7 0 R /Next 9 0 R /Dest [3 0 R /Fit] >>
endobj
9 0 obj
<< /Title (Chapter 2) /Parent 7 0 R /Prev 8 0 R /Next 10 0 R /Dest [4 0 R /Fit] >>
endobj
10 0 obj
<< /Title (Chapter 3) /Parent 7 0 R /Prev 9 0 R /Dest [5 0 R /Fit] >>
endobj
11 0 obj
<< /Length 92 >>
stream
BT /F1 18 Tf 72 720 Td (FoFreeXit Test Document) Tj 0 -28 Td (Page one content alpha) Tj ET
endstream
endobj
12 0 obj
<< /Length 64 >>
stream
BT /F1 18 Tf 72 720 Td (Page two content beta searchterm) Tj ET
endstream
endobj
13 0 obj
<< /Length 56 >>
stream
BT /F1 18 Tf 72 720 Td (Page three content gamma) Tj ET
endstream
endobj
xref
0 14 65535 f
0000000009 00000 n
0000000074 00000 n
0000000143 00000 n
0000000270 00000 n
0000000397 00000 n
0000000524 00000 n
0000000594 00000 n
0000000666 00000 n
0000000751 00000 n
0000000849 00000 n
0000000935 00000 n
0000001077 00000 n
0000001191 00000 n
trailer
<< /Size 14 /Root 1 0 R >>
startxref
1297
%%EOF