Page 1 of 1

Converting files to .swf format using php of xampp

Posted: Wed Mar 23, 2016 12:47 am
by bharatkm
I have xampp installed on my system.
In a simplest i want to create a html page that will ask for files to be uploaded.
after uploading it should convert the file to .swf format.

for conversion iam using print2flash version 3.5 and iam running in the server mode which is the required mode.
I have also downloaded print2flash sdk which is supposed to give OLE automation API support.

print2flash sdk comes with sample codes in different languages and i want to use php sample for my work.

so basically i have a pre written code in php that i have to run.

what i have done
i have configured the service of print2flash on my system.
i copied the php sample code to "htdocs" folder of xampp server.
my server is running fine and when i open this on browser it asks for file selection and when i click convert.
there is no .swf file being generated in "convertedfiles" folder. however file is being uploaded successfully and is coming in "uploadedfiles" folder.

when i searched for it on net it said we need to use 2 files.

p2fServer.tlb - type library containing definitions for all Print2Flash Automation API objects and enumerations;
p2fServer.idl - Interface Definition File with the same information.

so how to use these files?? i have already tried copying them to "htdocs" folder where php file "index.php" is there. but its not working!!
do i need to make any changes in php.ini file to be able to use this?

Re: Converting files to .swf format using php of xampp

Posted: Wed Mar 23, 2016 4:20 am
by staff
First of all, you don't need p2fServer.tlb and p2fServer.idl files if you intend to use Pint2Flash Automation API from PHP.
Secondly, make sure that you completed instructions from the ReadMe.htm file located in the PHP sample folder.
Next, check if you use the SDK for version 3.5 and not for another version. To check it, open the ReadMe.htm file located in the sample root folder.
And lastly, do you get any error messages in the browser after uploading the file using the PHP sample?

Re: Converting files to .swf format using php of xampp

Posted: Fri Mar 25, 2016 11:48 pm
by bharatkm
one thing that keeps happening is that when I check the check box of "Grant access and permission to everyone" and click ok. then if i again open option it remains unchecked!!
Secondly i don't understand what it exactly means by configuring IIS..what i understood is to take the php folder to some server which can host it as web page!!
so i copied php folder to "htdocs" of xampp!!
is it correct??
No, it doesn't show any error messages in the browser. it just shows file uploaded in green color thats it!! so COM object isn't being created!!

Re: Converting files to .swf format using php of xampp

Posted: Sat Mar 26, 2016 8:35 am
by staff
That checkbox is not supposed to be saved. It is just an instruction to set access right when you press OK button in the Print2Flash Service Configuration window.
If you use Apache web server, you may use it and don't need to configure IIS. What version of PHP and Windows do you have?
Also, try to execute the attached VB script. It just creates Server2 object. It will let you know if this object can be created on your computer or if the problem lies in PHP itself.

Re: Converting files to .swf format using php of xampp

Posted: Mon Mar 28, 2016 12:33 am
by bharatkm
hearty thanks to all of u..i finally managed to make it work.
its able to convert any jpeg or .ppt format but its not converting any pdf format to .swf format giving timeout error. any suggestions what should i do to make it work!

Re: Converting files to .swf format using php of xampp

Posted: Mon Mar 28, 2016 4:20 am
by staff
If you get "Before printing timeout" error, please see this forum topic for information on this issue: viewtopic.php?f=19&t=5&p=5

Re: Converting files to .swf format using php of xampp

Posted: Tue Mar 29, 2016 7:42 am
by bharatkm
yeah i got this working on this system. I need to move my server to another system which has powerpoint 2016.
i got the same code working for pdf and jpeg images but for ppt its giving me error.
I have already posted it as a separate question for this, just repeating it here. feel free to reply me at any single place..

I have working php code for converting jpeg pdf and ppt files to .swf files. I am in need to change my system so when i did changed code is working for pdf and images.
but its giving error for ppt conversion as "Not enough storage is avaiable to complete this operation" .
here Iam using MS Office 2016.
I have already configured print2flash on my administrator account so no problem on permissions or anything and its working in server mode.
Also i have already taken care of protected mode in adobe acrobat reader and ms Powerpoint but still no luck!

I tried to convert the ppt files manually by right clicking on them and then clicking on print to flash . and its showing the converted file. However one thing that i noticed is different is its showing [Compatibility mode] after the file name. say if the file name is "abc.ppt" it shows on the top of print2flash window as
abc.ppt[Compatible mode]-Print2flash[Server mode].

previously before i changed my system it used to show following when i used to try manual conversion.
abc.ppt-print2flash[Server mode]

so this "compatible mode" thing bugs me? is this has anything to do with the error I am facing?

Re: Converting files to .swf format using php of xampp

Posted: Tue Mar 29, 2016 7:47 am
by bharatkm
thanks.. its working totally fine on my current system.
how ever i actually need to move this server to another machine, which i did.
i made this code to work for pdf and jpeg images but its no working for ppt. I have powepoint 2016 on this new machine.
I have already posted it as a seperate question in the same category , just repeating it here. feel free to reply any single place!!

I have working php code for converting jpeg pdf and ppt files to .swf files. I am in need to change my system so when i did changed code is working for pdf and images.
but its giving error for ppt conversion as "Not enough storage is avaiable to complete this operation" .
here Iam using MS Office 2016.
I have already configured print2flash on my administrator account so no problem on permissions or anything and its working in server mode.
Also i have already taken care of protected mode in adobe acrobat reader and ms Powerpoint but still no luck!

I tried to convert the ppt files manually by right clicking on them and then clicking on print to flash . and its showing the converted file. However one thing that i noticed is different is its showing [Compatibility mode] after the file name. say if the file name is "abc.ppt" it shows on the top of print2flash window as
abc.ppt[Compatible mode]-Print2flash[Server mode].

previously before i changed my system it used to show following when i used to try manual conversion.
abc.ppt-print2flash[Server mode]

so this "compatible mode" thing bugs me? is this has anything to do with the error I am facing?

Re: Converting files to .swf format using php of xampp

Posted: Tue Mar 29, 2016 9:43 am
by staff
Try to turn on or off special processing method for MS PowerPoint and see if it affects your problem. To turn it on, you should insert this line into your code:

Code: Select all

$p2f->DefaultBatchProcessingOptions->UseAutomation=15;
To turn it off, use this line instead:

Code: Select all

$p2f->DefaultBatchProcessingOptions->UseAutomation=11;