【问题标题】:Converting PPT to SVG using Microsoft Office 2010 PIA使用 Microsoft Office 2010 PIA 将 PPT 转换为 SVG
【发布时间】:2011-04-25 04:03:41
【问题描述】:

我正在尝试将 powerpoint 演示文稿转换为单独的 svg 文件(每张幻灯片 1 个),是否可以使用 Microsoft Office 2010 PIA 来做到这一点?

如果是这样,那么有没有关于在 Java 中使用 Microsoft Office 2010 PIA 的教程?

【问题讨论】:

    标签: svg ms-office powerpoint office-pia


    【解决方案1】:

    据我所知,没有现成的自动转换器,但我成功地将每张幻灯片保存为 Powerpoint 中的 PDF,然后在 Inkscape 中打开 PDF 并重新保存为 SVG。 Powerpoint 的 PDF 导出和 Inkscape 的 PDF 导入都非常复杂并且产生了很好的效果,并且 SVG 是 Inkscape 的原生保存格式,但是可能需要在 Inkscape 中对导入的 PDF 进行一些调整才能精确地再现原始文件中的某些元素。

    我安装了 Adob​​e Acrobat 可能会有所不同,但我没有使用“另存为 Adob​​e PDF”插件,只是使用普通的“另存为”对话框。使用“另存为 Adob​​e PDF”会产生较差的结果。

    【讨论】:

    • 只是想补充一点,当我使用“另存为 Adob​​e PDF”插件时,Inkscape 在尝试打开它时会崩溃。从普通的“另存为”对话框保存的 PDF 就像一个魅力。
    【解决方案2】:

    我最好导出为 Inkscape 也可以读取的增强型 Windows 元文件 (.emf)。

    它“更好”,因为当我尝试导入导出的 PDF 时,Inkscape 生成了一堆图像文件。导入的 SVG 的 XML 看起来也更干净。

    【讨论】:

      【解决方案3】:

      我意识到这是一个老问题,但我最近尝试这样做并找到了一个使用 Google 幻灯片效果很好的解决方案:

      1. 将 PowerPoint 上传到 Google Drive,然后点击 Open in Google Slides,或者
      2. 创建一个新的 Google 幻灯片演示文稿,然后点击 File -> Import Slides... 并拉入您需要的幻灯片。
      3. File -> Download as -> Scalable Vector Graphics (.svg, current slide)

      【讨论】:

        【解决方案4】:

        这就是我的做法(没有 Office PIA)。

        1. 运行宏以将 PPTX 拆分为与演示文稿中的幻灯片一样多的 PDF 文件。
        2. 使用 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
        

        这可以改进(例如对话框、更多控件、作为插件添加),但原则上是这样。

        inkscape 步骤

        Linux 机器的单行:

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

        【讨论】:

        • 改进者。请保持让我知道最新消息。欢迎评论。 :)
        【解决方案5】:

        这将非常困难,没有直接的方法可以做到这一点 afaik(如果我错了,请纠正我!) - 最简单的方法是打印到 XPS,然后转换 XAML(XPS == XAML + Zip 文件)到 SVG 文件;这也不容易或直接,但 XAML => SVG 之间的映射可能更接近。

        【讨论】:

        • 是否有任何 PPT 到 SVG 转换器可以完成这项工作?有需要我愿意买一台
        【解决方案6】:

        这不是最流畅的翻译,但请查看docx4j 的 pptx4j 组件以在 SVG 中呈现大多数项目:http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/pptx4j/java/org/pptx4j/samples/RenderAsSvgInHtml.java

        【讨论】:

          【解决方案7】:

          在 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): WARNING **: 指定的文档 myfile.pdf 无法打开(不存在或不是有效的 SVG 文件)

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

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2011-08-22
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多