使用Microsoft Office 2010 PIA将PPT转换为SVG

|| 我正在尝试将PowerPoint演示文稿转换为单独的svg文件(每个幻灯片1个),是否可以通过使用Microsoft Office 2010 PIA来完成? 如果是这样,那么是否有任何有关在Java中使用Microsoft Office 2010 PIA的教程?     
已邀请:
我没有现成的自动转换器,但是我成功地将每个幻灯片保存为Powerpoint中的PDF,然后在Inkscape中打开PDF并另存为SVG。 Powerpoint的PDF导出和Inkscape的PDF导入都非常复杂并产生良好的结果,而SVG是Inkscape的本机保存格式,但是可能需要对Inkscape中导入的PDF进行一些调整才能在其中复制某些元素。原始的。 我安装了Adobe Acrobat可能有所不同,但是我没有使用\“另存为Adobe PDF \”插件,只是使用了普通的“另存为”对话框。使用另存为Adobe PDF会产生较差的结果。     
我最好导出为Inkscape也可以读取的增强Windows元文件(.emf)。 这是“更好的”,因为当我尝试导入导出的PDF时,Inkscape生成了一堆图像文件。导入的SVG的XML看起来也更干净。     
我意识到这是一个老问题,但最近我尝试这样做,并找到了一个使用Google幻灯片效果很好的解决方案: 将PowerPoint上载到Google云端硬盘,然后单击
Open in Google Slides
,或者 创建一个新的Google幻灯片演示文稿,然后单击
File -> Import Slides...
并拉入所需的幻灯片。
File -> Download as -> Scalable Vector Graphics (.svg, current slide)
。     
这就是我的操作方式(没有Office PIA)。 运行宏以将PPTX拆分为与演示文稿中的幻灯片一样多的PDF文件。 使用inkscape将每个PDF转换为SVG VBA宏
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
可以改进此功能(例如,对话框,更多控件,将其添加为插件),但实际上是在这里。 墨迹步骤 Linux机壳的单线:
for file in *.pdf; do inkscape --without-gui \"--file=$file\" \"--export-plain-svg=${file%%.*}.svg\"; done
    
这将非常困难,没有直接的方法可以执行此afaik(如果我错了,请纠正我!)-最简单的方法是将Print打印到XPS,然后转换XAML(XPS == XAML + zip文件)到SVG文件;这也不是容易或直接的,但是XAML => SVG之间的映射可能更接近。     
它不是最流畅的翻译,但是请检查docx4j的pptx4j组件以在SVG中呈现大多数项目:http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/pptx4j/java/org /pptx4j/samples/RenderAsSvgInHtml.java     
在Mac OSX上,它并未针对使用命令行[1]进行优化,因此您需要为文件添加绝对路径:
for file in *.pdf; do inkscape --without-gui \"--file=${PWD}/${file}\" \"--export-plain-svg=${PWD}/${file%%.*}.svg\"; done
否则,您会收到以下错误消息:   **消息:无法打开PDF文件。      **(inkscape-bin:13267):警告**:无法打开文件:myfile.pdf(不存在)      **(inkscape-bin:13267):警告**:无法打开指定的文档myfile.pdf(不存在或不是有效的SVG文件) [1] OSX上的Inkscape无法通过终端命令打开PDF文件     

要回复问题请先登录注册