[Embed(source='assets/arial.ttf', embedAsCFF='false', fontName='myArial', mimeType='application/x-font')] private var font1:Class; var myCoreFont:IFont = new CoreFont (FontFamily.ARIAL); myPDF.setFont(myCoreFont,8);
Amy, The generate pdf function is taking the focus which forces you to have to click the button again to give the focus to the save method. You need to have a button for generate pdf and then then have the user click a button that only has the file reference code.
Shafi, Just like the message is telling you you have to call this code directly from a mouse click like a button in a widget or a context menu. It can not be called from any other portion of code that call on another function before it opens the file save dialog.
Joshua, The RemoveCur is just a simple function that I have that will remove the busy cursor that I set when the pdf export begins. You can delete all those event listeners if you want to.
Brad, That dot Net portion can be avoid completely if you force your clients to use Flash Player 10. If you set your flex projects html wrapper to use flash player 10.0.22 or higher than you can use code like this in your print widgetconst fileReference:FileReference = new FileReference(); fileReference.addEventListener(Event.COMPLETE, removeCur); fileReference.addEventListener(Event.CANCEL, removeCur); fileReference.addEventListener(IOErrorEvent.IO_ERROR, removeCur); fileReference.addEventListener(SecurityErrorEvent.SECURITY_ERROR, removeCur); fileReference.save(myPDF.save(Method.LOCAL,"",Download.INLINE,"myPDF.pdf"),"map.pdf");
const fileReference:FileReference = new FileReference(); fileReference.addEventListener(Event.COMPLETE, removeCur); fileReference.addEventListener(Event.CANCEL, removeCur); fileReference.addEventListener(IOErrorEvent.IO_ERROR, removeCur); fileReference.addEventListener(SecurityErrorEvent.SECURITY_ERROR, removeCur); fileReference.save(myPDF.save(Method.LOCAL,"",Download.INLINE,"myPDF.pdf"),"map.pdf");
1061: Call to a possibly undefined method save through a reference with static type flash.net:FileReference
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.