summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdib Taraben <theadib@gmail.com>2006-05-21 00:42:12 +0000
committertheadib <theadib@users.sourceforge.net>2006-05-21 00:42:12 +0000
commit2d795e910af7764a233263be030cb99a4e264478 (patch)
treec817663a23b53fc1c390df7d2196902f676b4646 /src
parent* Implement size selection in text toolbar (diff)
downloadinkscape-2d795e910af7764a233263be030cb99a4e264478.tar.gz
inkscape-2d795e910af7764a233263be030cb99a4e264478.zip
completet some more metainfo (title, creator, producer, date) for pdf
(bzr r908)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/pdf.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/extension/internal/pdf.cpp b/src/extension/internal/pdf.cpp
index 0a4969a26..cd9ec7685 100644
--- a/src/extension/internal/pdf.cpp
+++ b/src/extension/internal/pdf.cpp
@@ -303,13 +303,26 @@ PrintPDF::begin(Inkscape::Extension::Print *mod, SPDocument *doc)
pdf_file = new PdfFile(_stream);
doc_info = pdf_file->begin_document(1.4);
-// *doc_info << " /Title(" << "?" << ")\n";
+ *doc_info << " /Title(" << doc->name << ")\n";
// *doc_info << " /Author(" << "?" << ")\n";
// *doc_info << " /Subject(" << "?" << ")\n";
// *doc_info << " /Keywords(" << "?" << ")\n";
-// *doc_info << " /Creator(" << "?" << ")\n";
- *doc_info << " /Producer(" << PACKAGE_STRING << ")\n";
-// *doc_info << " /CreationDate(D:YYYYMMDDHHmmSSOHH'mm')\n";
+ *doc_info << " /Creator(" << "www.inkscape.org" << ")\n";
+ *doc_info << " /Producer(" << "Inkscape " << PACKAGE_STRING << ")\n";
+ //the date should be in ISO/IEC 8824
+ GDate date;
+ GTimeVal ltime;
+ glong time_hh, time_mm, time_ss;
+ g_date_set_time_t (&date, time (NULL));
+ gchar date_str[100], time_str[100];
+ g_date_strftime(date_str, 99, "%Y%m%d", &date);
+ g_get_current_time(&ltime);
+ time_hh=(ltime.tv_sec/3600)%24;
+ time_mm=(ltime.tv_sec/60)%60;
+ time_ss=(ltime.tv_sec)%60;
+ g_snprintf(time_str, 99, "%02ld%02ld%02ld", time_hh, time_mm, time_ss);
+ *doc_info << " /CreationDate(D:" << date_str << time_str << "Z)\n";
+// *doc_info << " /CreationDate(D:" << date_str << time_str << "OHH'mm')\n";
/* flush this to test output stream as early as possible */
if (fflush(_stream)) {