admin管理员组文章数量:1428481
export-as and exporting pdf, exported pdf document is not proper it is not streching fully red mark inserted for reference,attached image . Below is my config:
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 },
}
}
call in function:
export(){
this.exportAsService.save(this.exportAsConfig, 'engagementLetter').subscribe(() => {
// save started
});
}
Any solution for this
Html print snippet image:
export-as and exporting pdf, exported pdf document is not proper it is not streching fully red mark inserted for reference,attached image . Below is my config:
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 },
}
}
call in function:
export(){
this.exportAsService.save(this.exportAsConfig, 'engagementLetter').subscribe(() => {
// save started
});
}
Any solution for this
Html print snippet image:
Share Improve this question edited Nov 21, 2019 at 10:20 Sudhir asked Nov 21, 2019 at 9:56 SudhirSudhir 5791 gold badge11 silver badges29 bronze badges 3- 1 Could you add a small snippet of HTML that allows us to recreate this issue? – Titulum Commented Nov 21, 2019 at 10:00
- Added html snippet – Sudhir Commented Nov 21, 2019 at 10:21
- @Titulum any other libraries to export as pdf – Sudhir Commented Nov 21, 2019 at 10:28
2 Answers
Reset to default 2in google chrom you can set the view to print and specify media type to print then add css related to print type this css will applied only in printing mood use this answer to check how to switch to print mood .
I have lot of experience with pdf in Angular.
Among all of them best library is https://www.npmjs./package/jspdf
Example : https://rawgit./MrRio/jsPDF/master/
Docs : https://rawgit./MrRio/jsPDF/master/docs/
本文标签: javascriptExport HTML page to pdf in angularStack Overflow
版权声明:本文标题:javascript - Export HTML page to pdf in angular - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745529313a2661985.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论