From e91a54168fa98057d8f46c170548ee8653f7cc34 Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 4 Dec 2009 17:36:57 +0000 Subject: New: "SUBJECT","TITLE","CREATOR","AUTHOR","KEYWORDS" attributes for the PDF driver. --- html/en/drv/pdf.html | 6 +++++ html/en/history.html | 3 +++ src/drv/cdpdf.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/html/en/drv/pdf.html b/html/en/drv/pdf.html index 22e0a44..fd5ae23 100644 --- a/html/en/drv/pdf.html +++ b/html/en/drv/pdf.html @@ -222,6 +222,12 @@ the vertex where there is a hole in a of the PDFLib. + + diff --git a/html/en/history.html b/html/en/history.html index 9d82f3b..322bcdb 100644 --- a/html/en/history.html +++ b/html/en/history.html @@ -28,6 +28,9 @@ wdCanvasSetTransform, wdCanvasGetTransform, wdCanvasTranslate and wdCanvasScale, to better control the WD transformation. +
  • New: + "SUBJECT","TITLE","CREATOR","AUTHOR","KEYWORDS" attributes for the PDF + driver.
  • Changed: Freetype updated to version 2.3.11.
  • Changed: 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") -*/ -- cgit v1.2.3