Need help compiling .as
Page 1 of 1
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Wed, 26th Sep 2012 04:30    Post subject: Need help compiling .as
Hey, guys, I'm trying to recompile an .as file to make it unicode-friendly (it produces pdfs)

Based on the discussion here :
http://datatables.net/forums/discussion/4498/table-tools-pdf-add-style-at-least-bold-and-italic/p1

I downloaded the opensource Flex sdk but I get this error :
Code:
E:\as3>bin\mxmlc.exe --target-player=10.0.0 -static-link-runtime-shared-libraries=true -library-path+=lib ZeroClipboardPdf.as
Loading configuration file E:\as3\frameworks\flex-config.xml
E:\as3\ZeroClipboardPdf.as: Error: A file found in a source-path 'ZeroClipboardPdf' must have the same name as the class definition inside the file 'ZeroClipboard'.


If you can figure it out and recompile, I will owe you a debt of blood. Virgin blood.
http://www.wikiupload.com/MD7GY9RBPH8J9SU
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Wed, 26th Sep 2012 10:45    Post subject:
ZeroClipboardPdf.as must contain a class called ZeroClipboardPdf or you have to rename it to ZeroClipboard.as Smile

Perhaps there's a compiler flag that'll let you override this (or perhaps it should just be compiled for a lower SDK version), but the easiest way is to just have both in separate folders, same name and have different output targets. So create a directory "pdf", move the Pdf.as in there and rename it to ZeroClipboard.as and compile it using a -o switch.

Here's a Makefile I just quickly used to test:
Code:
MXMLC = "/Applications/Adobe Flash Builder 4.6/sdks/3.6.0/bin/mxmlc"

all:
   $(MXMLC) --target-player=10.0.0 ZeroClipboard.as
   $(MXMLC) --target-player=10.0.0 -static-link-runtime-shared-libraries=true -library-path+=lib -o ZeroClipboardPdf.swf pdf/ZeroClipboard.as


Want me to upload the recompiled files for you?
Back to top
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Wed, 26th Sep 2012 12:04    Post subject:
Just renaming it worked, thanks Very Happy

But now I need to figure out what to change so that pdf export works properly with unicode. It is using that alivepdf thingy. Check here :

He says :
http://datatables.net/forums/discussion/4498/table-tools-pdf-add-style-at-least-bold-and-italic/p1
Quote:
Now I can export a Japense supported pdf by using UnicodePDF class.


Any ideas on what to change ?
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Wed, 26th Sep 2012 12:33    Post subject:
Line 18: import UnicodePDF instead of PDF (same namespace)

Then in the rest of file, replace all references to the PDF class with UnicodePDF; quickest method is to just do two text-replacements:
- replace ":PDF" with ":UnicodePDF" (this is the type declaration for variables and return value for methods)
- replace "PDF(" with "UnicodePDF("
Without quotes, obviously Wink

The two classes have identical interfaces so it should be perfectly fine to exchange them Smile
Back to top
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Wed, 26th Sep 2012 13:19    Post subject:
Thanks again, I changed it successfully and still my own language's characters appear garbled. Tried a couple of the other core fonts, too.

Well, SHIT.

These character bullshit problems just get on my nerves, seriously. I'm stuck.
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Wed, 26th Sep 2012 13:28    Post subject:
Well, PDF is a fucked up format to work with anyway; can you send me a result PDF? I'll have a look through its source, see if it's generated as UTF-8 properly. Unfortunately I know PDF's internals quite well (my graduation project involved it as well as JDF). It truly is a huge fucking mess inside, and extremely easy to fuck up Smile
Back to top
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Wed, 26th Sep 2012 14:29    Post subject:
I will PM you one later today Smile
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group