From 51926ffd20025b8bb08d3de23595b07fe9d545c4 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 8 Nov 2023 11:36:34 +0000 Subject: [PATCH] Nulls for JSON font entries --- cpdffont.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpdffont.ml b/cpdffont.ml index aad99d8..c7f851f 100644 --- a/cpdffont.ml +++ b/cpdffont.ml @@ -290,9 +290,9 @@ let json_of_font (pagenum, name, subtype, basefont, encoding) = `Assoc [("page", `Int pagenum); ("name", `String name); - ("subtype", `String subtype); - ("basefont", `String basefont); - ("encoding", `String encoding)] + ("subtype", if subtype = "" then `Null else `String subtype); + ("basefont", if basefont = "" then `Null else `String basefont); + ("encoding", if encoding = "" then `Null else `String encoding)] let print_fonts ?(json=false) pdf range = if json