Scaffolding for extended JSON outputs

This commit is contained in:
John Whitington 2023-10-31 15:50:23 +00:00
parent 42e838e5ce
commit e6c718f367
3 changed files with 32 additions and 0 deletions

View File

@ -4,6 +4,9 @@ New features:
o Split files to max size with -split-max o Split files to max size with -split-max
o Spray splits a file to multiple outputs by alternating pages o Spray splits a file to multiple outputs by alternating pages
o List document and page info in JSON format
o List page labels in JSON format
o List fonts in JSON format
Extended features: Extended features:

View File

@ -1154,6 +1154,22 @@ let setaddbookmarksjson s =
setop (AddBookmarks s) (); setop (AddBookmarks s) ();
args.format_json <- true args.format_json <- true
let setlistfontsjson () =
setop Fonts ();
args.format_json <- true
let setinfojson () =
setop Info ();
args.format_json <- true
let setpageinfojson () =
setop PageInfo ();
args.format_json <- true
let setprintpagelabelsjson () =
setop PrintPageLabels ();
args.format_json <- true
let setlistbookmarksjson () = let setlistbookmarksjson () =
setop ListBookmarks (); setop ListBookmarks ();
args.format_json <- true args.format_json <- true
@ -2328,12 +2344,21 @@ and specs =
("-list-fonts", ("-list-fonts",
Arg.Unit (setop Fonts), Arg.Unit (setop Fonts),
" Output font list"); " Output font list");
("-list-fonts-json",
Arg.Unit setlistfontsjson,
" Output font list in JSON format");
("-info", ("-info",
Arg.Unit (setop Info), Arg.Unit (setop Info),
" Output file information"); " Output file information");
("-info-json",
Arg.Unit setinfojson,
" Output file information in JSON format");
("-page-info", ("-page-info",
Arg.Unit (setop PageInfo), Arg.Unit (setop PageInfo),
" Output page information"); " Output page information");
("-page-info-json",
Arg.Unit setpageinfojson,
" Output page information in JSON format");
("-set-author", ("-set-author",
Arg.String setauthor, Arg.String setauthor,
" Set Author"); " Set Author");
@ -2499,6 +2524,9 @@ and specs =
("-print-page-labels", ("-print-page-labels",
Arg.Unit (setop PrintPageLabels), Arg.Unit (setop PrintPageLabels),
" Print page labels"); " Print page labels");
("-print-page-labels-json",
Arg.Unit setprintpagelabelsjson,
" Print page labels in JSON format");
("-remove-page-labels", ("-remove-page-labels",
Arg.Unit (setop RemovePageLabels), Arg.Unit (setop RemovePageLabels),
" Remove page labels"); " Remove page labels");

View File

@ -1,5 +1,6 @@
%Document -split-max %Document -split-max
%Document -spray %Document -spray
%Document -info-json, -page-info-json, -page-labels-json, -list-fonts-json
\documentclass{book} \documentclass{book}
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf, % Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf,
% dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc. % dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc.