亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

以角度將HTML頁面導出為pdf

以角度將HTML頁面導出為pdf

LEATH 2022-01-07 09:47:13
導出為并導出 pdf,導出的 pdf 文檔不正確,它沒有拉伸插入的全紅色標記以供參考,附加圖像。下面是我的配置:  exportAsConfig: ExportAsConfig = {    type: 'pdf', // the type you want to download    //elementId: 'balance-sheet-preview', // the id of html/table element    elementId: 'contentToConvert', // the id of html/table element    options: { // html-docx-js document options      margins: {        top: '20',        bottom: '5'      },      orientation: 'landscape',      filename: 'engagement.pdf',      image: { type: 'jpeg', quality: 1 },    }  }調用函數:export(){this.exportAsService.save(this.exportAsConfig, 'engagementLetter').subscribe(() => {      // save started    });}對此的任何解決方案Html 打印片段圖像:
查看完整描述

2 回答

?
30秒到達戰場

TA貢獻1828條經驗 獲得超6個贊

在 google chrom 中,您可以將視圖設置為打印并指定要打印的媒體類型,然后添加與打印類型相關的 css 此 css 僅適用于打印心情使用此答案來檢查如何切換到打印心情。


查看完整回答
反對 回復 2022-01-07
?
喵喔喔

TA貢獻1735條經驗 獲得超5個贊

我在 Angular 中使用 pdf 有很多經驗。

其中最好的庫是https://www.npmjs.com/package/jspdf

示例:https : //rawgit.com/MrRio/jsPDF/master/

文檔:https : //rawgit.com/MrRio/jsPDF/master/docs/


查看完整回答
反對 回復 2022-01-07
  • 2 回答
  • 0 關注
  • 222 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號