View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000694 | file | General | public | 2025-11-10 18:38 | 2025-11-10 18:38 |
| Reporter | yedaya | Assigned To | |||
| Priority | low | Severity | feature | Reproducibility | always |
| Status | new | Resolution | open | ||
| Product Version | 5.46 | ||||
| Summary | 0000694: pdf: Find single digit page number | ||||
| Description | Currently when running `file pages.pdf` if the number of pages is lower than 10 it can print a wrong number of pages, since it looks for a number with 2 or more digits. For example a pdf with this content in it will produce 'PDF document, version 1.4, 31 page(s)': ``` 30 0 obj <</Type/Pages/Count 1/Kids[31 0 R]>> endobj ``` Attached a patch to fix this | ||||
| Tags | No tags attached. | ||||
|
|
0001-pdf-Find-single-digit-page-number.patch (662 bytes)
From b5335e7585bdeb13cf528ab49387d1f5d1a90fcf Mon Sep 17 00:00:00 2001 From: Yedaya Katsman <yedaya.ka@gmail.com> Date: Mon, 10 Nov 2025 20:26:38 +0200 Subject: [PATCH] pdf: Find single digit page number --- magic/Magdir/pdf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magic/Magdir/pdf b/magic/Magdir/pdf index c4ab2142..3144e3b4 100644 --- a/magic/Magdir/pdf +++ b/magic/Magdir/pdf @@ -6,7 +6,7 @@ 0 name pdf >8 search /Count ->>&0 regex [1-9][0-9]+ \b, %s page(s) +>>&0 regex [1-9]([0-9]+)? \b, %s page(s) >8 search/512 /Filter/FlateDecode/ (zip deflate encoded) 0 string %PDF- PDF document -- 2.51.0.491.g4b71b29477 |