是否有理由导出为 PDF 而不是 JPG 或 PNG 等光栅格式?可以从 VBA 调用一些开源解决方案来裁剪这些图像格式。如果您需要 PDF,那么此宏将满足您的需求:
Option Explicit
' *********************************************************
' Purpose : PowerPoint VBA macro to export slides as either
' and image or a PDF.
' Author : Jamie Garroch from htpp://youpresent.co.uk/
' Date : 17MAY2016
' *********************************************************
Sub ExportEachSlidesAsPDF()
Const myPath = "C:\Temp\"
Dim oSld As Slide
For Each oSld In ActivePresentation.Slides
' The next commented line exports the slide as a JPG
'oSld.Export myPath & ActivePresentation.Name & " Slide " & oSld.SlideIndex & ".jpg", "JPG"
' Export each slide as a PDF
With ActivePresentation
.PrintOptions.Ranges.ClearAll
.PrintOptions.Ranges.Add oSld.SlideIndex, oSld.SlideIndex
.ExportAsFixedFormat2 Path:=myPath & ActivePresentation.Name & " Slide " & oSld.SlideIndex & ".pdf", _
FixedFormatType:=ppFixedFormatTypePDF, _
Intent:=ppFixedFormatIntentPrint, _
FrameSlides:=msoFalse, _
HandoutOrder:=ppPrintHandoutHorizontalFirst, _
OutputType:=ppPrintOutputSlides, _
PrintHiddenSlides:=msoFalse, _
PrintRange:=.PrintOptions.Ranges(1), _
RangeType:=ppPrintSlideRange
End With
Next
End Sub