Follow-up Comment #3, bug #66501 (group groff):

Hi Deri,

[comment #1 comment #1:]
> Note to self. Keith's original design for .pdfnote only caters for a title
> and text. These pdfnotes have other attributes, colour, author, date, icon
> (Comment,Key,Note,Help,NewParagraph,Paragraph,Insert), which are currently
> not set. 
> 
> Should author and date be populated automatically. Is there a reliable way to
> get author?

The 'pdfinfo' macro does not cache anything it's given, so not that I know
of.

Here's how I would have implemented the macro.  This is a proof of concept.
If you like it I'm happy to commit it (with a documentation update to
"gropdf.1.man").


diff --git a/tmac/pdf.tmac b/tmac/pdf.tmac
index 234852c5a..d198b3b60 100644
--- a/tmac/pdf.tmac
+++ b/tmac/pdf.tmac
@@ -84,16 +84,20 @@ .de pdf:error
 .de pdfinfo
 .\" -------------------------------------------------------------------
 .\" Usage:
-.\"   .pdfinfo /FieldName field content ...
-.\" Examples:
-.\"   .pdfinfo /Title   A PDF Document
-.\"   .pdfinfo /Author  Keith Marshall
+.\"   .pdfinfo field-name content
 .\" -------------------------------------------------------------------
 .\"
+.if !\A'\\$1' \{\
+.  pdf:error pdfinfo: field name '\\$1' is not a valid identifier; \
+ignoring
+.  return
+.\}
 .ds pdf:meta.field \\$1
+.ds pdf*metadata*\\$1 \" empty
 .shift
-.ie '\\n(.z'' .pdfmark \\*[pdf:meta.field] (\\$*) /DOCINFO
-.el \!.pdfmark \\*[pdf:meta.field] (\\$*) /DOCINFO
+.as pdf*metadata*\\$*
+.ie '\\n(.z'' .pdfmark /\\*[pdf:meta.field] (\\$*) /DOCINFO
+.el \!.pdfmark /\\*[pdf:meta.field] (\\$*) /DOCINFO
 .rm pdf:meta.field
 ..
 .de pdfview


This way you could recover any defined meta-datum by its field value.  For
example, `\*[pdf*metdata*Author]`.  The tooltip code would still want to check
for the `pdf*metadata*Author` string being defined, and maybe for having empty
content.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66501>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to