## Document to Flash/SWF and HTML5/SVG Format Conversion Sample in ASP.NET/C#

### Sample function:

This sample folder contains two samples:

1. ASP.NET document to Flash/HTML5 conversion web page. It accepts an uploaded document, converts it to Flash and HTML5 and shows the converted documents in the browser.
2. ASP.NET web service providing programmatic service for conversion documents to Flash. The web service exposes two methods:
   - ConvertStreamToStream - accepts a document as a byte stream and returns converted Flash document also as a stream;
   - ConvertStreamToUrl - accepts a document as a stream and returns URL to the converted Flash document which is stored on the server.
   Using this web service it is possible to implement a separate server performing conversion and make calls to that server from other computers. This can be useful if you need to break your application into client and server parts, your application that needs document to Flash conversion service running on one computer while conversions performed on another. The application may even run on another platform such as Linux, Macintosh, Flex, Flash, Java, etc. The only platform requirement is ability to make web service calls.
   PHP web service client sample which is also contained in this SDK can make calls to this web service (the sample is located in the Automation\Samples\PHP\WebService folder). You may run this sample on any platform which is supported by PHP.
   The sample includes an ASP.NET web page for calling the web service. It accepts an uploaded document, converts it to Flash using the web service and shows the converted Flash document in the browser.

The samples use Print2Flash OLE Automation.

### Installation instructions:

1. Configure Print2Flash Service:
   1. Launch Print2Flash Printing Application by clicking All Programs/Print2Flash/Print2Flash Printing Application in Windows start menu
   2. Click Options/Print2Flash Service Configuration
   3. Click Change Service Account and enter the name and the password for the user account under which you would like document conversion to take place. This may be the user account you use to login to Windows. User name should be specified in Domain\User format e.g. "WebDomain\p2fuser". If your computer is not on a domain, specify your computer name in Domain part
   4. Check "Grant access and launch permissions to Everyone" checkbox and click OK
2. Configure Internet Information Services (IIS):
   1. Create a virtual directory or a web site in IIS
   2. Copy the contents of the sample folder to the directory mapped to the virtual directory or root web site directory you created earlier
   3. Grant Read and Write permissions to the uploadedfiles, convertedfiles and WebServiceTemp folders for the user under which ASP.NET runs (usually NETWORK SERVICE or ASPNET) and for the user which credentials you specified at step 1c

### Usage instructions:

#### 1. Document to Flash/HTML5 conversion web page

1. Open the sample page in the browser by navigating to Default.aspx page
2. Click Browse and select a document to convert
3. If needed, set any options below responsible for the controls that will appear in the converted document
4. Click Convert. The conversion should take place and the converted document should be shown in the browser after conversion is completed
5. To convert another document, repeat steps 2-4

#### 2. Web service

1. Open the web service testing page in the browser by navigating to webservice.aspx page
2. Click Browse and select a document to convert to Flash
3. Choose web service method with which you want to convert the document
4. Click Convert. The conversion should take place and the converted document should be shown in the browser after conversion is completed
5. To convert another document, repeat steps 2-4

Copyright (C) Print2Flash Software. All rights reserved | www.print2flash.com