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
Related
I recently automated the creation of Powerpoint Presentations in a site I'm making. I found the Office Interop libraries extremely simple to use.
Office isn't built for this kind of thing in a webserver environment, so I'm looking at creating the Powerpoints using Open Office XML, only it's so extremely complex. For example I downloaded some code to create a blank presentation with some text. This code was around 300 lines! Using the Office Interop libraries I could do the same thing in just a couple of lines of code.
I don't have time, nor do I want to attempt to learn how to interact with the Open Office XML libraries, so I'm hoping someone has made a wrapper for the Open Office XML libraries. So far all my searching has only given me one result, Aspose Slides for .NET. This looks really hopeful, but it also looks rather expensive
Has anyone ever used a decent wrapper or alternative before?
If you are looking at automating the creation of Powerpoint presentation files, I'd say you continue with OpenXML, there's nothing better than it. Everything else is either paid or don't offer entire gamut of functionality that Open XML can provide.
If you find creating a blank file tedious, you could save an empty file somewhere and use that as a template for performing further operations on it.
The only thing close to a wrapper for PowerPoint I've found is the Open XML PowerTools. It includes a PresentationBuilder class which can be used for some specific tasks like combining slides from multiple PowerPoint documents into a new document. Although its pretty limited in its functionality you could extend the class.
However, I've come to the conclusion that there just is not a good wrapper out there so I've had to do what everybody pretty much recommends and that is using the Open XML SDK Productivity Tool and the Reflect code button.
I put together a basic presentation then Reflect Code and put that into a class. Yes its a lot of lines of code and its not the most elegant solution but it does work. Then from there I can extend or modify that class to do the specific things I need to do with each slide. The Productivity Tool is a big help for figuring out the code need to do specific things. I try to keep it simple and just do one or two things at a time, Reflect Code, then look at the code to see what it does.
You could try SoftArtisans PowerPointWriter, it has a template mode that allows you to start with an existing PowerPoint file with a few place holders, and merge your data with your presentation with as little as 5 lines of code.
Disclaimer: I work for SoftArtisans
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.
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).
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
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