我正在尝试使用angular 5和jsPDF将html转换为pdf。
这是我的代码:
import * as jsPDF from "jspdf";
.
.
.
htmlToPdf(){
var doc=new jsPDF();
var specialElementHandlers = {
'#content' : function(element,render) {return true;}
};
doc.fromHTML(document.getElementById('content'), 20,20,{
'width':500,
'elementHandlers': specialElementHandlers,
});
doc.save('Reports.pdf');
}
我正在尝试将PDF导出为从右到左的方向,但没有成功。
当我尝试使用这个命令时:
doc.viewerPreferences({Direction: 'R2L'});
我遇到了一个错误:'在类型"jsPdf"上不存在该属性'
顺便说一下,在我的html或css中,我尝试使用direction属性,但没有帮助。它仍然是从左到右