Better combine_resources
This commit is contained in:
parent
f7bdca371b
commit
6feb3082aa
15
cpdf.ml
15
cpdf.ml
|
@ -621,15 +621,14 @@ let combine_pdf_resources pdf a b =
|
||||||
| Some (Pdf.Dictionary d) -> d
|
| Some (Pdf.Dictionary d) -> d
|
||||||
| _ -> []
|
| _ -> []
|
||||||
in
|
in
|
||||||
key, Pdf.Dictionary (a_entries @ b_entries)
|
if a_entries = [] && b_entries = [] then
|
||||||
|
None
|
||||||
|
else
|
||||||
|
Some (key, Pdf.Dictionary (a_entries @ b_entries))
|
||||||
in
|
in
|
||||||
let unknown_keys_a =
|
let unknown_keys_a = lose (fun (k, _) -> mem k resource_keys) a_entries in
|
||||||
lose (fun (k, _) -> mem k resource_keys) a_entries
|
let unknown_keys_b = lose (fun (k, _) -> mem k resource_keys) b_entries in
|
||||||
in let unknown_keys_b =
|
let combined_known_entries = option_map combine_entries resource_keys in
|
||||||
lose (fun (k, _) -> mem k resource_keys) b_entries
|
|
||||||
in let combined_known_entries =
|
|
||||||
map combine_entries resource_keys
|
|
||||||
in
|
|
||||||
Pdf.Dictionary (unknown_keys_a @ unknown_keys_b @ combined_known_entries)
|
Pdf.Dictionary (unknown_keys_a @ unknown_keys_b @ combined_known_entries)
|
||||||
|
|
||||||
(* \section{Build PDF Presentations} *)
|
(* \section{Build PDF Presentations} *)
|
||||||
|
|
Loading…
Reference in New Issue