How to change font size to export pdf to datatables plug in

How to change font size for pdf export to datatables pluggable files ? I looked at the sources and could not find where he is!

can any body help me? thanks

+4
source share
4 answers

As Adam said, you have to change the action of the script. In the TableTools 2.0.1 file, I am the one that Adam said. In the script action, Fonts are defined in line 212 for the name:

pdf.setFont( new CoreFont(FontFamily.HELVETICA), 14 );//14 is the font size if ( title != "" ) { pdf.writeText(11, title+"\n"); } 

and on line 218 for another text

  pdf.setFont( new CoreFont(FontFamily.HELVETICA), 11 ); if ( message != "" ) { pdf.writeText(11, message+"\n"); } 

There is a full link to the library used to create the PDF (I indicate part of the font here): http://alivepdf.bytearray.org/alivepdf-asdoc/org/alivepdf/fonts/FontFamily.html

After you modify the script action, you must compile a new copy of copy_cvs_xls_pdf.swf with the command found on top of the script action file: Compile using: mxmlc --target-player = 10.0.0 -static-link-runtime-shared-libraries = true -library-path + = lib ZeroClipboardPdf.as

To create SWF, you need the Flex 4 SDK, which you can free from Adobe's open source pages.

I tried and it works.

You should always check out http://datatables.net/forums/ , I found this that helped me compile the file!

hope this helps

+4
source

The font text is displayed directly in Flash and cannot be modified using CSS. You will need to modify the ActionScript file for TableTools to change the font size.

It is located in

 <Datatables Location>/extras/TableTools/media/as3/ZeroClipboardPdf.as 
+2
source

Maybe late to answer this question, but I really did not find any supporting documents from the author or on any other website regarding modeling methods on tablets ... there is no shame to say that I really didn’t have much knowledge of ActionScript at that moment and was looking for a solid online document. But everything was in a vein. In a walnut shell, this is what you need to do to change the style to the generated PDF

1.Download and install flex sdk 4.

2.Select the latest version of AlivePDF.swc

3. Set the path and edit the AS file

0
source

I would like to share my experience. This might help someone like me who has no background in ActionScript.

The key point is that there are two versions of the ZeroClipboard class in the as3 folder

  • one in the ZeroClipboard.as file
  • other in the ZeroClipboardPdf.as file

Obviously, we will work with the ZeroClipboardPdf.as file if we want to change the font size for exporting Pdf. However, when I tried the command at the top of this file

 mxmlc --target-player=11.1 -static-link-runtime-shared-libraries=true -library-path+=lib ZeroClipboardPdf.as 

Changed --target-player to 11.1 according to the comment above

I got the following error:

 Error: A file found in a source-path 'ZeroClipboardPdf' must have the same name as the class definition inside the file 'ZeroClipboard'. 

So here is what I did

  • changed the file named "ZeroClipboard.as" to "ZeroClipboardNonePdf.as"
  • changed the file named "ZeroClipboardPdf.as" to "ZeroClipboard.as"

Then using this command

 mxmlc --target-player=11.1 -static-link-runtime-shared-libraries=true -library-path+=lib ZeroClipboard.as 

and he generated a file called ZeroClipboard.swf in the as3 folder, and I renamed this file to copy_csv_xls_pdf.swf and used it in my project.

Dev Env: Windows 7, Adobe Flex 4.6

0
source

Source: https://habr.com/ru/post/1346487/


All Articles