Changes

Jump to navigation Jump to search
1,876 bytes added ,  18:55, 11 September 2021
import PDF metadata fields from other document
</texcode>
This makes all links generated with the {{cmd|goto}} command (and indirectly the {{cmd|in}} and {{cmd|at}} commands) clickable. A page is dedicated to this system of '''[[References]]'''.
= Link coloring =
</texcode>
== XML source == When processing XML input file information in TUC file is stored as the XML command with the reference to XML node <texcode>["titledata"]={ ["label"]="section", ["title"]="\\xmlatt{xml:name::4}{title}", ["userdata"]={ ["usertitle"]=\\xmlatt{xml:name::4}{title}, }</texcode> You have to expand the information to get the text in TUC file and subsequently in bookmarks by modifying sections: <texcode>\setuphead [section] [expansion=yes]</texcode> To expand userdata also, you can use <tt>\normalexpanded{\startsection[..,..=..,..][..,..=..,..]}</tt> instead of <tt>expansion=yes</tt>. They are not in conflict. <texcode>\normalexpanded{\startsection[title=\\xmlatt{xml:name::4}{title}, bookmark=\\xmlatt{xml:name::4}{title}] [usertitle=\\xmlatt{xml:name::4}{title}]}...\stopsection</texcode>  = PDF Headers and Custom Properties =
In order to add '''Author''', '''Title''', '''Keywords''', ... to PDF headers, use:
subtitle={...},
keyword={...}]
</texcode>
 
In order to add custom key-value properties in the PDF Document, use:
 
<texcode>
\pdfbackendsetinfo{foo}{bar}
</texcode>
</texcode>}}
== Import PDF metadata fields from other PDF documents==
 
Inspired by a [https://mailman.ntg.nl/pipermail/ntg-context/2021/103556.html reply from Hans], here is a minimal sample:
 
<texcode>
\starttext
\startluacode
function document.transfer_metadata(name)
local main_doc = lpdf.epdf.load(name)
lpdf.addtocatalog("Lang", lpdf.string(main_doc.Catalog.Lang))
lpdf.addtoinfo("Title", lpdf.unicode(main_doc.Info.Title))
lpdf.addtoinfo("Subject", lpdf.unicode(main_doc.Info.Subject))
lpdf.addtoinfo("Author", lpdf.unicode(main_doc.Info.Author))
lpdf.epdf.unload(name)
end
\stopluacode
\unexpanded\def\TransferMetadata#1%
{\ctxlua{document.transfer_metadata("#1")}}
\null
\TransferMetadata{name.pdf}
\stoptext
</texcode>
 
It also imports language to the PDF document (not to the document language).
= Further reading =
* [[URL]]: typesetting of URLs references.
* [[Presentations]], [[Presentation Styles]], [[SlideWithSteps]], [[Presentation effects]]
* [[Widgets]] (interactive elements, form fields etc.) and [[Interaction and button]]
[[Category:Interaction]]
 
{{Getting started navbox}}
139

edits

Navigation menu