-1
我已經使用了下面的html2canvas代碼在文檔主體下面追加了畫布,但是我想要定位特定的div並將其另存爲pdf?如何將html2canvas保存爲pdf文件
function getscreenshot() {
html2canvas(document.body, {
onrendered: function (canvas) {
document.body.appendChild(canvas);
}
});
};
嗨@Manuel Vidal,這是我怎麼從C#腳本中的按鈕調用函數? 'main'是div的名稱,'mcn'是我想將它保存爲文件的名稱:protected void Print_Button_Click(object sender,EventArgs e) { ScriptManager.RegisterClientScriptBlock(this,GetType(), 「mykey」,「getscreenshot(main,mcn);」,true); } – kehoewex86
說實話,我不能回答,因爲我不知道這件事。 –
謝謝@Manuel Vidal,非常適合文檔,正文,但努力讓它適用於單個div ...將繼續嘗試! – kehoewex86