Function: doc-view-set-slice

doc-view-set-slice is an interactive and byte-compiled function defined in doc-view.el.gz.

Signature

(doc-view-set-slice X Y WIDTH HEIGHT)

Documentation

Set the slice of the images that should be displayed.

You can use this function to tell doc-view not to display the margins of the document. It prompts for the top-left corner (X and Y) of the slice to display and its WIDTH and HEIGHT.

See doc-view-set-slice-using-mouse and doc-view-set-slice-from-bounding-box for more convenient ways to do that. To reset the slice use doc-view-reset-slice.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/doc-view.el.gz
(defun doc-view-set-slice (x y width height)
  "Set the slice of the images that should be displayed.
You can use this function to tell doc-view not to display the
margins of the document.  It prompts for the top-left corner (X
and Y) of the slice to display and its WIDTH and HEIGHT.

See `doc-view-set-slice-using-mouse' and
`doc-view-set-slice-from-bounding-box' for more convenient ways
to do that.  To reset the slice use `doc-view-reset-slice'."
  (interactive
   (let* ((size (image-size (doc-view-current-image) t))
	  (a (read-number (format "Top-left X (0..%d): " (car size))))
	  (b (read-number (format "Top-left Y (0..%d): " (cdr size))))
	  (c (read-number (format "Width (0..%d): " (- (car size) a))))
	  (d (read-number (format "Height (0..%d): " (- (cdr size) b)))))
     (list a b c d)))
  (setf (doc-view-current-slice) (list x y width height))
  ;; Redisplay
  (doc-view-goto-page (doc-view-current-page)))