Converting PPT to SVG using Microsoft Office 2010 PIA
Asked Answered
F

7

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 ?

Farfetched answered 25/4, 2011 at 4:3 Comment(0)
T
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.

Trifoliate answered 22/5, 2012 at 23:4 Comment(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.Jampack
M
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.

Milord answered 31/1, 2014 at 18:41 Comment(0)
I
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).
Impassible answered 17/2, 2019 at 1:14 Comment(0)
B
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
Backsight answered 29/11, 2015 at 2:1 Comment(1)
At improvers. Please keep me posted. Comments are welcome. :)Backsight
D
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.

Deprived answered 25/4, 2011 at 4:7 Comment(1)
Are there any PPT to SVG converters out there that can do the job? I am willing to buy one if necessaryFarfetched
P
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

Paederast answered 25/4, 2011 at 18:7 Comment(0)
D
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

Diatribe answered 11/5, 2018 at 11:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.