0

When I export the custom agenda view I get this "unsaved" text in the exported PDF document (see blow):

Exported PDF

enter image description here

Agenda-related code in init.el

  (setq org-agenda-exporter-settings
    '((ps-number-of-columns 2)
      (ps-landscape-mode t)
      (org-agenda-add-entry-text-maxlines 5)
      (org-agenda-write-buffer-name "My Agenda (filtered by :@WORK:)")
      (htmlize-output-type 'css)))
  (setq org-agenda-custom-commands
    '(("w" "Work-related tasks"
       ((agenda ""))
       ((ps-number-of-columns 2)
        (org-agenda-span 14)
        (ps-landscape-mode t)
        (org-agenda-prefix-format " [ ] %t ")
        (org-agenda-time-grid nil)
        (org-agenda-show-all-dates t)
        (org-deadline-warning-days 0)
        (org-agenda-with-colors nil)
        (org-agenda-remove-tags t)
        (org-agenda-tag-filter-preset '("+@WORK")))
       ("~/Dropbox/orgfiles/views/work.pdf"))))

I tried to remove it by adding this line but to no avail:

  (org-agenda-write-buffer-name "My Agenda (filtered by :@WORK:)")

What does it mean "unsaved"? Is there any way to replace it correctly?

Note

  • To have PS (default) exported to PDF you need to have ps2pdf tool installed in your system.
  • To export the agenda view press C-c a e
1

What does it mean "unsaved"?

Unsaved is added by ps-print.el when it generates pdfs for unsaved buffers.

Is there any way to replace it correctly?

This can be changed by setting org-agenda-exporter-settings:

(setq org-agenda-exporter-settings
    '((ps-left-header (list 'org-agenda-write-buffer-name))
      (ps-right-header
           (list "/pagenumberstring load"
                 (lambda () (format-time-string "%d/%m/%Y"))))
      (ps-print-color-p 'black-white)
      (ps-font-size '(12 . 11))       ; Lanscape . Portrait
      (ps-top-margin 55)
      (ps-left-margin 35)
      (ps-right-margin 30)))

You can find further info on these and other options in ps-print.el (it has informative comments on interface, usage, setting layouts, etc at the beginning of the file).

I advice you to change org-agenda-write-buffer-name to org-agenda-custom-commands so as to give meaningful names per command. The way to achieve this would be in these lines:

(setq org-agenda-exporter-settings
  '((ps-left-header (list 'org-agenda-write-buffer-name))
    (ps-right-header
          (list "/pagenumberstring load"
                (lambda () (format-time-string "%d/%m/%Y"))))
    (ps-number-of-columns 2)
    (ps-landscape-mode t)
    (org-agenda-add-entry-text-maxlines 5)
    (htmlize-output-type 'css)))
(setq org-agenda-custom-commands
  '(("w" "Work-related tasks"
    ((agenda ""))
    ((org-agenda-span 14)
    (org-agenda-prefix-format " [ ] %t ")
    (org-agenda-time-grid nil)
    (org-agenda-show-all-dates t)
    (org-deadline-warning-days 0)
    (org-agenda-with-colors nil)
    (org-agenda-remove-tags t)
    (org-agenda-tag-filter-preset '("+@WORK"))
    (org-agenda-write-buffer-name "My Agenda (filtered by :@WORK:)"))
   ("~/Dropbox/orgfiles/views/work.pdf"))))

HTH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.