6

Save the local PDF method with alivepdf, flash as3

 3 years ago
source link: https://www.codesd.com/item/save-the-local-pdf-method-with-alivepdf-flash-as3.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Save the local PDF method with alivepdf, flash as3

advertisements

I have tried few things but no success. I want to prompt user on button click event to save PDF file in local computer generated from object array which were created by user at runtime.

Any sort of help is greatly appreciated Thanks

I have revised target flash player 10.0 in the html and somehow found out that the save event call has to be on button click event and I already have that. but still it gives me error and does not even generate swf file.

Here is the code and error.

1061: Call to a possibly undefined method save through a reference with static type flash.net:FileReference. It gives me this error.

var cFile:FileReference = new FileReference();
var gBytes:ByteArray = this._myPDF.save(Method.LOCAL);
cFile.save(gBytes,"test.pdf");


If you just want to prompt user to save the file in local system, you can try FileReference for that.

like :

file = new FileReference();
file.addEventListener(Event.COMPLETE, completeHandler);
file.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
file.save(mc, "myMovieClip");

here mc is any type of data you can provide, in your case you can provide your dynamically generated PDF file, and "myMovieClip" is name which you wan to give that file.

try this, might be useful for you.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK