mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-26 05:18:21 +01:00
Add metadata support.
This commit is contained in:
parent
4b29c9a1c2
commit
a39b01ec9c
@ -572,6 +572,7 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
docdata_t dd; // Document data
|
docdata_t dd; // Document data
|
||||||
docfont_t fontface; // Current font
|
docfont_t fontface; // Current font
|
||||||
mmd_t *doc; // Markdown document
|
mmd_t *doc; // Markdown document
|
||||||
|
const char *value; // Metadata value
|
||||||
|
|
||||||
|
|
||||||
// Get the markdown file from the command-line...
|
// Get the markdown file from the command-line...
|
||||||
@ -610,6 +611,20 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
if ((dd.pdf = pdfioFileCreateOutput(output_cb, /*output_cbdata*/NULL, /*version*/NULL, /*media_box*/NULL, /*crop_box*/NULL, /*error_cb*/NULL, /*error_data*/NULL)) == NULL)
|
if ((dd.pdf = pdfioFileCreateOutput(output_cb, /*output_cbdata*/NULL, /*version*/NULL, /*media_box*/NULL, /*crop_box*/NULL, /*error_cb*/NULL, /*error_data*/NULL)) == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
|
if ((value = mmdGetMetadata(doc, "author")) != NULL)
|
||||||
|
pdfioFileSetAuthor(dd.pdf, value);
|
||||||
|
|
||||||
|
if ((value = mmdGetMetadata(doc, "keywords")) != NULL)
|
||||||
|
pdfioFileSetKeywords(dd.pdf, value);
|
||||||
|
|
||||||
|
if ((value = mmdGetMetadata(doc, "subject")) != NULL)
|
||||||
|
pdfioFileSetSubject(dd.pdf, value);
|
||||||
|
else if ((value = mmdGetMetadata(doc, "copyright")) != NULL)
|
||||||
|
pdfioFileSetSubject(dd.pdf, value);
|
||||||
|
|
||||||
|
if (dd.title)
|
||||||
|
pdfioFileSetTitle(dd.pdf, dd.title);
|
||||||
|
|
||||||
// Add fonts...
|
// Add fonts...
|
||||||
for (fontface = DOCFONT_REGULAR; fontface < DOCFONT_MAX; fontface ++)
|
for (fontface = DOCFONT_REGULAR; fontface < DOCFONT_MAX; fontface ++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user