Make PDF export orientation dependent on width vs. height, based on "pt", and using the dimensions of the canvas (Todo: provide alternative of predefined jsPDF options like a4, legal, etc.)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2795 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
50d0b1fb67
commit
1f95988b29
|
@ -1109,7 +1109,9 @@ TODOS
|
|||
}
|
||||
var c = $('#export_canvas')[0];
|
||||
if (type === 'PDF') {
|
||||
var doc = new jsPDF();
|
||||
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)
|
||||
svgElementToPdf(data.svg, doc, {});
|
||||
doc.save(svgCanvas.getDocumentTitle() + '.pdf');
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue