如何更改数据表插件中导出pdf的字体大小
如何更改字体大小以在 数据表插件 中导出 pdf? 我查看了来源,找不到它在哪里!
任何人都可以帮助我吗? 谢谢
How do I change the font size to export the pdf at datatables plug in?
I looked at the sources and could not find where does it!
any body can help me??
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如 Adam 所说,您必须修改操作脚本。在 TableTools 2.0.1 中,该文件是 Adam 所说的文件。
在动作脚本中,标题的字体在第 212 行定义,
其他文本的字体在第 218 行
定义。这里有用于生成 PDF 的库的完整参考(我指出了字体部分): http://alivepdf.bytearray.org/alivepdf-asdoc/org/alivepdf/fonts/ FontFamily.html
修改操作脚本后,您必须使用操作脚本文件顶部的命令编译新的 copy_cvs_xls_pdf.swf:
编译使用: mxmlc --target-player=10.0.0 -static-link-runtime-shared-libraries=true -library-path+=lib ZeroClipboardPdf.as
您需要 Flex 4 SDK 来构建 SWF - 您可以从 Adobe 开源页面免费获取。
我尝试过并且有效。
您应该始终查看 http://datatables.net/forums/ 另外,我发现 这个帮助我编译了文件!
希望有帮助
As Adam stated, you must modify the action script. In TableTools 2.0.1 the file i the one that Adam stated.
In the action script Fonts are defined on line 212 for the title:
and on line 218 for the other text
There is full reference for the library used to generate the PDF (i point out the font-part) here : http://alivepdf.bytearray.org/alivepdf-asdoc/org/alivepdf/fonts/FontFamily.html
After you have modified the action script you must compile a new copy_cvs_xls_pdf.swf with the command found on top of the action script file:
Compile using: mxmlc --target-player=10.0.0 -static-link-runtime-shared-libraries=true -library-path+=lib ZeroClipboardPdf.as
You'll need the Flex 4 SDK to build the SWF - which you can get free from the Adobe open source pages.
I tried it and it works.
You should always check out http://datatables.net/forums/ also, i found this that helped me compile the file!
hope it helps
字体文本直接在Flash中渲染,不能用CSS修改。您需要修改 TableTools 的 ActionScript 文件才能更改字体大小。
它位于
The font text is rendered directly in Flash, and can not be modified with CSS. You would need to modify the ActionScript file for TableTools to change the font size.
It is located in
回答这个问题可能已经太晚了,但我确实没有从作者或任何其他网站上找到任何有关 tabletools syling 技术的支持文档...毫不羞耻地说,我当时确实对 ActionScript 没有太多了解,并且正在搜索在线提供可靠的文档。但一切都很顺利。简而言之,您需要做的就是更改生成的 pdf 的样式
1.下载并安装 flex sdk 4.
2.获取最新的 AlivePDF.swc
3.设置路径和编辑AS文件
May be its to late to answer this,but i really didnt find any supporting documents from the author or in any other website regarding tabletools syling techniques...no shame to say i really didnt had much knowledge on actionscript at that point and was searching for a solid document online.But all was in vein.In a nut shell this what you have to do to change styling to the generated pdf
1.Download and install flex sdk 4.
2.Take latest AlivePDF.swc
3.Set path and edit the AS file
我也想分享我的经验。它可能会对像我这样没有任何 ActionScript 背景的人有所帮助。
关键是
as3
文件夹中有两个版本的ZeroClipboard
类,很明显,我们将使用
ZeroClipboardPdf.as
文件,如果我们想更改 Pdf 导出的字体大小。 尝试在此文件顶部给出的命令但是,当我按照上面的评论
将
--target-player
更改为11.1
时,我收到以下错误所以这就是我的内容确实
然后,使用此命令
,它生成了一个名为
ZeroClipboard.swf 位于
as3
文件夹中,我将此文件重命名为copy_csv_xls_pdf.swf
并在我的项目中使用。开发环境:Windows 7、Adobe Flex 4.6
I would like to share my experience as well. It might help someone like me who doesn't any background in ActionScript.
Key thing is that the there are two versions
ZeroClipboard
class inas3
folderIt's obvious that we would be working with
ZeroClipboardPdf.as
file, if we want to change the font size for Pdf exports. However, when I tried the command given at the top on this fileChanged
--target-player
to11.1
as per comment aboveI got the following error
So here is what I did
Then, used this command
and it generated a file named
ZeroClipboard.swf
inas3
folder and I renamed this file tocopy_csv_xls_pdf.swf
and used in my project.Dev Env: Windows 7, Adobe Flex 4.6