Hi,
sent
Charles
Hi,
sent
Charles
OK, as you know I got the file. I've been looking at it and into the pptx specifications. Not looking great. Your example file shows a level of sophistication in the use of both images (not necessarily using one image per slide, also using non-web-standard image formats) and drawing (yes pptx files can also have drawings rendered via commands to put a line or shape one place or another upon or near an existing image). Your file uses all these techniques and perhaps more, making reading them out to PDF more difficult than I had at first imagined. That doesn't mean it cannot be done. But let me put it this way, (paraphrasing information I came across researching the standard) - The pptx standard is the result of at least thousands of hours of work over 10 or more years involving hundreds or more programmers. So to easily convert it fully to PDF in the manner we've been using would be quite a task. I found some folks who claim to have found decent workarounds. These involve using one or another document API. The two that so far look most promising are PUNO (Open Office API), and the Google Docs API. Both should be able to convert from many formats (including pptx) to many others (including PDF). However they require connecting live on the web to the given API during the conversion process and may also require one or more other modules to PHP (like ZEND, for example), all of which is likely doable unless you are prevented from adding needed modules, and/or must do this exclusively on an intranet that has no access to the web.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Hi John,
thank you.
ok. I have tried this way because the others possibilities were not accessible
1) as you said "unless you are prevented from adding needed modules, and/or must do this exclusively on an Intranet that has no access to the web. " its exactly that
2)I shouldn't use the class COM from PHP because it involves Microsoft Office or Open Office (for security reasons)
3)pptx into images was my first attempt and the struggle was real
4)now I was trying my last chance doing this: pptx -> unzip -> xml -> pdf (may be -> png)
5)I think i'll give up so far as every software that does this conversion is not free and very expensive for a server purpose.
Anyway ... thank you for your help
Charles
Last edited by mignoncharly; 06-08-2016 at 11:33 AM.
What I would be inclined to do in that case is either:
1.) Just have them download and view the pptx file locally.
or:
2.) Convert them all to PDF using MO or OO (free if you don't have MO). You can probably setup a batch file to do all of them at once if there are - say more than ten. Then simply make the PDF files available, or even give the users the choice of format for download. Of course, in the case of PDF, they can always choose to simply view it in the browser (like all PDF viewed that way, it gets downloaded to the browser's cache anyway though).
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Hi John,
1.) Actually the files will be uploaded in a directory on the server and fetched (by a script / code) from there for the conversion. And the goal is to broadcast them in the form of pdf or images or video on public displays.
2.) Convert them all to PDF using MO or OO. => No I shouldn't as explained in my last reply.
Charles
Last edited by mignoncharly; 06-09-2016 at 06:57 AM.
#2 Why not just do it? I mean don't have a web and/or intranet available routine for that, just do it manually or via a batch file that only you control/have access to. No security violation there.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
This has already been done using asp .net but now I wanted to do it programmatically using php so no need for manual intervention
Where did you find out about the asp.net approach? And does it use MO or another program, or is it a straight conversion like we were attempting in PHP? I would imagine that .net might have the data structures directly available to it and/or be extremely well suited to running MO from a shell.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Hi,
" ... .net might have the data structures directly available to it and/or be extremely well suited to running MO from a shell." exactly but with a batch file. the work has been done by another teammate. now we wanted to use only php.
John I have found a software for the conversion now my problem is: could you propose me some method / tricks to use the .exe using php ? i was thinking about these steps:
1) a function that pushes the pptx files in new array and
2) a loop throught the array to fetch the 1.pptx and convert it
what do you think?
Thks in advance
Charles
The glob function can do that (1, make the array), and foreach can loop (2) through it:
But if you are only doing that to choose the 1.pptx file, you can simply go after it directly:PHP Code:foreach (glob("*.pptx") as $filename) {
if($filename === "1.pptx"){convert($filename);}
}
BTW, what software did you find?PHP Code:convert("1.pptx");
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks