1、导出为PDF和PNG
要将甘特图导出为PDF文档,请执行以下步骤:
- 在页面中包含“https://export.dhtmlx.com/gantt/api.js”文件以启用在线导出服务:
<script src="codebase/dhtmlxgantt.js"></script> <script src="https://export.dhtmlx.com/gantt/api.js"></script> <link rel="stylesheet" href="codebase/dhtmlxgantt.css" type="text/css">
- 调用exportToPDF方法导出甘特图:
<input value="Export to PDF" type="button" onclick='gantt.exportToPDF()'>
<script>
gantt.init("gantt_here");
gantt.parse(demo_tasks);
</script>
2、导出为 PNG
要将甘特图导出为PNG图像,请执行以下步骤:
- 在页面中包含“https://export.dhtmlx.com/gantt/api.js”文件以启用在线导出服务:
<script src="codebase/dhtmlxgantt.js"></script> <script src="https://export.dhtmlx.com/gantt/api.js"></script> <link rel="stylesheet" href="codebase/dhtmlxgantt.css" type="text

本文介绍了如何使用DHTMLXGantt导出甘特图到PDF和PNG格式,包括设置输出文件名、语言、数据范围、皮肤、页眉页脚和自定义样式。导出过程涉及exportToPDF/exportToPNG方法,以及如何控制导出内容的详细程度。
最低0.47元/天 解锁文章
8001

被折叠的 条评论
为什么被折叠?



