# How to call PPT to SWF converter from ASP.NET code?

Hello,

I decided to try your PPT to SWF converter. I downloaded the Trial and tried it on my PC. When I call the command from my .Net application it asks me if I want to buy the full version. The conversion of PPT worked here.
Then I tried it on a server, where it froze on executing the command. It didn't show the question popup. I think the reason for freezing is not showing the popup, so I cannot click anything and it cannot continue. Am I right and is there an option to try it on my server? I want to try it, before buy.

Thanks,
=============================================

Best wishes for you,

VeryPDF
=============================================
The application is uploaded on IIS site and is accessed from remote computer. Which should start as admin?
=============================================
Please by following steps to try again,

http://www.verydoc.com/exeshell.html

2. Please use following code to call pptconv.exe from PHP or ASP code,

ASP code,
<%
Set comEXEShell = Server.CreateObject("exeshell.shell")
comEXEShell.RunCommandLine "Administrator", "123456", "C:\pptconv.exe -$XXXXXXXXXXXXXXXXXXX ""C:\in.ppt"" ""C:\out.swf""" Set comEXEShell = Nothing %> PHP code, <?php$PdfCreator =new COM("exeshell.shell") or die("Cannot start PdfCreator");
$PdfCreator->RunCommandLine("Administrator", "123456", "C:\pptconv.exe -$ XXXXXXXXXXXXXXXXXXX C:\in.ppt C:\out.swf");
$PdfCreator = null; ?> Please set correct username and password to RunCommandLine() function, then you can launch the conversion from this special user account. Remark: You may encounter Error 1314 in some Windows systems when you launch the conversion, please by following steps to solve the 1314 Error, ERROR 1314: ~~~~~~~~~~~~~ 1314 A required privilege is not held by the client. ERROR_PRIVILEGE_NOT_HELD ~~~~~~~~~~~~~ To resolve this issue: 1. Click Start, click Run, type "secpol.msc", and then press ENTER. 2. Double-click "Local Policies". 3. Double-click "User Rights Assignment". 4. Double-click "Replace a process level token". 5. Click "Add", and then double-click the "Everyone" group 6. Click "OK". 7. You may have to logout or even reboot to have this change take effect. Please refer to following two screenshots to understand above steps, Please look at following page for the details about ERROR 1314, http://www.verydoc.com/exeshell.html 3. OK, you should no problem to call pptconv.exe from ASP or PHP code now. Please notice, you need change "XXXXXXXXXXXXXXXXXXXX" to correct License Key which sent to you by swreg. However, if you still have same problem, please create a remote desktop account on your test machine, email to us the IP address, user name and password of this remote desktop account, we will login your test machine and assist you to solve this problem asap. VeryPDF ============================================= Hello, 1. First of all, I wrote above, that I am trying with Trial license. 2. However, we already bought a "1 Server License", but if I put it on our Developer server, can I use it on Production server, later, or should buy another one? I guess not, so I wanted to use trial license for Dev server. 3. "2. Please use following code to call pptconv.exe from PHP or ASP code" - Sorry, but I am using ASP.NET, C#. Can you send me a sample for it, because I tried to make it, but is not so easy and should waste more time, which I haven't? Thanks, ============================================= Thanks for your message, please refer to following web page about how to call pptconv.exe from C# code, VeryPDF ============================================= Ok, I tried the samples. First is just like this I used and for which the problem existed. Second returns me an error that cannot find the specified path, but all paths are existing. I mean path to "pptconv.exe", to source .ppt file and also I tried to create the .swf file, which I think is not needed, but it returned the same in both cases. I only couldn't understand what is "/runpath:". I search for the command, but couldn't find it. I guessed that is the path to "lsrunas.exe", or a temp folder, but in both cases it returned the same error, even if this folder existed, too. I tried to remove it, but it says that is required. Third and fourth, looks almost the same. I tried with "cmdasuser.exe", but it returns an error, that user or pass is not correct, but I am logged in with these credentials. At the end I tried to add the key in my command, which worked on my PC. "C:\pptconv.exe -$ **************************** C:\in.ppt C:\out.swf"

It looks like that fixed the problem, but another appeared. I am seeing an inscription in converted slides in SWFs:

"The image cannot be displayed. Your computer may not have enough memory..."

When I am executing the command from CMD, it converts correctly and everything is there, but when execute the same from the code, the inscription appears.

Here is the code I am using:

Process proc = new Process();
proc.StartInfo.FileName = Server.MapPath(@"ppt2flash\pptconv.exe");
string strArguments = "-$*********************** "; strArguments += sourceCopy + " " + endSwfFile; Console.WriteLine(strArguments); proc.StartInfo.Arguments = @strArguments; proc.Start(); proc.WaitForExit(); Can you tell me what is the reason for the error? Thanks for your help, ============================================= I suggest you may use "Example #2" on following web page to try again, http://www.verypdf.com/ppt-converter/convert-ppt-to-flash.htm Example #2: Use Free docPrint Service to run pptconv.exe from current active user account, Please download and install docPrint Service from following URL, http://www.verydoc.com/download/docPrint_Service.zip docPrint Service can be used to run a Command Line from current active user account or a special user account, this tool is useful to overcome permission restrictions in SYSTEM and Non-Interactive user accounts. Please by following steps to use docPrint Service, 1. Download docPrint_Service.zip and unzip it to a folder, 2. Run docPrint_Service.exe application, you will see an icon appear in tray area, 3. You can run following command lines to test it first, "docPrint_client.exe" will deliver the Command Line to docPrint_Service.exe application, docPrint_Service.exe application will execute the Command Line from active user account automatically, docPrint_client.exe nowait "C:\VeryDOC\pptconv.exe" C:\test.ppt C:\out.swf docPrint_client.exe wait "C:\VeryDOC\pptconv.exe" C:\test.ppt C:\out.swf 4. You can call "docPrint_client.exe" from your code, please refer to a simple C# code at below, using System; using System.IO; using System.Data; using System.Configuration; using System.Collections; using System.Collections.Generic; using System.Web; using System.Diagnostics; using System.Text; using System.Net; using System.Web.Security; using System.Web.UI; using System.Security.Cryptography; using System.Data.Sql; using System.Data.SqlClient; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Runtime.InteropServices; using Microsoft.Win32; public partial class _runpptexe : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { FileStream fs; TextWriter txt; Process proc = new Process(); proc.StartInfo.FileName = "C:\\ppttest\\VeryDOC\\docPrint\\docPrint_client.exe"; string strArguments = ""; strArguments += "wait C:\\ppttest\\VeryDOC\\pptconv.exe -$ XXXXXXXXXXXXXXXXXX C:\\ppttest\\test.ppt C:\\ppttest\\test.swf";
fs = new FileStream("C:\\pptcheck.txt", FileMode.Append, FileAccess.Write);
txt = new StreamWriter(fs);
txt.WriteLine("arguments");
txt.WriteLine(strArguments);
txt.Close();
fs.Close();

Response.Write(proc.StartInfo.FileName);
Response.Write(" ");
Response.Write(strArguments);
Response.Write("<br>");

proc.StartInfo.Arguments = @strArguments;
proc.Start();
proc.WaitForExit();
Response.Write("File has been successfully converted.<br>");
}
}

Please look at following page for the details of Free docPrint Service,

http://www.verydoc.com/exeshell.html

VeryPDF
=============================================
I have another solution to you, you may arrange C# or ASP.NET code run from administrator user account to instead of default SYSTEM user account, the following code will work fine for you too,

Process proc = new Process();
proc.StartInfo.FileName = Server.MapPath(@"ppt2flash\pptconv.exe");
string strArguments = "-\$ ********************** ";
strArguments += sourceCopy + " " + endSwfFile;
Console.WriteLine(strArguments);
proc.StartInfo.Arguments = @strArguments;
proc.Start();
proc.WaitForExit();

VeryPDF
=============================================
Hello,

How I wrote above, we already bought the product. I also wrote that have a license key and used it.
Yesterday tried with your last suggestion from the code and it worked, but then changed the "in" and "out" directories, which were hard coded for the test and the error with image appeared again:

"The image cannot be displayed. Your computer may not have enough memory..."

I thought that the problem is in permissions and started to reverting the changes to reach a working code, but conversion suddenly stopped working. I tried a lot of things, even run the command from CMD and it returned the following error:

"Time:Thu Jul 19 08:21:38 2012

RunCmd(), Error

Return code = 0"

What it means? How can I fix that to can finally set the conversion, because it took too long time?

Thanks,
=============================================
Yes, but it was stopped, when I wrote you for the error. Then started it manually and yesterday it was stopped, too. So it will not work, before I start it manually. It isn't an option, I should start docPrintService.exe from the code, before starting conversion, but I should wait it to load. Unfortunately, when I start the process, it doesn't return a result when is started. I tried with "process.WaitForExit();" and "process.WaitForInputIdle();", but it didn't pass through both of them. That is why I asked you, if you have something ready, because I already waste a lots of time with this.

Thanks,
=============================================
No, restarting isn't solution, too. What about if somebody tries to convert just in that time? I should be sure, that it is running before starting conversion.

I have a bad feeling that you didn't read carefully what I am writing. You suggested me the solution with "EXEShell COM Library" in the beginning and I asked you how to make it in ASP.NET, then you suggested another solutions for .NET.
You also asked me for remote desktop and I wrote you that it isn't possible.
Now you write me the same things
=============================================
Also, if I start the docPrint_Service.exe from the code, its icon doesn't appear in tray area and it doesn't convert. I am starting it by the same admin account
=============================================
No, no, you can't start docPrint_Service.exe from your ASP.NET code, because ASP.NET is run from SYSTEM user account, if you start the docPrint_Service.exe from ASP.NET code, docPrint_Service.exe will be run from SYSTEM user account too, docPrint_Service.exe will lost the administrator privilege.

You need run docPrint_Service.exe from administrator user account or an interactive user account who own the administrator privilege, then you will see an icon appear in tray area.

also, "EXEShell COM Library" can be called from .NET code without any problem.

VeryPDF
=============================================
Finally I think I fixed the problems. I used the following sample:

http://www.verypdf.com/wordpress/201204/how-to-call-pptconv-exe-from-c-26678.html

but after conversion, instead of the images, there were errors:

"The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted…"

http://www.verydoc.com/others/configure-word-and-excel.htm

and everything looked working.
=============================================