| <<<Back 1 day (to 2020/12/26) | Fwd 1 day (to 2020/12/28) >>> | 20201227 |
velix | Is there a damn quick way to verify, if a PDF is parseable? My first idea was to throw it into mutool and check the output. Maybe GS is quicker? | 17:07.24 |
artifexirc-bot | <RayJohnston> velix: mupdf is quicker than gs, but mutool info ___.pdf is the fastest, but it doesn't tend to give as many warnings as: gs permit-file-read=in.pdf -q -- lib/pdf_info.ps in.pdf | 22:44.38 |
velix | RayJohnston: Thanks. I just need a "good" or "bad" ;) | 22:45.11 |
artifexirc-bot | <RayJohnston> velix: but note that both have different tolerance for badly formed contents (and gs gives more warnings) and the contents are not examined by mutool info, mutool clean or gs lib/pdf_info.ps | 22:46.21 |
| <RayJohnston> velix: the only way to do that is to actually process the contents. Probably the fastest (and the way with the most warnings) is: gs -q -sDEVICE=bbox in.pdf | 22:47.52 |
velix | RayJohnston: Actually, I just want to check if it has been written completely. | 22:48.13 |
| I don't need syntax check. | 22:48.18 |
| PDF doesn't have a magic byte at the ending? ;) | 22:48.37 |
artifexirc-bot | <RayJohnston> I didn't know exactly what "good" or "bad" meant to you | 22:48.54 |
velix | "good": has been written completely, "bad": got interrupted anywhere within. | 22:49.17 |
artifexirc-bot | <RayJohnston> velix: OK. PDF has the "xref" at the end, then at the end of the xref table is <cr><lf>%%EOF<cr><lf> | 22:52.07 |
| <RayJohnston> so the quickest test is: tail -1 | 22:52.55 |
| <RayJohnston> and see if it is the magic %%EOF line | 22:53.59 |
velix | RayJohnston: But I need to decode it first then | 22:54.35 |
| oh no, it really has %%EOF :D | 22:56.04 |
| tail -c6 100.pdf is %%EOF | 22:56.24 |
| didn't know that :D | 22:56.28 |
| <<<Back 1 day (to 2020/12/26) | Forward 1 day (to 2020/12/28)>>> | |