Refine upright warning
This commit is contained in:
parent
8b9a2c70ac
commit
b2d931da18
|
@ -3381,8 +3381,8 @@ let collate (names, pdfs, ranges) =
|
||||||
split3 (rev !nis)
|
split3 (rev !nis)
|
||||||
|
|
||||||
let warn_prerotate range pdf =
|
let warn_prerotate range pdf =
|
||||||
if not args.prerotate && not (Cpdfpage.allupright range pdf) then
|
if not args.prerotate && not (Cpdfpage.alluprightonly range pdf) then
|
||||||
Pdfe.log "Some pages in the range have non-zero rotation or non (0,0)-based mediabox. \
|
Pdfe.log "Some pages in the range have non-zero rotation. \
|
||||||
Consider adding -prerotate or pre-processing with -upright. \
|
Consider adding -prerotate or pre-processing with -upright. \
|
||||||
To silence this warning use -no-warn-rotate\n"
|
To silence this warning use -no-warn-rotate\n"
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
%Document -obj - check enc
|
%Document -obj - check enc
|
||||||
%Document -merge-no-struct-trees in merge and collate
|
%Document -merge-no-struct-trees in merge and collate
|
||||||
%Document -shift-boxes
|
%Document -shift-boxes
|
||||||
|
%Document that -scale-to-fit prefers the cropbox
|
||||||
|
%Document in -scale-to-fit that hardbox exists
|
||||||
%Document that -scale-to-fit may have -top bottom left right
|
%Document that -scale-to-fit may have -top bottom left right
|
||||||
\documentclass{book}
|
\documentclass{book}
|
||||||
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf,
|
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf,
|
||||||
|
|
|
@ -409,6 +409,12 @@ let allupright range pdf =
|
||||||
in
|
in
|
||||||
not (mem false (map page_is_upright (select_pages range pdf)))
|
not (mem false (map page_is_upright (select_pages range pdf)))
|
||||||
|
|
||||||
|
(* Same, but don't care about mediabox origin. This is for -scale-to-fit, now that
|
||||||
|
it is ok with nonzero origins. *)
|
||||||
|
let alluprightonly range pdf =
|
||||||
|
let page_is_upright page = page.Pdfpage.rotate = Pdfpage.Rotate0 in
|
||||||
|
not (mem false (map page_is_upright (select_pages range pdf)))
|
||||||
|
|
||||||
let upright_transform pdf page =
|
let upright_transform pdf page =
|
||||||
let rotate =
|
let rotate =
|
||||||
Pdfpage.int_of_rotation page.Pdfpage.rotate
|
Pdfpage.int_of_rotation page.Pdfpage.rotate
|
||||||
|
|
|
@ -116,5 +116,8 @@ val copy_box : string -> string -> bool -> Pdf.t -> int list -> Pdf.t
|
||||||
(** True if all pages are "upright" i.e no rotation and (0,0)-based. *)
|
(** True if all pages are "upright" i.e no rotation and (0,0)-based. *)
|
||||||
val allupright : int list -> Pdf.t -> bool
|
val allupright : int list -> Pdf.t -> bool
|
||||||
|
|
||||||
|
(** True if all pages are "upright" i.e no rotation. *)
|
||||||
|
val alluprightonly : int list -> Pdf.t -> bool
|
||||||
|
|
||||||
(** When a page is transformed, its patterns must be too. *)
|
(** When a page is transformed, its patterns must be too. *)
|
||||||
val change_pattern_matrices_page : Pdf.t -> Pdftransform.transform_matrix -> Pdfpage.t -> Pdfpage.t
|
val change_pattern_matrices_page : Pdf.t -> Pdftransform.transform_matrix -> Pdfpage.t -> Pdfpage.t
|
||||||
|
|
Loading…
Reference in New Issue