Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--header issues #30

Closed
AcarBurak opened this issue Oct 25, 2019 · 7 comments
Closed

--header issues #30

AcarBurak opened this issue Oct 25, 2019 · 7 comments

Comments

@AcarBurak
Copy link

Thank you for the very useful programme.

Ability to configure the header would help a lot, that is, unless you yourself choose to remove the date and the "Page" strings.

The "Page" string ruins a non-English conversion and don't you think it's redundant in the first place?

The date string ruins any conversion.

header

@gnusupport
Copy link

I have the same problem, I would like to configure header.

@dov
Copy link
Owner

dov commented Dec 17, 2022

Thanks for asking about this! So I made a first implementation of it, and pushed it as part of the forthcoming version 0.8. As part of the implementation I switched to C++17. I hope it doesn't annoy to many people.

I have added three new command line options to paps:

  • --header-left - The left side of the header
  • --header-center - The center of the header
  • --header-left - The right side of the header

They all take a string that is based on python f-strings. I have defined the following variable that may be used in the definitions of the headers:

  • path - The complete path of the file being printed
  • filename - The basename (without directory) of the file being printed
  • mtime - The file's modification time
  • now - The current time
  • num_pages - The total number of pages in the document
  • page_idx - The current page being printed

Here is an example of how it may be used:

paps --header-left="{now:%Y-%m-%d %H:%M}" --header-center="{filename}" --header-right="Page {page_idx:02d}/{num_pages:02d}" --header -o hello.pdf paps.cc

Please let me know your feedback.

@dov
Copy link
Owner

dov commented Dec 17, 2022

Since this is a duplicate of #4 , I'll close this issue.

@dov dov closed this as completed Dec 17, 2022
@gnusupport
Copy link

gnusupport commented Dec 18, 2022

That is great. I use paps to make nice PDF printouts from Emacs buffers. It is very useful for reporting purposes.

I guess you have forgot to customize analogously the --footer option.

Just that I cannot build it, neither configure nor meson works, you may see it in my other comment.

@dov
Copy link
Owner

dov commented Dec 27, 2022

That is great. I use paps to make nice PDF printouts from Emacs buffers. It is very useful for reporting purposes.

I guess you have forgot to customize analogously the --footer option.

Just that I cannot build it, neither configure nor meson works, you may see it in my other comment.

Note that I added footer as well, and fixed the compilation (I think). Did you have a chance to test it?

@gnusupport
Copy link

That is more than great, in the next step I will test it and make Emacs Lisp package for Emacs buffer printing and previews.

@gnusupport
Copy link

gnusupport commented Dec 30, 2022

For me it works very nice and very well.

GNU Emacs package: rcd-paps.el:
https://gnu.support/gnu-emacs/packages/GNU-Emacs-package-rcd-paps-el-76862.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants