From 4c91add277d7103478d32fb4b652eeb337734ec7 Mon Sep 17 00:00:00 2001 From: Benjamin VAUDOUR Date: Wed, 22 Dec 2021 12:31:39 +0000 Subject: [PATCH] =?UTF-8?q?Module=20pdf=E2=80=AF:=20r=C3=A9cup=C3=A9ration?= =?UTF-8?q?=20des=20infos=20de=20chiffrement=20+=20info=20sur=20une=20page?= =?UTF-8?q?=20donn=C3=A9e=20+=20ne=20pas=20parcourir=20le=20trailer=20en?= =?UTF-8?q?=20profondeur=20(risque=20de=20boucle)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/moi/util/pdf.elv | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/moi/util/pdf.elv b/lib/moi/util/pdf.elv index 84868d0..16a0644 100644 --- a/lib/moi/util/pdf.elv +++ b/lib/moi/util/pdf.elv @@ -49,6 +49,11 @@ fn form {|in| put $json[acroform] } +fn encryption {|in| + var json = (json $in) + put $json[encrypt] +} + fn objects {|in| var json = (json $in) put $json[objects] @@ -86,7 +91,7 @@ fn filter {|&extend=$false in cond| } fn trailer {|in| - object &extend=$true $in 'trailer' + object $in 'trailer' } fn pages {|in| @@ -94,6 +99,10 @@ fn pages {|in| put $json[pages] } +fn page {|in nb| + put (pages $in)[(- $nb 1)] +} + fn nb-pages {|in| qpdf --show-npages $in }