metanorma / mn-native-pdf

Development repository for mn2pdf with Metanorma document samples
3 stars 2 forks source link

Add description for the embedded file #739

Closed Intelligent2013 closed 2 months ago

Intelligent2013 commented 2 months ago

Source issue: https://github.com/metanorma/metanorma/issues/407#issuecomment-2323106713

Note that it says "An optional description can also be added ..." --> MN should require this description as it is needed for accessibility and conformance with PDF/A and PDF/UA!

<pdf:embedded-file filename="image.jpg" src="url(file:///...)" description="My image"/>
Intelligent2013 commented 2 months ago

The attachment description can be specified in the adoc as bibliography item title:

[bibliography]
== Bibliography

* [[[file1,attachment:(sources/program.c)]]], Description text for program.c

The Presentation XML:

<bibitem id="file1" hidden="true">
    <formattedref format="application/x-isodoc+xml">Description text for program.c</formattedref>
    <uri type="attachment">sources/program.c</uri>
    <uri type="citation">sources/program.c</uri>
    <docidentifier type="metanorma">[sources/program.c]</docidentifier>
</bibitem>

Resulted PDF: image

Intelligent2013 commented 2 months ago

Documentation updated in https://github.com/metanorma/metanorma.org/pull/816.