Page 1 of 1

Problem in converting PDF to SWF from C#.Net webSite

Posted: Sat Jun 07, 2008 1:02 am
by ajaysoft

I want to convert a PDF file to SWF file from My webApplication Code.

This works fine of some computer, but doesnt create SWF file on some computers.

Code is as below.
string strPDFPath = HttpContext.Current.Server.MapPath("~/Test.pdf");
string strSWFPath = strPDFPath.Replace("Test.pdf", "Test.swf");

System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardError = true;

//p.StartInfo.WorkingDirectory = HttpContext.Current.Server.MapPath("~") + "//";
//p.StartInfo.FileName = HttpContext.Current.Server.MapPath("~/p2fServer.exe");
p.StartInfo.WorkingDirectory = "C:\\Program Files\\Print2Flash\\";
p.StartInfo.FileName = "C:\\Program Files\\Print2Flash\\p2fServer.exe";

p.StartInfo.Arguments = @"" + strPDFPath + " " + strSWFPath + " /ProtectionOptions:4";


I checked all the required settings/Permission on each Computer, like
1) Full Control to "EveryOne" user to Root folder
2) Write,Executable permision to Virtual directory
3) PrintSpooler Service is running
4) FlashPlayer is Installed
5) Acrobat Reader Is Intstalled

But even after all this settings, This code doesn't works on some computer.
If I create window application in and paste the same code, then it works fine in all computers.

Can anyone plz tell me that what could be the problem.

Ajay Dekavadiya

Re: Problem in converting PDF to SWF from C#.Net webSite

Posted: Fri Oct 17, 2008 5:36 am
by staff
You need to use Print2Flash Automation API and run it under different user account for conversion of documents from ASP.NET. The problem is many applications refuse to print documents under the user account used for running ASP.NET scripts.
You may find further information here:
- Automation API:
- Running automation objects under different user account: ... ccount.php

Also, Print2Flash SDK contains an ASP.NET/C# sample for this. The SDK can be downloaded from The ASP.NET sample is located in the Automation\Samples\ASP.NET folder of SDK archive.

Re: Problem in converting PDF to SWF from C#.Net webSite

Posted: Thu Jul 29, 2010 5:38 am
by sweeppicker
i'm facing the same problem. Tried these solutions but somehow they are not working properly.