How to convert powerpoint pptx file to ppt file programmatically without powerpoint installed? - powerpoint

How can I convert a pptx file to a ppt file programmatically. This happens on a web server that does not have PowerPoint installed.
I'm after a free solution preferably.
I may consider installing PowerPoint on the server if it is not possible but I'm concerned about the scalability of that solution. I wouldn't want the server to be struggling because multiple conversions are in progress...
Thanks

You could install OpenOffice Impress (Libre Office Impress) on the server, maybe it can do the document conversion.
I hear that in OpenOffice, there are python APIs avalaible, and maybe more, even a VBA clone.
It is probably not possible to convert from the command line like this,
ooimpress -infile "mydoc.pptx" -outfile "mydoc.ppt"
In any case, the conversion will probably not be perfect. If your pptx files contain embedded OLE documents, expect problems.
SImple slides with bulleted lists and some simple graphics objects (circles, arrows, Raster Graphics files such as gifs) are less likely to be a problem.
Here are some links to openoffice forum-threads with similar problems.
.doc to .pdf, all command-line?
http://www.oooforum.org/forum/viewtopic.phtml?t=5513
Help! - Simple command line conversion of Word doc to XML
http://www.oooforum.org/forum/viewtopic.phtml?t=7242

The presentation object has a SaveAs method that can do this. For instance,
for saving the active presentation as a .ppt file, the following code would
do the job:
ActivePresentation.SaveAs "FileName.ppt", ppSaveAsPresentation
Reference:
http://www.pcreview.co.uk/forums/programmatic-conversion-pptx-into-ppt-t3339221.html

Related

Preparing PDFs for use as Prawn templates

We've got a system that takes in a large variety of PDFs from unknown sources, and then uses them as templates for new PDFs generated by Prawn.
Occasionally some PDFs don't work as templates for Prawn- they either trigger a generic Prawn error ("Prawn::Errors::TemplateError => Error reading template file. If you are sure it's a valid PDF, it may be a bug.") or the resulting PDF comes out malformed.
(It's a known issue that some PDFs don't work as templates in Prawn, so I'm not trying to address that here:
[1]
[2])
If I take any of the problematic PDFs, and manually re-save them on my Mac using Preview > Save As [new PDF], I can then always use them as Prawn templates without any problem.
My question is, is there some (open source) server-side utility I can use that might be able to do the same thing- i.e. process problematic PDFs into something Prawn can use?
Yarin, it at least partially depends on why the PDFs don't work in the first place. If you can use them after re-saving with Apple's (quite bad) preview PDF code, you should be able to get the same result using a number of different tactics:
-) Use an actual PDF library to open and save the PDF files (libraries from Adobe and Global Graphics come to mind). These are typically commercial products but (I know the Adobe library the best) they do allow you to open a file and save it, performing a number of optimisations in the process. The Adobe libraries are currently licensed through a company called DataLogics (http://www.datalogics.com)
-) Use a commercial product that embeds these libraries. callas pdfToolbox comes to mind (warning, I'm affiliated with this product). This basically gives you the same possibilities as the previous point, but in a somewhat easier to use package (command-line use for example).
-) Use an open source product. I'm not very well positioned to provide useful links for that.
There is another approach that may work depending on your workflow and files. In graphic arts bad files are sometimes "made better" by a process called re-distilling; you basically convert the PDF file to PostScript and re-distill the postscript into PDF again. Because this rewrites the whole file structure, it often fixes fundamental problems. However, it also comes with risks as you're going through a different file format. Libraries such as GhostScript (watch the licensing conditions) may allow you to do this.
Given that your files seem to be fixed simply by using preview, I would think a redistilling approach would be overly dangerous and overkill. I would look into finding a good PDF library that can automatically open and save your files.

How to split PowerPoint presentation file into files with one slide in each file

I need to split PowerPoint presentation file (pptx and, if possible, ppt) into a set of original format files (pptx or ppt) – each containing one slide from the original. I need to do this programmatically on Linux Ubuntu server using free tools or external free API. When a file gets uploaded to a directory program will be called from my main program (written in PHP) and do the split.
I am looking for suggestions about language or set of tools to use. I looked at several options listed below. It will take some time to try all of them but if anyone could exclude or add to the list and/or provide code examples it would help.
Thanks!
(1) Apache POI project (POI-XSLF)
(2) OpenOffice unoconv command line utility
(3) C# (with compiler Mono for Linux). This may include indirect option of deleting slides with powerPoint.Slides(x).Delete
(4) JODConverter (Java OpenDocument Converter)
(5) PyODConverter (Python OpenDocument Converter)
(6) Google Documents API
(7) Aspose.Slides for .NET is out because of cost
When I had the same needs I ended up shelling and using "UNOCONV" to convert the files to PDF. And then used "PDFTK" to split the file by pages. Once that is done you should be able to take the extra step and convert the new split PDF files back to PPTX using one more UNOCONV.
While it seems rather complicated, PPTX seems to be "that one ooxml file no one wants to touch". Libraries seem to be few and incomplete mostly.

How do I programmatically convert a Keynote file to a PowerPoint?

Anyone know any good tools to convert a keynote file to a PowerPoint one? We have an online tool that currently accepts PPT/PPTX files and we then use Aspose tools to do more with it. But we're needing to accept keynote files too and the easiest way in theory is to convert it to a PPT file and then process in the same way from there.
However we're really struggling to find a way to convert them programmatically!
Any ideas?
Old question but by the views counter seems relevant for many.. a conversion service such as CloudConvert can do the job (https://cloudconvert.com/api/conversions). At least for converting .key to .pptx (not sure about the other way round).

manipulate visio format file programmatically

I want to extract information from a Visio file and do some change on them(like using C++), then write them back?
My question is:
Is manipulating visio files(mainly reading and writing) programmingly possible?
If so, any tutorial lin is preferred
Reading/Writing Visio VSD Files
This is a binary format and as far as I know, it is not documented. However, check out what has been going with support for reading Visio VSD files in LibreOffice.
Reading/Writing Visio VDX files
These are just the XML equivalent of VSD files and relatively straightforward to read and write if you are familiar with Visio. For simple tasks such as finding and manipulating all shape custom properties or formatting it will be very straightforward to load the XML into a DOM, process it, and then save it back out. For example, I once wrote a small tool that used this technique to search and replace text in a set of VDX files. One warning: the more complex a task you want to perform, the more you will need to be very familiar with Visio and how it works with Shapesheets, etc.
Here's a link to get started: http://msdn.microsoft.com/en-us/library/aa218409(v=office.10).aspx

extract ppt from office word using OpenXml format through c#

I want to extract a flash object from a word doc using OpenXml.I have done it other way round but it is not working as, if there are many flash objects then the processing time got hampered and henceforth i think openxml is more suitable>please someone help me in doing the same .I am coding in c#
Use this: Standalone tool for extracting embedded Office Open XML objects from files

Resources