Use Flashpaper online conversion. doc is. swf

Source: Internet
Author: User
Tags add object config copy iis net string version
Flashpaper is Macromedia launched an Electronic document class tool! By using Flashpaper, you can convert the document you need to a SWF-formatted Flash animation, and the original document's layout style and font display will not be affected, and the benefit is that no matter what the platform and language version of the other is, you are free to watch the electronic document animation that you make, And can be free to enlarge, shrink and print, paging and other operations!
The effect of the display is like Baidu's library viewing effect.
The use of Flashpaper I believe most people know that the demo here is for online conversion. doc files converted to. swf's Flash file.
The principle is to transform the file through the process instruction, so it involves the operation of the process,
The instructions that doc converts to a SWF file are:
"Flashpaper Execute file path input. doc file path-o output. swf file path"
Nonsense not much to say, the code is as follows:
Copy CodeThe code is as follows:
<summary>
Execution process
</summary>
<param name= "sourceFileName" > input. doc file path </param>
<param name= "OutputFileName" > output. swf file path </param>
public void Processexec (String sourcefilename, String outputfilename)
{
Flashpaper file installation path can be set by itself
String flashprinter = "F:\\flashpaper2.2\\flashprinter.exe";
Process PSS = new process ();
Pss. Startinfo.createnowindow = false;
Pss. Startinfo.filename = Flashprinter;
Pss. Startinfo.arguments = string. Format (' {0} {1} '-O {2} ', Flashprinter, sourceFileName, OutputFileName);
Try
{
Pss. Start ();
while (!PSS. hasexited)
{
Continue
}
System.Threading.Thread.Sleep (4000);
Response.Write ("succefull!");
}
catch (Exception ex)
{
Throw ex;
}
}
protected void Btntext_click (Object o, EventArgs e)
{
String Source = Server.MapPath ("~/files/doc.doc");
String output = Server.MapPath ("~/files/doc.swf");
Processexec (source, output);
}

where Flashpaper files in the demo Flashpaper folder,
The installation method is simple, copy the Flashpaper folder to the folder to be installed, and click Initialize the. bat file in the initialization folder to perform the installation (no virus, hehe, can be assured to install).

Demo Download: Click to download

Add here: Under the Server 2003 system, you may not be able to do this because of the reason that IIS restricts permissions to Office file operations, which can be referred to as a workaround:
ASP. NET Operations IIS permission configuration for Word
Asp. NET account does not have permission to manipulate Microsoft Office objects by default, and if no permissions are configured, the code throws an exception that resembles the following:
Retrieving a component with a CLSID of {00024500-0000-0000-c000-000000000046} in a COM class factory failed because the following error occurred: 80070005.
This poses a certain difficulty for ASP.net to manipulate Microsoft Office objects. But we still have to figure out how to do Office objects. Here is a brief introduction of the methods I have used in the development process:
Method 1: Configure the Web.config file to simulate the local system's account on each request.
Action: Add the following node to the Web.config file:
<identity impersonate= "true" Username= "AccountName" password= "password"/>
Where: username is to simulate the local account, password is the password of the account.
Method 2: In the DCOM configuration, configure the permissions for the IIS account to work with Word (as do other Office objects).
Specifically: Component Services (Component service)-> computer (Computers)-> My Computer (my Computer)->dcom configuration (DCOM Config)->microsoft Office Word 97-2003 Document, right-click Microsoft Office Word 97-2003 document, and choose Properties for two steps:
(1) On the Identity tab, select Interactive Users (the interactive user).
(2) On the Security tab, select Custom (Customer) for the first two groups (start and Activate permissions, access rights), and then click Edit to add the IIS account in the pop-up interface (the server version of the operating system is typically network SERVICES, other systems (XP) may be asp.net, and in the following permission box, assign all permissions to the user.
Method 3: Assign a local account to the ASP.net site application pool
How to: In IIS, create a new application pool for the ASP.net site, and then change the Identity tab of the application pool properties to select Local System (LocalSystem) for the predefined accounts.
If it is in IIS7.0, follow these steps: Create a new application pool for the ASP.net site. Select the application pool, advanced settings-> process mode-> identity: Select LocalSystem.
Of the above three methods, individuals prefer the third, because after the Word object is finished, the Word object's process needs to be closed, and the third method can leave the ASP.net application with permission to end the word process without other settings.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.