more inline functions

This commit is contained in:
John Whitington 2024-01-23 18:22:09 +00:00
parent e2590bb3d0
commit 787ae85eb9
1 changed files with 8 additions and 33 deletions

View File

@ -1555,19 +1555,10 @@ let setrevision n =
| [] -> | [] ->
Pdfe.log "Warning. -revision ignored. Put it after the filename.\n" Pdfe.log "Warning. -revision ignored. Put it after the filename.\n"
let setoutline () =
args.outline <- true
let setlinewidth l =
args.linewidth <- l
let setimageresolution f = let setimageresolution f =
detect_duplicate_op (ImageResolution f); detect_duplicate_op (ImageResolution f);
args.op <- Some (ImageResolution f) args.op <- Some (ImageResolution f)
let setgspath p =
args.path_to_ghostscript <- p
let setimpath p = let setimpath p =
args.path_to_im <- p args.path_to_im <- p
@ -1591,24 +1582,9 @@ let settobox s =
let setmediaboxifmissing () = let setmediaboxifmissing () =
args.mediabox_if_missing <- true args.mediabox_if_missing <- true
let setprerotate () =
args.prerotate <- true
let settopage s = let settopage s =
args.topage <- Some s args.topage <- Some s
let setscalestamptofit () =
args.scale_stamp_to_fit <- true
let setremoveduplicatestreams () =
args.remove_duplicate_streams <- true
let setnopreserveobjstm () =
args.preserve_objstm <- false
let setcreateobjstm () =
args.create_objstm <- true
let setstdinuser u = let setstdinuser u =
match args.inputs with match args.inputs with
| (StdIn, x, _, o, f, g)::t -> args.inputs <- (StdIn, x, u, o, f, g)::t | (StdIn, x, _, o, f, g)::t -> args.inputs <- (StdIn, x, u, o, f, g)::t
@ -1780,7 +1756,6 @@ let addop o =
begin match args.op with Some Draw -> () | _ -> error "Need to be in drawing mode for this." end; begin match args.op with Some Draw -> () | _ -> error "Need to be in drawing mode for this." end;
Cpdfdrawcontrol.addop o Cpdfdrawcontrol.addop o
let embed_font_inner font = let embed_font_inner font =
match font with match font with
| StandardFont f -> | StandardFont f ->
@ -2007,10 +1982,10 @@ and specs =
Arg.Unit (setop ChangeId), Arg.Unit (setop ChangeId),
" Change the file's /ID tag"); " Change the file's /ID tag");
("-no-preserve-objstm", ("-no-preserve-objstm",
Arg.Unit setnopreserveobjstm, Arg.Unit (fun () -> args.preserve_objstm <- false),
" Don't preserve object streams"); " Don't preserve object streams");
("-create-objstm", ("-create-objstm",
Arg.Unit setcreateobjstm, Arg.Unit (fun () -> args.create_objstm <- true),
" Create object streams anew"); " Create object streams anew");
("-keep-version", ("-keep-version",
Arg.Unit setkeepversion, Arg.Unit setkeepversion,
@ -2109,7 +2084,7 @@ and specs =
Arg.Unit (setop Upright), Arg.Unit (setop Upright),
" Make pages upright"); " Make pages upright");
("-prerotate", ("-prerotate",
Arg.Unit setprerotate, Arg.Unit (fun () -> args.prerotate <- true),
" Calls -upright on pages before modifying them, if required"); " Calls -upright on pages before modifying them, if required");
("-no-warn-rotate", ("-no-warn-rotate",
Arg.Unit setnowarnrotate, Arg.Unit setnowarnrotate,
@ -2194,7 +2169,7 @@ and specs =
Arg.Unit (setop Compress), Arg.Unit (setop Compress),
" Compress streams, leaving metadata alone"); " Compress streams, leaving metadata alone");
("-remove-duplicate-streams", ("-remove-duplicate-streams",
Arg.Unit setremoveduplicatestreams, Arg.Unit (fun () -> args.remove_duplicate_streams <- true),
""); "");
("-list-bookmarks", ("-list-bookmarks",
Arg.Unit (setop ListBookmarks), Arg.Unit (setop ListBookmarks),
@ -2242,7 +2217,7 @@ and specs =
Arg.String setstampunder, Arg.String setstampunder,
" Stamp a file under some pages of another"); " Stamp a file under some pages of another");
("-scale-stamp-to-fit", ("-scale-stamp-to-fit",
Arg.Unit setscalestamptofit, Arg.Unit (fun () -> args.scale_stamp_to_fit <- true),
" Scale the stamp to fit the page"); " Scale the stamp to fit the page");
("-combine-pages", ("-combine-pages",
Arg.String setcombinepages, Arg.String setcombinepages,
@ -2284,10 +2259,10 @@ and specs =
Arg.Float setopacity, Arg.Float setopacity,
" Set the text opacity"); " Set the text opacity");
("-outline", ("-outline",
Arg.Unit setoutline, Arg.Unit (fun () -> args.outline <- true),
" Use outline mode for text"); " Use outline mode for text");
("-linewidth", ("-linewidth",
Arg.Float setlinewidth, Arg.Float (fun f -> args.linewidth <- f),
" Set line width for outline text"); " Set line width for outline text");
("-pos-center", ("-pos-center",
Arg.String setposcenter, Arg.String setposcenter,
@ -2692,7 +2667,7 @@ and specs =
Arg.String setpostpend, Arg.String setpostpend,
" Postpend content to page"); " Postpend content to page");
("-gs", ("-gs",
Arg.String setgspath, Arg.String (fun s -> args.path_to_ghostscript <- s),
" Path to gs executable"); " Path to gs executable");
("-gs-malformed", ("-gs-malformed",
Arg.Unit setgsmalformed, Arg.Unit setgsmalformed,