12

I'm trying to convert a powerpoint presentation to seperate svg files (1 for each slide), Is it possible to do so by using the Microsoft Office 2010 PIA ?

If so, then is there any tutorial on using Microsoft Office 2010 PIA in Java ?

7 Answers 7

19

There are no off-the-shelf automatic converters that I know of, but I had success in saving each individual slide as PDF in Powerpoint, then opening the PDF in Inkscape and resaving as SVG. Both Powerpoint's PDF export and Inkscape's PDF importing are quite sophisticated and produce good results, and SVG is Inkscape's native saving format, but some tweaking of the imported PDF in Inkscape may be required to reproduce certain elements in the original precisely.

It may have made a difference that I have Adobe Acrobat installed, but I did not use the "Save as Adobe PDF" plugin, just the ordinary "Save As" dialog. Using Save as Adobe PDF produced inferior results.

1
  • Just wanted to add that when I used "Save as Adobe PDF" plugin, Inkscape crashes when attempting to open it. PDF saved from ordinary "Save As" dialog works like a charm.
    – subhacom
    Aug 27, 2018 at 14:29
9

I had better success exporting as Enhanced Windows meta file (.emf) which Inkscape also can read.

It was 'better' because when I tried to import the exported PDF, Inkscape generated a bunch image files. The XML of the imported SVG seemed cleaner as well.

7

I realize this is an old question, but I recently tried to do this and found a solution that worked pretty well using Google Slides:

  1. Upload the PowerPoint to Google Drive, then click Open in Google Slides, OR
  2. Create a new Google Slides presentation, then click File -> Import Slides... and pull in the slides you need.
  3. File -> Download as -> Scalable Vector Graphics (.svg, current slide).
2

This is how I'm doing it (without Office PIA).

  1. Run a macro to split the PPTX in as many PDF files as slides in the presentation.
  2. Use inkscape to convert each PDF to SVG

VBA Macro

Sub ExportAllSlidesInPDF()

  Dim SourceView, answer As Integer
  Dim SourceSlides, NumPres, x As Long
  Dim ThisSlideFileNamePDF As String

  NumPres = Presentations.Count

  If NumPres = 0 Then
     MsgBox "No Presentation Open", vbCritical, vbOKOnly, "No Presentations Open"
  End If

  SourceView = ActiveWindow.ViewType
  SourceSlides = ActivePresentation.Slides.Count

  For x = 1 To SourceSlides
     Presentations.Add
     With ActivePresentation.PageSetup
        .SlideHeight = Presentations(1).PageSetup.SlideHeight
        .SlideWidth = Presentations(1).PageSetup.SlideWidth
     End With

     If ActiveWindow.ViewType <> ppViewSlide Then
        ActiveWindow.ViewType = ppViewSlide
     End If

     Presentations(1).Windows(1).Activate
     If ActiveWindow.ViewType <> ppViewSlideSorter Then
        ActiveWindow.ViewType = ppViewSlideSorter
     End If

     ActivePresentation.Slides.Range(Array(x)).Select
     ActiveWindow.Selection.Copy

     Presentations(2).Windows(1).Activate
     If ActiveWindow.ViewType <> ppViewSlide Then
        ActiveWindow.ViewType = ppViewSlide
     End If

     ActiveWindow.View.Paste
     ActiveWindow.Selection.Unselect

     ThisSlideFileNamePDF = "Slide_" & x & ".pdf"
     ActivePresentation.SaveAs ThisSlideFileNamePDF, ppSaveAsPDF
     ActivePresentation.Close

     Presentations(1).Windows(1).Activate

  Next x

  ActiveWindow.ViewType = SourceView

End Sub

This can be improved (e.g. dialogs, more controls, add as an addin) but here it is in principle.

inkscape step

Single-liner for a Linux box:

for file in *.pdf; do inkscape --without-gui "--file=$file" "--export-plain-svg=${file%%.*}.svg"; done
1
  • At improvers. Please keep me posted. Comments are welcome. :) Nov 29, 2015 at 2:02
0

This is going to be pretty hard, there is no direct way to do this afaik (please correct me if I'm wrong!) - the easiest way would be to Print to XPS, then convert the XAML (XPS == XAML + Zip file) to an SVG file; this isn't easy or straightforward either, but the mapping between XAML => SVG is probably far closer.

1
  • Are there any PPT to SVG converters out there that can do the job? I am willing to buy one if necessary
    – fogy
    Apr 25, 2011 at 4:08
0

It's not the smoothest of translations, but check out the pptx4j component of docx4j to render most items in SVG: http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/pptx4j/java/org/pptx4j/samples/RenderAsSvgInHtml.java

0

On Mac OSX it is not optimised to be used from command line [1], so you need to add an absolute path to your files:

for file in *.pdf; do inkscape --without-gui "--file=${PWD}/${file}" "--export-plain-svg=${PWD}/${file%%.*}.svg"; done

Otherwise you get this error message:

** Message: couldn't open the PDF file.

** (inkscape-bin:13267): WARNING **: Can't open file: myfile.pdf (doesn't exist)

** (inkscape-bin:13267): WARNING **: Specified document myfile.pdf cannot be opened (does not exist or not a valid SVG file)

[1] Inkscape on OSX cannot open PDF file through terminal command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.