-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add per-page pdf notes in PdfFile and PdfPages. #3994
Conversation
Can you please fix the pep8 violations?
|
Look reasonable to me. This is probably also worth a mention in https://github.com/matplotlib/matplotlib/tree/master/doc/users/whats_new and can you find and update the pdf pages example file? New features don't count unless they are documented ;) attn @jkseppan |
… to be able to specify the new note's position.
…ages.attach_note method in the whats_new section.
Thanks for your comments! @tacaswell - I corrected the PEP8 violations, sorry for that. The whats_new section contains an entry for this feature now, and I added a simple line to the multipage_pdf.py example. @jkseppan - The default position is off-page, so that the note icon doesn't appear in the figure itself. The reasoning being that the metadata should only appear in the list of annotations of a pdf viewer, not in the figure itself. You are right, it might make sense to make it similar to the draw_* functions. I wasn't coming from that angle as I didn't want to draw anything on the figure itself though, just add per-page metadata text. I can change the code to be more similar to the draw_* functions if that sounds better to you though. |
@jkseppan If you are happy with this as-is please merge it, other wise can you be in charge of the changes? |
This is ulido:pdf-annotations with a small documentation addition to advertise it a little bit better. Closes #3994
I was looking for the possibility to add per-figure metadata to a PdfPages output file. This patch enables this and adds a new method attach_note to the PdfPages class. This methods needs to be called with an arbitrary piece of text that is added as a note to the following page (hence attach_note needs to be called before savefig). The logic for creating the underlying pdf annotation object sits in the newNote method of the PdfFile class. The note is visible in any pdf reader that is able to display a list of annotations.