TableTools PDF slovenian character fix
TableTools PDF slovenian character fix
![pbwned](https://secure.gravatar.com/avatar/817acb43721c5a1fa6666c744aa2d0dd/?default=https%3A%2F%2Fvanillicon.com%2F817acb43721c5a1fa6666c744aa2d0dd_200.png&rating=g&size=120)
Hi!
First of all I'd like to thank the developers of this great software. So many extensions, such great support, I simply must say thank you for this.
As the title says, there is a problem with slovenian characters and by that, I mean characters like "ščžć". Yes I've readed all the posts here, but I simply can't find a solution for my case (yes, I'm a new developer, so I don't have skills). The characters, I've mentioned are being replaced with some symbols.
I've also followed this tutorial https://datatables.net/forums/discussion/19812/tabletools-turkish-character-fix-may-help-utf-8-problems and hoped replacing with WINDOWS-1250 would work. Not even the font change worked.
About ISO/IEC 8859-16 http://en.wikipedia.org/wiki/ISO/IEC_8859-16
Answers
After more than 2 weeks of hard work on this case, I finally found the solution. So yes, you can use AlivePDF and save DataTables data as PDF.
I would like to thank this thread on FlashZone (yes, I had to translate words).
http://www.flashzone.pl/showthread.php?57348-AlivePDF-i-polskie-znaki
What you must do :
- Set CodePage to CP1250
Find the line in ZeroClipboard.as with var ef:EmbeddedFont and change CP1254 to CP1250 so it will look like this:
var ef:EmbeddedFont = new EmbeddedFont( new fontStream(), new afmStream(), CodePage.CP1250 );
Add the embed fonts on the beginning of ZeroClipboard.as ..
Find the lines public class ZeroClipboard extends Sprite {
=== Under that copy the following code:
[Embed( source="alamakot.ttf", mimeType="application/octet-stream" )]
private var fontStream:Class;
[Embed( source="alamakot.afm", mimeType="application/octet-stream" )]
private var afmStream:Class;
Copy the font on the download link to the flex BIN directory. Don't forget that you need both alamot .TTF and .AFM fonts
In the AlivePDF\src\org\alivepdf\pdf folder find the PDF.as file and search for:
buffer.writeMultiByte( content+"\n", "windows-1254" );
Replace it with: buffer.writeMultiByte( content+"\n", "windows-1250" );
All other steps are mentioned here: https://datatables.net/forums/discussion/19812/tabletools-turkish-character-fix-may-help-utf-8-problems
In case you won't succeed with the steps that I posted, I've uploaded the SWF and SWC files that worked for me.
Characters as "ščćž" now normally work for me when opening the PDF with Adobe Reader. Of course, Foxit Reader works too.
ZeroClipboard.as file:
http://www.mediafire.com/download/zvkj445yb4rxnaq/ZeroClipboard.swf
AlivePDF.swc:
http://www.mediafire.com/download/92asilb8okjn6gs/AlivePDF.swc
ZeroClipboard.as:
http://www.mediafire.com/view/n1665kly8mrri8k/ZeroClipboard.as
Font:
http://www.mediafire.com/download/a0f91v88kphq8n3/alamakot.ttf
(You need an .AFM file too which you can convert here: http://everythingfonts.com/ttf-to-afm)