From 667de191472588a69be0f8254e39860387880180 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Tue, 8 Apr 2014 08:18:47 +0000 Subject: [PATCH] Set document title as PDF property git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2796 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index d148f7d7..a320cf05 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1112,8 +1112,16 @@ TODOS var res = svgCanvas.getResolution(); var orientation = res.w > res.h ? 'landscape' : 'portrait'; var doc = new jsPDF(orientation, 'pt', [res.w, res.h]); // Todo: Give options to use predefined jsPDF formats like "a4", etc. from pull-down (with option to keep customizable) + var docTitle = svgCanvas.getDocumentTitle(); + doc.setProperties({ + title: docTitle/*, + subject: '', + author: '', + keywords: '', + creator: ''*/ + }); svgElementToPdf(data.svg, doc, {}); - doc.save(svgCanvas.getDocumentTitle() + '.pdf'); + doc.save(docTitle + '.pdf'); return; } c.width = svgCanvas.contentW;