diff options
author | scuri <scuri> | 2009-12-04 17:36:57 +0000 |
---|---|---|
committer | scuri <scuri> | 2009-12-04 17:36:57 +0000 |
commit | e91a54168fa98057d8f46c170548ee8653f7cc34 (patch) | |
tree | aec8640b96f6a5334e97327c83939ad19a7df59a /src/drv | |
parent | cda0e2e503bd7ae005803b903119e45d35851ade (diff) |
New: "SUBJECT","TITLE","CREATOR","AUTHOR","KEYWORDS" attributes for the PDF driver.
Diffstat (limited to 'src/drv')
-rw-r--r-- | src/drv/cdpdf.c | 74 |
1 files changed, 70 insertions, 4 deletions
diff --git a/src/drv/cdpdf.c b/src/drv/cdpdf.c index 79ce28f..ffad84b 100644 --- a/src/drv/cdpdf.c +++ b/src/drv/cdpdf.c @@ -1278,6 +1278,71 @@ static cdAttribute pattern_attrib = NULL }; +static void set_subject_attrib(cdCtxCanvas *ctxcanvas, char* data) +{ + if (data) + PDF_set_info(ctxcanvas->pdf, "Subject", data); +} + +static cdAttribute subject_attrib = +{ + "SUBJECT", + set_subject_attrib, + NULL +}; + +static void set_title_attrib(cdCtxCanvas *ctxcanvas, char* data) +{ + if (data) + PDF_set_info(ctxcanvas->pdf, "Title", data); +} + +static cdAttribute title_attrib = +{ + "TITLE", + set_title_attrib, + NULL +}; + +static void set_creator_attrib(cdCtxCanvas *ctxcanvas, char* data) +{ + if (data) + PDF_set_info(ctxcanvas->pdf, "Creator", data); +} + +static cdAttribute creator_attrib = +{ + "CREATOR", + set_creator_attrib, + NULL +}; + +static void set_author_attrib(cdCtxCanvas *ctxcanvas, char* data) +{ + if (data) + PDF_set_info(ctxcanvas->pdf, "Author", data); +} + +static cdAttribute author_attrib = +{ + "AUTHOR", + set_author_attrib, + NULL +}; + +static void set_keywords_attrib(cdCtxCanvas *ctxcanvas, char* data) +{ + if (data) + PDF_set_info(ctxcanvas->pdf, "Keywords", data); +} + +static cdAttribute keywords_attrib = +{ + "KEYWORDS", + set_keywords_attrib, + NULL +}; + static void set_opacity_attrib(cdCtxCanvas *ctxcanvas, char* data) { int state; @@ -1367,6 +1432,11 @@ static void cdcreatecanvas(cdCanvas* canvas, void *data) cdRegisterAttribute(canvas, &opacity_attrib); cdRegisterAttribute(canvas, &pattern_attrib); cdRegisterAttribute(canvas, &pdf_attrib); + cdRegisterAttribute(canvas, &subject_attrib); + cdRegisterAttribute(canvas, &title_attrib); + cdRegisterAttribute(canvas, &creator_attrib); + cdRegisterAttribute(canvas, &author_attrib); + cdRegisterAttribute(canvas, &keywords_attrib); setpdfdefaultvalues(ctxcanvas); @@ -1485,7 +1555,3 @@ cdContext* cdContextPDF(void) { return &cdPDFContext; } - -/* -p.set_info("Creator", "PDFlib Cookbook") -*/ |