??xml version="1.0" encoding="utf-8" standalone="yes"?> 作者:(x)陈省 首先参考http://ria.dzone.com/articles/introduction-spring-
blazeds?page=0,2q篇文章Q这里我们用Spring Blazeds
Integration包来替代SpringFactory的解x案来实现Spring和BlazeDS的集? 1.首先修改Flex Builder3默认创徏的web.xml文g?/p>
1.1删除默认的MessageBroker Servlet 换成Spring的DispatcherServlet 注意QSpring加蝲MessageBrokerServlet的时候,?x)同时查找W(wng)EB-INF\MessageBrokerServlet-
servlet.xml文gQ添加WEB-INF\MessageBrokerServlet-servlet.xml文gQ内Ҏ(gu)加蝲spring?
xsd <?xml version="1.0" encoding="UTF-8"?> </beans> 删除默认的Flex Listener和上下文配置 <!-- Http Flex Session attribute and binding listener support --> 换成Spring的上下文和Spring用Filter <context-param> <filter-mapping> 1.2集成Spring的安全认?/p>
可以从http://coenraets.org/blog/2009/05/new-test-drive-for-spring-
blazeds-integration-rc1/下蝲Spring Blazeds
TestDrive集成包,查考里面的WEB-INF\config\web-application-security.xml文g 1.3开放Spring Bean提供lFlex Remoting使用Q修改testdrive的WEB-INF\config\web-application-config.xml内容?/p>
<?xml version="1.0" encoding="UTF-8"?> <bean id="UserService" class="com.sharpplus.UserService" > <!-- Expose the productDAO bean for BlazeDS remoting --> UserService Bean只有一个GetUserҎ(gu)Q返回一个Hello Blazeds的字W串 package com.sharpplus; public class UserService { 创徏Flex客户端界面,调用我们的UserServiceQ显C字W串信息 <?xml version="1.0" encoding="utf-8"?> JDBC for Google appengine 配置要求: 满上述服务器配|条?才能支持在线文档插g。豆丁网几乎和上q配|一栗?/p>
q里为啥要征求大家意见:(x) 现在我用的是FlashPaper2.0Q有一个插件可以控Ӟ但是是不知道怎么用?br />
FlashPaper2.0:http://www.onlinedown.net/soft/35842.htm q里有一文章好像也能实玎ͼ?,但我q是没有弄明白,有谁能译一下就好了 基本能实现控制按的打开和关闭了Q引?a >http://www.adobe.com/devnet/flas
...
mport_flpaper2.html上面的方面。但是新的问题出来了Q由于只是生成一个新的SWFQ引用以前的SWFQ新的SWF不能单独q行Q如?
单独q行只能是一个空白文档。所以,有没有好的办法能直接对原始的SWFq行控制Q或者能否实现新生成的新的SWF中本w就包含原始的SWFQ而不仅仅
是引用,有没有办法实玎ͼ请DX们指教?br />
举个例子Q?br />
我有一个原始的用FLASFHPAPER生成的SWFQFLASHPAPER.swf,?a >http://www.adobe.com/devnet/flas
...
mport_flpaper2.html的方法处理后Q去掉打华ͼ文本选择{按钮后Q生成一个新的SWF文gQFLASHPAPER-1.swfQ但新生
成的文g很小Q没有包含原始的FLASHPAPER.swfQ而仅仅只是引用。因此新生成的FLASHPAPER-1.swf不能独立q行Q必L
FLASHPAPER.swf和FLASHPAPER-1.swf在一h才能q行FLASHPAPER-1.swf。现在的问题是怎么实现新生成的
FLASHPAPER-1.swf能独立的q行Q就是说新生产的FLASHPAPER-1.swf文档要包含原始的FLASHPAPER.swfQ而不?
仅是引用?br />
求助各位DX了?/p>
q个问题已经d解决Q现在可以对SWFq行修改Q就是对FLASHPAPER的默认{换模板进行修改,然后控制打印Q文本复制等功能。对SWFq?
行反~译Q处理后解决?br />
现在用FLASHPAPER处理出来的DOC文档Q不再会(x)有打华ͼ文本复制Q等功能Q只可看Q只可浏览。利用在|页中的止保存、禁止打印、禁止右键等?
码,较好的实C文档的保护?/p>
FlashPaper修改很容?我这里都有现成修改好?去logo dh,部分工具屏蔽{模?需要的站内PM asp.net 调用 FlashPaper如何实现 有权限问题吗 ASP 调用 flashpaper p| 2、而ASP里执?WshShell.Run("I:\I:\FlashPaper\FlashPrinter.exe I:\1.doc -o
I:\1.swf " ,0,true)
|页开始出现反应慢。查看进E只有FlashPrinter.exe和macromedia的lisenceq程Q用户名均ؓ(f)iwamQ,未见
winword.exeq程。也没有文g生成?/p>
3、用另一ƾ{换工具pdf2swfQ通过ASPQ生成目标文件成功?/p>
4、怀疑ASP讉K时IWAN用户权限不够Q于是采用CPAU账户替换工具Q把IWAN替换成ADMINISTRATOR?
FlashPrinter.exe和macromedia的lisenceq程出现Q且用户名均为ADMINISTRATORQ但IE报错“应用E序初始
化错?#8221;?/p>
5、期间尝试无数次办法Q把IWAN、IUSR加入理l;虚拟打印机加入IWAN、IUSR所有权限,修改l策略等{等...均失败?/p>
请高手解?...... 另外W四条时Q没有文件生成?/p>
Unable to use sample code in php of sdk folder Unable to use sample code in php of sdk folder when I use the sample code index.php on my server, then i get an
error "Error writing file
/hsphere/local/home/akashnig/clickmydocs.com/PHP/uploadedfiles\investm.rtf". how can I use this sample code in my project on server to convert
files. ??? I want to use print2flash in my project, please provide the code for
this............. If any help regarding this....please provide.jai Re: Unable to use sample code in php of sdk folder You need to grant Read and Write permissions to the uploadedfiles and
convertedfiles folders for the user under which your web server runs
(for IIS it is usually IUSR_xxx) and for the user which credentials you
specified in the Print2Flash Service Configuration window. No, command line does not support URLs. The solution may be writing a
program for downloading and saving a page to disk, and then you can
convert that page to Flash using Print2Flash command line. http://www.lynchconsulting.com.au/blog/index.cfm/2007/2/22/Batch-Convert-PDF-files-to-Flash-Paper asp如何在服务器端调用winzip命o(h)行对上传的多个文件打?-asp~程技?br />
http://www.fansart.com/cweb/2006516174722.asp 写了2个小时的东东想了两天QPHP上传文gc? js调用可执行?exe)文g liujunpeng的个人空间_列表_PHPChina 开源社区门?- powered by .. FlashPapercd FlashPaperlg中文说明 http://www.mediamacros.com/item/item-1006687373/ If it's any help this is the code from my site which opens a document
(newsletter). <p class="smallCtrdTxt">This is a Flash document. You can see
some controls just above the document. The control just left of the
double arrow will open a new window or tab for full size
viewing.</p> 找h开?br />
http://forums.adobe.com/thread/170010?tstart=330 http://space.flash8.net/space/?376578/viewspace-308332.html php exec FlashPrinter有问?br />
http://zhidao.baidu.com/question/58766588.html CMD q行带参数的E序 WEB调用 如何lFlash Paper生成的SWF文gd一个弹出窗口按? 看这?/p>
直接在URL后面加参? PHP code .語法如下Q? If you've ever tried to load a FlashPaper document in Flex 2, then
you know it's not as straightforward as it was with Flex
1.5. Sure, you can just use an <mx:SWFLoader /> tag. But, if you've
tried this, you know it's pretty limited. You can't talk to the
FlashPaper document, and the loaded document gets stuck at a fixed size
or scales incorrectly when resized. If you try fiddling with the various
scaleContent and maintainAspectRatio settings, you'll quickly get
frustrated trying to achieve the perfect resize behavior. I've run into this problem in the Flex 2 application I'm currently
building. We're using ColdFusion to generate dynamic reports via the
<cfreport> tag, capturing the report output as FlashPaper, and
then loading the report output .swf directly into the Flex 2
application. I'm happy to say that I've solved the resize and
communication issues, and I've been given permission to post these on my
weblog from the client that I've written the code for. You
can download my Flex 2 FlashPaperLoader here. (.zip archive)
- MIT License There's a lot of interesting things going on the .zip file. In the
archive you'll find the following files: Note that the code is mostly complete but it is not a compile-ready
working example. You will need a few tweaks get it
working: You'll need to create a new Flex project named
"FlashPaperLoaderExample" out of the code in the flex subdirectory, copy
the flash/FlashPaperLoader.swf file to the Flex project's bin directory
so it lives along side of the Flex 2 output .swf, change the
"flashPaperURL" in the FlashPaperLoaderExample.mxml to point to a valid
FlashPaper document... and then you should be good to go. The example file contains an indeterminate progress bar that loads a
FlashPaper document full screen. The progress bar goes away when the
FlashPaper is fully loaded. Try resizing your browser window to see how
the loaded FlashPaper document resizes to fill the available space. The best way to understand what is going on is to just dive in and
take a look at the code. Start in FlashPaperLoaderExample.mxml, then
FlashPaperLoader.as, then look in FlashPaperLoader_code.as. Basically,
the concept is this: The FlashPaperLoader Flex control is used to load a Flash 8
ActionScript 2 FlashPaperLoader.swf file, generated from the
FlashPaperLoader.fla file. The FlashPaperLoader.swf file is passed the
URL of the FlashPaper document, as well as a unique identifier
(fpProxyId) and the object/embed name of the Flex client (swfDomId) -
"FlashPaperLoaderExample" in this case. The latter two parameters are
necessary for the communication mechanism between Flex and FlashPaper.
The loaded FlashPaperLoader.swf handles loading the FlashPaper document
and fosters communication between Flex 2 and FlashPaper. Communication is done through ExternalInterface. By leveraging
JavaScript, the ActionScript 3 code running inside of AVM2 can
communicate with the ActionScript 2 code running inside of AVM1. There
is no way for the two different VMs to talk directly, so JavaScript acts
as the middle man. So, if the Flex client needs to resize the FlashPaper document, it
calls a JavaScript method such as "APP.setSize82" where "82" is the
fpProxyId unique identifier and "APP" is the object/embed id/name
attribute of the Flex client embedded in the HTML page. The
FlashPaperLoader.swf file registers a handler for the JavaScript method
setSize82 with its own internal setSize method, so when the Flex client
invokes the JavaScript method, the FlashPaperLoader.swf file picks it
up. Then, in turn, the loader .swf just invokes the setSize method on
the loaded FlashPaper document passing in the appropriate width and
height. A similar process is used for going from FlashPaper to Flex 2. The reason the fpProxyId is needed is for when the Flex client loads
multiple FlashPaper documents. The Flex client needs to know that it's
calling a method on the appropriate FlashPaper target, so the id is used
to differentiate the different loaded loader .swf files. I know it sounds a little confusing, but everything is explained
inside of the source code. There are a few improvements that can be made to this code. One of
them is that I'm only exposing the "setSize" and "printTheDocument"
methods from the IFlashPaper
interface. Obviously, there are a lot more methods than that (but that
was all I've needed so far). Additionally, it might be a little cleaner
to use FlashInterface
for the communication between AVM1 and AVM2, but I wrote my code some
two months ago and didn't feel the need to change the basics of it since
it's been working flawlessly for me. Also, you might want to have the
FlashPaperLoader.swf proxy the percentage complete when loading a
FlashPaper document so the Flex 2 client can update the loaded progress
correctly. I hope that helps! I know a few people have been asking about this,
so hopefully my code will get things working for you as well. As I said,
I've been using this technique for awhile nowâ ¦ Good luck! Stage.align = "TL"; paper.setSize (Stage.width, Stage.height); http://hi.baidu.com/gacmotor/blog/item/09cb4b09975affda63d98608.html function hide_MMlogo_greentea () { hideBrandInterval = setInterval (hide_MMlogo_greentea, 1);
http://yifanxiang.blog.163.com/blog/static/5000083420106158206254/
http://www.licream.net/flex_spring_hibernate.html
http://aguu125.javaeye.com/blog/527970
]]>
在Google appegine上部|BlazeDS和SpringE序Q一Q?/h1>
?hubdog ?星期一, 2009-05-18 00:31 发表
<!-- MessageBroker Servlet -->
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<display-name>MessageBrokerServlet</display-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- MessageBroker Servlet -->
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<display-name>MessageBrokerServlet</display-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <context-param>
<param-name>flex.class.path</param-name>
<param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
</context-param>
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/web-application-config.xml
/WEB-INF/config/web-application-security.xml
</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex" xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.4.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<flex:message-broker/>
</bean>
<flex:remoting-destination ref="UserService" />
</beans>
public String getUser(){
return "Hello Blazeds";
}
}
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
private function onClick():void{
ro.getUser.addEventListener(ResultEvent.RESULT, onResult);
ro.getUser();
}
private function onResult(event:ResultEvent):void{
var s:String=event.result as String;
Alert.show(s);
}
]]>
</mx:Script>
<mx:Button x="257" y="193" label="Hello BlazeDS" click="onClick()"/>
<mx:RemoteObject id="ro" destination="UserService">
</mx:RemoteObject>
</mx:Application>
]]>
flex与spring集成的核心思想是让spring来管?MessageBroker。如何集成?可以ȝZ步?
1、首先,修改 web.xml文gQ将之前配置?MessageBrokerServlet LҎ(gu)spring的,
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/web-application-config.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
2Q新建文?web-application-config.xml
<?xml version="1.0" encoding="GB2312" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
<!-- Bootstraps and exposes the BlazeDS MessageBroker simplest form -->
<flex:message-broker id="_messageBroker"
services-config-path="/WEB-INF/flex/services-config.xml">
<flex:mapping pattern="/messagebroker/*" />
<flex:exception-translator ref="myExceptionTranslator" />
</flex:message-broker>
<!--
上面配置是一U简单配|,另外一U更单配|ؓ(f)Q?
<flex:message-broker/>
q有一U配|ؓ(f)Q?
<bean id="mySpringManagedMessageBroker"
class="org.springframework.flex.core.MessageBrokerFactoryBean">
<property name="servicesConfigPath"
value="classpath*:flex/services-config.xml" />
</bean>
-->
<!-- Maps request paths at /* to the BlazeDS MessageBroker -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/*=_messageBroker
</value>
</property>
</bean>
<!-- 下面q个Adapterg不用配置Q因为我注释后照样可以?-->
<!--
Dispatches requests mapped to a MessageBroker <bean
class="org.springframework.flex.servlet.MessageBrokerHandlerAdapter"
/>
-->
</beans>
3Q写remoting-config.xml 文gQ?
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</service>
到目前ؓ(f)止,flex已经跟spring集成C起了?
4、将spring的bean导出为flex的Destination。我们要在web-application-config.xml文g中增加?
有三U方式:(x)
W一U:(x)
<bean id="productService" class="flex.samples.product.ProductServiceImpl" />
<flex:remoting-destination ref="productService" />
W二U:(x)
<bean id="productService" class="flex.samples.product.ProductServiceImpl" >
<flex:remoting-destination />
</bean>
W三U:(x)
<bean id="product" class="org.springframework.flex.remoting.RemotingDestinationExporter">
<property name="messageBroker" ref="_messageBroker"/>
<property name="service" ref="productService"/>
<property name="serviceId" value="productService"/>
<property name="includeMethods" value="read, update"/>
<property name="excludeMethods" value="create, delete"/>
<property name="channels" value="my-amf, my-secure-amf"/>
</bean>
附g是一个例子工E,没有提供jarQ工E中所需要的jar
backport-util-concurrent.jar
cfgatewayadapter.jar
cglib-nodep-2.1_3.jar
commons-codec-1.3.jar
commons-httpclient-3.0.1.jar
commons-logging.jar
concurrent.jar
flex-messaging-common.jar
flex-messaging-core.jar
flex-messaging-opt.jar
flex-messaging-proxy.jar
flex-messaging-remoting.jar
jackson-lgpl-0.9.5.jar
org.springframework.flex-1.0.0.RC1.jar
spring2.5.6.jar
spring-webmvc.jar
xalan.jar
]]>
国外有高手已l实CIE览器内加蝲flashpaper,好像是这吧:
http://www.darronschall.com/weblog/2006/11/how-to-load-flashpaper-
documents-in-flex-2.cfm
q里在他的基础上改成利用LocalConnection来通讯,以便更好的处理来回的操作.
flex load
flashpaper也离不开flash,q个例子其实是用flash做一个空?比如命名FPload.swfq个壛_是用来加?
flashpapaer?里面实现了对flashpaper的大设|?~略?|讄{等,注意q个fpload.swf是flash8??
flex中加载就得利用LocalConnection(如果不明白的得自己去惛_法了解了)或者例子中的ExternalInterface?
fpload.swf通讯,去设|尺?大小,面{等
首先看flex3里面如何来加载flashpaper
//com.magReader.FlashPaperLoader.as
{
import flash.events.Event;
import flash.events.StatusEvent;
import flash.net.LocalConnection;
//import flash.system.System;
import mx.controls.SWFLoader;
/**
* UIComponent designed specifically to load FlashPaper documents
* and size them correctly in the available area.
*/
public class FlashPaperLoader extends SWFLoader
{
/**
* The id of the FlashPaperLoader.swf proxy that will be used
* for communication pyurposes.
*/
public static const FLASH_PAPER_LOADED : String = "flashPaperLoaded";
public static const FLASH_CONNERROR : String = "flashConnError";
private var sendFlashConn:LocalConnection;
private var recieveFlashConn:LocalConnection;
/**
* The name of the application that is loading in the FlashPaperLoader.swf
* file. This name must correspond to the "id" attribute in the object tag
* and the "name" attribute in the embed tag when the Flex client is embedded
* into the html page.
*/
/**
* Constructor
*/
public function FlashPaperLoader()
{
//source = "app-storage:/data/fpHolder.swf";
sendFlashConn=new LocalConnection();
recieveFlashConn = new LocalConnection();
recieveFlashConn.client=this;
sendFlashConn.addEventListener(StatusEvent.STATUS, onStatus);
sendFlashConn.allowDomain("*");
recieveFlashConn.allowDomain("*");
sendConn();
}
public function sendConn():void
{
try
{
recieveFlashConn.connect("_flexloader");
} catch (error:ArgumentError) {
trace("Can't connectthe connection name is already being used by another SWF");
onConnError();
return;
}
}
private function onStatus(result:StatusEvent) :void{
trace (result.level == "error"?"Operation failed":"Operation succeeded");
}
//q接源出?/span>
private function onConnError():void
{
//errUnload();
var e:Event=new Event(FlashPaperLoader.FLASH_CONNERROR);
dispatchEvent( e );
}
// =================================================================
// Expose methods that are proxied from FlashPaperLoader.swf - Call
// JavaScript methods that the FlashPaperLoader.swf file picks up
// and passes to the loaded FlashPaper document.
// =================================================================
public function setSize( width:Number, height:Number ):void
{
trace("=========setPaperSize=============");
sendFlashConn.send("_flashpaperloader","setPaperSize",width,height);
}
/**
* 文档加蝲成功提示
* */
public function fpLoaded():void
{
trace("reveice fpLoaded message!! this.width = " + this.width + " this.height" + this.height);
//setSize(parent.width,parent.height);
var e:Event=new Event(FlashPaperLoader.FLASH_PAPER_LOADED);
dispatchEvent( e );
//this.visible=true;
}
/**
* 讄~放
* */
public function setZoom(value:Object):void
{
if (this.visible)
{
sendFlashConn.send("_flashpaperloader","setCurrentZoom",value);
}
}
// override protected function updateDisplayList( unscaledWidth:Number,
// unscaledHeight:Number ):void
// {
// if ( contentHolder )
// {
// // Adjust values so the FlashPaper document is displayed correctly
// contentHolder.scaleX = 1.0;
// contentHolder.scaleY = 1.0;
// contentHolder.x = 0;
// contentHolder.y = 0;
//
// contentHolder.scrollRect = new Rectangle( 0, 0, unscaledWidth, unscaledHeight );
//
// // When the content has loaded, call the setSize method so that the
// // FlashPaper document sizes right in the available area
// if ( Loader( contentHolder ).content )
// {
// setSize( unscaledWidth, unscaledHeight );
// //this.setFocus();
// }
// }
// }
//卸蝲此swf
public function unload():void
{
if(sendFlashConn != null)
{
sendFlashConn.send("_flashpaperloader","unload");
sendFlashConn = null;
}
try
{
if(recieveFlashConn != null)
{
recieveFlashConn.close();
recieveFlashConn = null;
}
}catch(e:ArgumentError)
{
trace(e.toString());
recieveFlashConn = null;
}
unloadAndStop(true);
//System.gc();
}
public function errUnload():void
{
if(sendFlashConn != null)
{
sendFlashConn.send("_flashpaperloader","unload");
sendFlashConn = null;
}
if(recieveFlashConn != null) recieveFlashConn = null;
unloadAndStop(true);
//System.gc();
}
} // end class
} // end package
]]>
<!--l version="1.0" encoding="utf-8-->
<!--[CDATA[
import com.magReader.FlashPaperLoader;
//flashpaper加蝲?/span>
private var magReader:FlashPaperLoader;
private function initType():void
{
var urlStr:String = "Fpl.swf?url=template.swf";
magReader = new FlashPaperLoader();
magReader.source = urlStr;
magReader.visible = false;
magContainer.addChild(magReader);
//loadingBar.visible = true;
magReader.addEventListener(FlashPaperLoader.FLASH_PAPER_LOADED,fpLoaded);
}
//flashpaper已经加蝲完成
private function fpLoaded(evt:Event):void
{
//trace("magContainer width = " + magContainer.width + " magContainer height = " + magContainer.height);
magReader.setSize(magContainer.width,magContainer.height);
magReader.visible = true;
//loadingBar.visible = false;
//Lq度?br />
//magContainer.removeChild(loadingBar);
//删除事g侦听
magReader.removeEventListener(FlashPaperLoader.FLASH_PAPER_LOADED,fpLoaded);
}
/**
*
* 改变容器昄大小
* */
public function changSize():void
{
if(magReader != null)
{
magReader.setSize(magContainer.width,magContainer.height);
}
}
]]-->
import flash.display.Stage;
Stage.align = "LT";
//Stage.scaleMode = "showAll";
var url = "template.swf";
var fp;
//localConnection通讯接口
var caller:LocalConnection = new LocalConnection();
var sender:LocalConnection = new LocalConnection();
caller.connect("_flashpaperloader");
caller.allowDomain("*");
sender.allowDomain("*");
Security.allowDomain("*");
//讄面
//caller.setPage = function(n:Number)
//{
//fp.setCurrentPage(n);
//}
//讄大小
caller.setPaperSize = function(w:Number,h:Number)
{
trace("fpLoader width=" + w + " height =" + h) ;
fp.setSize(w,h);
}
//讄~放
//caller.setCurrentZoom = function(zoom:Object)
//{
//fp.setCurrentZoom(zoom);
//sendCurrentZoom();
//}
//讄下一?br />
//caller.nextPage = function()
//{
//var p:Number = fp.getCurrentPage();
//if(p + 1 <= fp.getNumberOfPages())
//fp.setCurrentPage(p + 1);
//}
//讄上一?br />
//caller.prePage = function()
//{
//var p:Number = fp.getCurrentPage();
//if(p - 1 > 0)
//fp.setCurrentPage(p - 1);
//}
//卸蝲
caller.unload = function()
{
caller.close();
caller = null;
sender = null;
fp.destroy();
fp = null;
unloadAndStop();
paper.unloadMovie();
paper = null;
}
// function: loadFlashPaper
// ------------------------
// Load FlashPaper document, size it,
// Parameters:
// path_s: Path of SWF to load
// dest_mc: Movie clip to hold the imported SWF
// width_i: New size of the dest MC
// height_i: New size of the dest MC
// loaded_o: (optional) Object to be notified that loading is complete
function loadFlashPaper(path_s, dest_mc, loaded_o) {
var intervalID = 0;
var loadFunc = function(){
trace("加蝲开?img src="http://www.aygfsteel.com/Images/dot.gif" alt="" />.");
dest_mc._visible = false;
fp = dest_mc.getIFlashPaper();
if (!fp) {
return;
} else if (!fp.setSize(0,0)){
trace("没有讄H口大小");
return;
} else {
trace("flashPaper加蝲成功?/span>");
clearInterval(intervalID);
//var pages_i = fp.getNumberOfPages();
//paper.toolbar_mc.brandClip_mc.swapDepths(1000);
//paper.toolbar_mc.brandClip_mc.removeMovieClip();
//ctrlHolder_mc.swapDepths(_root.control_mc);
dest_mc._visible = true; // Now show the document
//_root.control_mc._visible = true; // Now show the controller
loaded_o.onLoaded(fp);
}
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
// function: onLoaded()
// ------------------------
// Called once loading is complete
// Parameters:
// fp: FlashPaper interface (returned by getIFlashPaper())
function onLoaded() {
// We can now call the FlashPaper API functions.
// Remove the standard user interface features:
//fp.showUIElement("PrevNext", false);
fp.showUIElement("Print", false);
//fp.showUIElement("Find", false);
//fp.showUIElement("Tool", false);
//fp.showUIElement("Pop", false);
//fp.showUIElement("Zoom", false);
//fp.showUIElement("Page", false);
//fp.showUIElement("Overflow", false);
//fp.enableScrolling(false);
// Some additional API features (here commented out):
fp.setCurrentZoom(100);
//sendCurrentZoom();
sender.send("_flexloader","fpLoaded");
}
// Hide the navigation controller until after the document is loaded:
//_root.control_mc._visible = false;
// Create movie clip to hold the document:
var paper = this.createEmptyMovieClip("paper",100);
// Create movie clip to exchange the depth with the navigation controller clip:
//var ctrlHolder_mc = this.createEmptyMovieClip("ctrlHolder",200);
// Position the document clip on the stage:
paper._x = 0;
paper._y = 0;
// Load the FlashPaper document:
loadFlashPaper(url, paper, this);
]]>
1、服务器必须是windowspȝ
因ؓ(f)本插件必能doc、xls、docx、ppt、txt、pdf{等文档打开才可以,因ؓ(f)q些文档只支持windowspȝQ所有必L务器?
windowspȝQ而且必须安装office和pdf阅读器?br />
2、php必须支持exe函数调用Q因为首先要文档打开然后打印成flash格式Q?br />
3、服务器必须支持虚拟打印功能
4、服务内存需要够大Q因为打印的时候要占用原有的内存(最低ؓ(f)2-4GQ;
1、一斚w目前本插件在本服务器上测试OKQ因Z只是在编辑器上添加一个调用按钮,未与论坛程序完全整合,也就是说他的原理为,在编辑器上添加一个在
U文档按钮,然后跛_一个单文g上传pȝQ上传完成后Q自动调用打印程序,打印完成后将flash的地址通过媒体标签的Ş式传递到输入框,~辑帖子完成?
xC文档flash
2、由于上q原理,如果真正的想和论坛程序深度整合的话,必须重写代码Q与论坛的附件上传整合到一P
3、由于服务器配置的局限性,可能需求的不多Q所以,惛_求大家意?/p>
有谁知道FlashPaper?word to htm有问题要h高手?
http://bbs.blueidea.com/thread-2781866-1-1.html
我有一些DOC文档要放在网上,但有Ҏ(gu)的格式,不能直接转换成HTMLQ用FlashPaper转换成SWF后,׃有Macromedia的LOGO
?qing)打华ͼ攑֤Q文本选择{一些工P不能很好的保护文档,因此Q想LLOGO?qing)打华ͼ攑֤Q文本选择{工P也知道FlashPaper的控制函敎ͼ?
׃可实在太菜Q也不知道怎么用,请DX多指教?br />
另,有没有好的办法,SWF嵌入HTML后,通过~辑HTML来调用FlashPaper的控制函数来实现打印Q放大,文本选择{按钮的打开和关闭?
万分感谢?/p>
插gQ?a >http://www.digitalflipbook.com/a
... ashpaper_comp_4.php
请高手回{,在此谢过?/p>
http://www.adobe.com/devnet/flas
... mport_flpaper2.html
http://topic.csdn.net/u/20081015/12/ef971788-d3e1-45e2-95a4-03565c917f05.html
1、CMD里执?I:\I:\FlashPaper\FlashPrinter.exe I:\1.doc -o I:\1.swf
。I盘根目录下成功生?.swf
期间q程出现?winword.exe、FlashPrinter.exe
、还有一个macromedia的lisenceq程。用户名为ADMINISTRATOR。命令执行完Q均自动关闭?/p>
问题补充QWshShell.Run("I:\FlashPaper\FlashPrinter.exe I:\1.doc -o I:\1.swf "
,0,true),刚才写错了?/p>
命o(h)行调用FlashPaper Command Line Conversion
FlashPrinter.exe 2008q数据业务中心ITpȝ现状以及(qing)规划汇报080508.ppt -o 200808.swf
http://print2flash.com/forum/viewtopic.php?f=4&t=58
by jai on Fri Feb 29, 2008 12:39 am
Posts: 1
Joined: Wed Feb 27, 2008 6:19 am Top
--------------------------------------------------------------------------------
by staff on Wed Mar 05, 2008 4:21 am
Command Line failed in ASP
http://print2flash.com/forum/viewtopic.php?f=4&t=86
http://farflight.blog.sohu.com/53196006.html
http://blog.sina.com.cn/s/blog_5ca9fdd80100bdh1.html
http://www.phpchina.com/html/23/6123_type_blog_view_track.html
http://yourpalmark.com/downloads/flash/components/FlashPaper_doc.html
<div class="flashDoc"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,
19,0" width="100%" height="100" title="August Newsletter">
<param name="movie" value="images/docs/newsletterAugust07.swf" />
<param name="quality" value="high" />
<embed src="images/docs/newsletterAugust07.swf" quality="high"
pluginspage="
</object></div>
http://zhidao.baidu.com/question/129685919.html?si=8
于老師教室a論?: 觀看文? FlashPaper 轉換的檔案,如何嵌入?
http://203.208.37.132/search?q=cache:JM280Bxa4moJ:yunol.stes.tc.edu.tw/phpBB2/viewtopic.php%3Fp%3D27422%26sid%3D19c50e3736c5d28bc26ff188850fed12+php+flashpaper+%E4%BB%A3%E7%A0%81&cd=30&hl=zh-CN&ct=clnk&gl=cn&st_usg=ALhdy2_zM4XAz6LykBkw9PqDMznZSy_DYA
http://www.dengjie.com/temp/tiger_book.swf?POPUP_ENABLED=true
$exstr = "D:\\FlashPaper\\FlashPrinter.exe D:\\11.doc -o
D:\\output1.swf";
exec($exstr);
在Flash中用FlashPaper API
http://www.happycampus.cn/docs/959266665903@hc09/154235/
代碼:
<embed height="993" width="700" quality="high"
type="application/x-shockwave-flash" src="
http://www.adobe.com/support/documentation/en/flashpaper/2/flashpaper_api/flashpaper_api3.html
interface FlashPaper.IFlashPaper
{
function addListener(listener:Object):Void;
function removeListener(listener:Object):Void;
function getViewerType():String;
function getViewerVersion():Number;
function getCurrentPage():Number;
function setCurrentPage(pageNumber:Number):Void;
function getNumberOfPages():Number;
function getLoadedPages():Number;
function showUIElement(part:String, flag:Boolean):Void;
function printTheDocument():Boolean;
function setCurrentZoom(percent:Object):Void;
function getCurrentZoom():Number;
function setSize(w:Number, h:Number):Boolean;
function goToLinkTarget(linktarget:String, window:Object):Void;
function enableScrolling(flag:Boolean):Boolean
function getCurrentTool():String;
function setCurrentTool(tool:String):Boolean;
function getTextSelectionRange():FlashPaper.SelectionRange;
function setTextSelectionRange(sel:FlashPaper.SelectionRange,
skipBroadcast:Boolean):Void;
function getSelectedText():String;
function getSidebarWidth():Number;
function setSidebarWidth(w:Number):Void;
function getFindText():String;
function setFindText(s:String):Void;
function findNext():Boolean;
function getVisibleArea():Object;
function setVisibleArea(area:Object, skipBroadcast:Boolean):Void;
};
]]>
]]>
Stage.scaleMode = "noScale";
function hideBrand () {
if (paper.gMainView.m_numPagesLoaded) {
paper.toolbar_mc.brandClip_mc.swapDepths(1000);
paper.toolbar_mc.brandClip_mc.removeMovieClip();
paper._x=0;
paper_y=0;
paper.setSize (Stage.width, Stage.height);
clearInterval (hideBrandInterval);
}
}
createEmptyMovieClip ("paper", 1);
paper.loadMovie ("hdywsc.swf");
//止内容~放
fullscreen = new Object();//创徏c?br />
fullscreen.onResize = function() {//swf大小改变时触?br />
paper._x=0;
paper_y=0;
//和左对?
//paper._x = Stage.width-300;//Ҏ(gu)Stage.width和Stage.height获得的舞台的宽和高来调整昄
//paper._x=System.capabilities.screenResolutionX;
//paper_y=System.capabilities.screenResolutionY;
};
Stage.addListener(fullscreen);
hideBrandInterval = setInterval (hideBrand, 1);
]]>
if (paper.gMainView.m_numPagesLoaded) {
paper.toolbar_mc.brandClip_mc.swapDepths(1000);
paper.toolbar_mc.brandClip_mc.removeMovieClip();
paper.setSize (640, 600);
clearInterval (hideBrandInterval);
}
}
]]>
我们可以一?FlashPaper 文档插入?Flash?FLA 源文件中。当?FLA 文g导出?
SWF 文gӞFlashPaper SWF文g׃(x)嵌入到导出的SWF 文g中?
下面的代码显CZ一个普通的Flash FLA 文g是如何?loadFlashPaper() 函数?
入一?FlashPaper SWF 文档的?
function loadFlashPaper(
path_s, // path of SWF to load
dest_mc, // MC which we should replace with the SWF
width_i, // new size of the dest MC
height_i, // new size of the dest MC
loaded_o) // optional: object to be notified that loading is complete
{
var intervalID = 0;
var loadFunc = function()
{
dest_mc._visible = false;
var fp = dest_mc.getIFlashPaper();
if (!fp)
return;
if (fp.setSize(width_i, height_i) == false)
return;
dest_mc._visible = true;
clearInterval(intervalID);
loaded_o.on
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
下面的代码显C已l嵌入一个FlashPaper SWF文档后如何?loadFlashPaper() ?
数?
function on
{
// loading is complete, so we can now adjust the current page, zoom,
etc.
// go to page 50.
fp.setCurrentPage(50);
// change magnification to 33%
fp.setCurrentZoom(33);
}
loadFlashPaper("FlashPaper.swf", theDocMC, theDocMC._width,
theDocMC._height, this);
其中 fp.setCurrentPage D讄?50Qfp.setCurrentZoom D讄?33Q当 FLA
文g被导出时Q嵌入的 FlashPaper SWF文g?33%的放大倍率在导出的 SWF 文g中出现?
Flash Paper 2 生成的SWF可以通过AS载入到Flashq中用APIq行控制,如下:
createEmptyMovieClip("fPaper", 0);
var my_mcl = new MovieClipLoader();
myListener = new Object();
my_mcl.addListener(myListener);
my_mcl.loadClip("FlashPaper.swf", fPaper);
myListener.on
{
on
{
fPaper.showZoomUI(false);
fPaper.showPrintUI(false);
fPaper.setCurrentZoom("width");
fPaper.setCurrentPage(2);
delete on
}
}
Flash Paper 2 API:
FlashPaperlg- -完整的APi
2009q?2 ?4?星期?14:18
它可以蝲入由FlashPaper2.0生成的SWF文gQ?而且提供了一pd讄的函
敎ͼ实在是不可多得的好东西!现在推荐下!
下蝲包含lg说明Q英文)
lg说明Q英文)
下面是我译的部分组件说明(F(tun)lash Paperc)可用?
ActionScript 1.0; Flash Player 6
属性摘?
属?说明
documentPath:String FlashPaper文g的\?
borderThickness:Number Ҏ(gu)宽度.
borderColor:String Ҏ(gu)颜色.
UIElements:Object 外观元素的可见?
currentZoom:Object 默认~放比例.
width:Number FlashPaper文g的宽?
height:Number FlashPaper文g的高?
UIElements属性的囄
事g摘要
事g 说明
on
文g已开始下载文件时调用.
on
bytesLoaded:Number, bytesTotal:Number) {} 每当FlashPape文g写入盘?
调用.
on
FlashPape文g完全下蝲时调?
on
FlashPape文gW一帧上的动作时调用.
on
errorCode:String) {} 当FlashPape文g未能加蝲时调?
on
文g已经昄时调?
on
文g时调?
on
newPageNumber:Number) {} 当FlashPape文g页时调?
on
percent:Number) {} 当FlashPape文g~放时调?
on
文g的文字被选择时调?
on
newTool:String) {} 当更换FlashPape文g?工具时调?
on
enable:Boolean) {} 当FlashPape文g滚动时调?
on
FlashPape文g的哭件区域变化时调用.
Ҏ(gu)摘要
Ҏ(gu) 说明
load(path:String) : Void 载入一个FlashPape文g.
destroy() : Void 卸蝲FlashPape文g.
move(x:Number, y:Number) : Void UdFlashPapelg).
toString() : String q回lg的名U?
getIFlashPaper() : FlashPaper.IFlashPaper q回一个实现IFlashPaper接口
的对?
如果q个函数未定?那么载入的SWF文g不是一个FlashPaper 2.0文g.
如果q个函数存在,但是q回null或undefined,那么载入的SWF文g是一?
FlashPaper 2.0文g,但是q没有蝲入够的内容d现这个API;你必ȝ待蝲
入够的内容q且再次调用?
getViewerType() : String q回一个描q包?SWF文g的接口的cd的字W串.
q个Macromedia FlashPaper标准阅读器Lq回Macromedia FlashPaper
Default Viewer.
getViewerVersion() : Number q回一个标识这个文件接口版本代h?
q回的整C是连l的,但是q个整数昄阅读器最q的版本 ,而且可以昄?
错或增强的功?
比如FlashPaper 2.01q回 218.
getCurrentPage() : Number q回当前|(与工h昄的相?.W一|
1.
setCurrentPage(pageNumber:Number) : Void 讄当前|.需要保证此|?
昄?但不必调节羃?
getNumberOfPages() : Number q回文g总页?
注意: 也许不是所有的都是可昄? 屈就于连接速度.
getLoadedPages() : Number q回当前载入的页?可显C的).
q个数g定在0到getNumberOfPages()之间.
?
getLoadedPages() == getNumberOfPages()
?q个文g便完全蝲?
showUIElement(part:String, flag:Boolean) : Void 应藏或者显CFlashPaper
文g外观的部?区分大小?
"PrevNext" 前一和后一|钮的隐藏或显C?
注意: 如果q些按钮是隐藏的,当前|字框回失?但不?x)隐?
"Print" 打印按钮的隐藏或昄.
"Tool"所有工具选择按钮的隐藏或昄.
"Zoom" 所有所放控制按钮的隐藏或显C?
"Find"文字搜烦框的隐藏或显C?
"Pop" 在浏览器中打开文g按钮的隐藏或昄.
"Sidebar"Ҏ(gu) (昄文gҎ(gu))按钮的隐藏或昄.
注意: q个变量无论q个文g是否包括Ҏ(gu)i; 没有Ҏ(gu)的文件从不显C?
按钮.
"Page" 当前和总页数按钮的隐藏或显C?
"Overflow" 出菜单的隐藏或昄.
注意:q个菜单仅在工具条太狭窄而不能显C时;你不能用q个变量强制昄?
?
"ZoomKeys" q个参数不媄响外?他控制是否能用快捷键所放文?例如,
+, -, p, w).
"Brand" 品牌按钮的隐藏或昄.
"Close" 关闭按钮的隐藏或昄.
traceUIElements() : Void 输出UI Elements的可见?
printTheDocument() : Boolean 模仿用户单击{应按钮. 在调用函数前,文g?
d全蝲?
getCurrentZoom() : Number q回当前~放水^.
注意: ~放水^Lq回一个数值r;不会(x)q回面宽度.
setCurrentZoom(percent:Object) : Void 讄当前~放水^.你可以传入一?
数值指C所攄分比 (例如, 100表示100%)..你也可以传入一个字W串
"width"适合面宽度,或者传入字W串 "page"适合到页.
setSize(w:Number, h:Number) : Boolean 讄lg的显C排?单位是象?
如果成功讄则返回true,不成功则q回false.
goToLinkTarget(linktarget:String, window:Object) : Void 触发锚点或URL
q接h.
如果传入的字W串是锚点名U?foo,当前视图?x)移动到那个锚?window参数
?x)被忽?如果foo不是一个有效的锚点名称,则不?x)执行动?对于其它的字W?
??x)执行getURL(linktarget, window) (想了解更多的信息,误
ActionScript文档).
enableScrolling(flag:Boolean) : Boolean L用户滚动文g.当滚动被止
?
滚动条不可用,但是可见.
滚动按钮不可?
使用鼠标滚轮滚动不可?
getCurrentTool() : String q回当前zd的工?如果没有zd的工?则返?
I字W串.以下是现在支持的?
"" (没有工具)
"pan" (手Ş工具)
"select" (文字选择工具)
setCurrentTool(tool:String) : Boolean 讄zd工具.如果参数错误或者该
工具不可用则q回false.以下是现在支持的?
"" (没有工具)
"pan" (手Ş工具)
"select" (文字选择工具)
getTextSelectionRange() : FlashPaper.SelectionRange q回一个描q当前?
择文字的对象.如果没有选择文字,则返回null.
注意:与getVisibleArea()q回的对象不?q个函数Lq回一?
FlashPaper.SelectionRange,q是一个明定义的对象, 你可以检?分解或?
构造一个新的对?
setTextSelectionRange(sel:FlashPaper.SelectionRange,
skipBroadcast:Boolean) : Void 选择特定的文?你可以传入null,从而取?
选定所有的文字.无效的范?没有面)?x)被省?它允怽讑֮范围 ?C
个很大的?例如999999,从而选定所有文?.如果skipBroadcast是false (?
未定?, ?x)广播on
?x)广播on
注意:与getVisibleArea()q回的对象不?q个函数Lq回一?
FlashPaper.SelectionRange,q是一个明定义的对象, 你可以检?分解或?
构造一个新的对?
getSelectedText() : String 以Unicode~码的字W串q回选择的文?如果?
有被选择的文??x)返回空字符?
getSidebarWidth() : Number q回其他按钮的宽?
没有Ҏ(gu)的文件会(x)q回0.
setSidebarWidth(w:Number) : Void 讄其他按钮的宽?
传入0从而完全隐藏其他按?
没有Ҏ(gu)的文件会(x)忽视调用.
getFindText() : String 以Unicode~码的字W串q回查找的文?
setFindText(s:String) : Void 讄文字查找框的文字.
q个函数不会(x)执行查找操作或改变当前选择.
findNext() : Boolean 查找文字查找框中输入的文?
从当前选择文字的后面开始查?
要从文档的开头查?请先调用setSelectionRange(null).
如果扑ֈ了文?调用getTextSelectionRange()q回详细的范?
getVisibleArea() : Object q回描述文档当前可见区域的对?q回的对象有
如下作用:
传入setVisibleArea().
q个可以用来在不同的计算Z观看同一文档,而且可以保持同步.
与先前getVisibleArea()q回的对象进行比?试可见区域是否改变.
q回的对象应该被认ؓ(f)是封闭的数据l构.不要试图分解q回的对?因ؓ(f)在将
来的版本中内容的格式可能不同.
q个对象唯一不变的方法是:
function equals(that:Object):Boolean;
我们可以用它比较两个可见区域是否相同.
setVisibleArea(area:Object, skipBroadcast:Boolean) : Void 调节当前可见
的页/~放/滚动从?匚wl定的区域对?
如果skipBroadcast是false (或未定义), ?x)广播on
如果skipBroadcast是true, 则不?x)广播on
传入的对象必L先前由getVisibleAreaq回的对?
不要试图创徏你自q对象,因ؓ(f)在将来的版本中内容的格式可能不同.
]]>
在此之前我已l找q很多国外的文章Q很多h都碰到类似的情况
是通过asp.net 调用服务器上的FlashPrinter.exe E序,(q个E序可以通过虚拟打印机把所有可打印的文件{换成swf文g)
我这里是通过Processc调用的
CMD的命令式q样?
xxx\\xxx\\FlashPrinter.exe "d:\\1.txt" -o "d\\1.swf"
我在服务器上直接输入上面命o(h)行正常运?
但是通过web 也就是Network Services用户l调用就没有正常输出文gQ?
我调试过可以正常调用FlashPrinter.exe q程,但就一直没有输出文?
我曾l从新安装新的window2003用于试
W一ơ我用了好几个小时去?
1.IIS权限
2.用户l权?
3.本地{略
4.打印机权?
我忘C是搞了那些东西,不知不觉可以通过asp.net 正常使用那个功能.
后来我ؓ(f)了再ơ测试,我把pȝq原了,l果我怎么在设|也不能正常调用那个功能?
在此之前已经讄q很多东西上面所说的是我不知道怎么栯|就可以q行?
PS:我nҎ(gu)好几台机器,有些是正常的Q有些就是一直烦着..查看事g日志说是已经成功转送打印命令,但就是打印的字节Cؓ(f)0
xpdf转换成swf文gQ就在asp.net后台代码中启动了flashpaperq程Q但同样的代码在winxp下,好用。但?
win2003下,׃好用了。代码如下:(x)
public static void ConvertPdfToSwf(HttpRequest reqeust, String
styFileName, String[] dataFileNames, String outputFileFullName)
{
try
{
String flashPrinter =
String.Concat(AppDomain.CurrentDomain.BaseDirectory,
"FlashPrinter.exe");//FlashPrinter.exe
System.Diagnostics.ProcessStartInfo startInfo = new
System.Diagnostics.ProcessStartInfo(flashPrinter);
if (String.IsNullOrEmpty(outputFileFullName))
{
return ;
}
Int32 intLastDot =
outputFileFullName.LastIndexOf(".");
//*********Temp
Programming****************************************
Int32 intLast = outputFileFullName.LastIndexOf("\\");
String path = outputFileFullName.Substring(0,
intLast);
String tempFileName = path + "\\PdfToSwf20080923.pdf";
//*****************************************************************
String swfFileName = String.Concat(path,
"\\PdfToSwf20080923.swf");
startInfo.Arguments = String.Concat(tempFileName, " -o
", swfFileName);
System.Diagnostics.Process process = new
System.Diagnostics.Process();
process.StartInfo = startInfo;
Boolean isStart = process.Start();
process.WaitForExit();
process.Close();
}
catch(Exception ex)
{
throw ex;
}
最q用AS3写一些项目,在编E过E中Q遇C问题,同时也有一些收获和心得。现在脓(chung)出来希望对大家在AS3~程有一些帮助。如果你发现有说得不对的地方Q你可以指出来,大家一h讨论?br />
1、AS3的强制类型{?br />
我之前一直以为是没有q个功能的,而最q在看一些文档,发现q个功能是有的。目前ȝ下来有两U写法:(x)
var loader:URLLoader = URLLoader(event.target);
不知道这U写法是借鉴那种~程语言Q反正我没有见过?br />
补充q个语法说明Qhttp://livedocs.adobe.com/flash/8_cn/main/00001211.html
var loader:URLLoader = event.target as URLLoader;
q种写法是借鉴VB.Net~程语言Q唉QAS3语法真得一个大杂烩?br />
2、URLStream和URLLoader
URLStream在文本文件数据方面可以支持多U字W编码?br />
URLLoader在进q测试后Q发现除UTF-8字符~码外,其他字符~码读过来的数据都是q?br />
可通过ByteArray对象字符~码转换(感谢abc12hjc提供补充代码)Q?br />
public class MoxieAS extends Sprite
{
public function MoxieAS ()
{
var stream:URLStream = new URLStream;
stream.addEventListener(Event.COMPLETE, complete);
stream.load(new URLRequest("ttt.xml")); // <root><a /><b /><c /></root>
}
private function complete (event:Event):void
{
var stream:URLStream = event.target as URLStream;
var xml:XML = XML(stream.readUTFBytes(stream.bytesAvailable));
trace(xml.*.length()); // output 3
}
}
具体用那个方式就看实际功能需求了?br />
3、URLRequest
URLStream、URLLoader、Loader{读取外部数据的c,里的loadҎ(gu)参数值是URLRequest对象。我在编E过EL喜欢直接写地址字符Ԍ原来?fn)惯改过来看样子要花?gu)间了?br />
4、Loader
在用Loader来加载数据时Q添加侦听事件时Q注意一定要lLoader?contentLoaderInfo属性增加事Ӟ而不是给Loader对象增加事g。我是因ؓ(f)加错对象Q关键是~译时还没有报错Q,郁闷得差点要把电(sh)脑给扔了?br />
错误写法Q?br />
var loader:Loader = new Loader();
loader.addEventListener(Event.COMPLETE, completeHandler);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
正确写法Q?br />
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
5、Loader加蝲q来的数据类?br />
此信息来自〖闪无忧?br />
查看原网址:http://www.5uflash.com/Html/as3/22474444.html