0

I have a Powerpoint presentation. I want to turn it into a PDF. If I Save a Copy and use PDF, there are least two issues that I want to avoid:

  1. Text is selectable. This could be perhaps avoided via security settings of the PDF file.

  2. I remember occasionally seeing (and it's too bad I cannot reproduce now) that the resulting PDF has minor arrangement issues.

One way to avoid these problems is by exporting each slide as a pure image. I can handle that route, but there are two points that make it somewhat cumbersome, which I mean to get rid of:

  1. When exporting from Powerpoint as jpg (e.g.), there is no option to avoid exporting hidden slides (this can be done when saving directly as PDF).

  2. When exporting from Powerpoint as jpg (e.g.), each slide is exported separately. The chaining of all images into a pdf has to be done manually.

Is there any way to achieve my objective? I guess I could write VBA code for this, but I don't want to reinvent the wheel.

2 Answers 2

2

Save a COPY of your presentation as a PowerPoint Picture Presentation. That'll give you a PPTX where each slide is an image of the original slide.

Don't overwrite your original presentation when you save this. Once the slides are converted to images, you can't convert back to editable slides.

Check to be sure that the slides which were hidden in the original remain hidden in the saved Picture Presentation. If not, you'll want to hide them again before saving to PDF.

7
  • This is simply fantastic. I was regretting not being able to "@" you. Thanks! Commented Oct 7, 2020 at 22:49
  • Glad it helped. Commented Oct 10, 2020 at 19:02
  • Now I am checking the results, and the quality of images is quite poor. Some text is unreadable... Trying all Image formats in Save a Copy, it turns out that only emf provided an acceptable resolution. So it seems I am back with my cumbersome method. Commented Oct 11, 2020 at 4:03
  • And export to emf very often does not respect image cropping, so it is not helpful either. Commented Oct 11, 2020 at 4:30
  • You can write your own version of PPT's picture presentations. Slides in PPT have an .Export method that allows you to specify image resolution. You could use that to create your own images at higher resolution rather than relying on PPT's default. Commented Oct 19, 2020 at 20:42
1

After the comment exchange in the answer by Steve Rindsberg, I concluded the way to go is with VBA (which I meant to avoid). I am posting here the code I used. At the point of having written the code, it gives flexibility for adding features, e.g., do not export hidden slides.
I added concatenation of images into a single PDF file (this can also be done with Adobe Acrobat, ImageMagick's convert, etc.)
Note that ExportAsFixedFormat requires ppFixedFormatIntentPrint, otherwise output quality is lost again.
Hope this is useful for others.

Sub ppt2images(Optional path As String = "")
    '
    ' If not given, use for the output directory the same as in the original presentation
    '
    On Error GoTo Err_ImageSave

    ' Set paths and file names
    Dim oPres As Presentation
    Set oPres = ActivePresentation
    Dim sImagePath As String
    Dim sPrefix As String
    sPrefix = Split(oPres.Name, ".")(0)
    If (path = "") Then
        path = oPres.path
    End If
    sImagePath = path & "\" & sPrefix
    If Dir(sImagePath, vbDirectory) <> vbNullString Then
        'MsgBox "Folder " & sImagePath & " exist"
    Else
        MkDir (sImagePath)
    End If
   
    ' Get current resolution
    Dim ps As PageSetup
    Set ps = oPres.PageSetup
    Dim lScaleWidth As Long '* Scale Width
    Dim lScaleHeight As Long '* Scale Height
    lScaleWidth = ps.SlideWidth
    lScaleHeight = ps.SlideHeight
    Dim ar As Double
    ar = lScaleWidth / lScaleHeight
    
    ' Set target resolution
    Dim newWidth As Long '* Scale Width
    Dim newHeight As Long '* Scale Height
    newWidth = 4096
    newHeight = newWidth / ar
    
    ' Create new temporary presentation to add generated images as slides
    Dim oPresTmp As Presentation
    ' Create it as not visible
    Set oPresTmp = Presentations.Add(msoFalse)
    ' Copy page size from the source presentation
    With oPresTmp.PageSetup
        .SlideHeight = oPres.PageSetup.SlideHeight
        .SlideWidth = oPres.PageSetup.SlideWidth
    End With
    Dim oSlideNew As Slide '* Slide Object
    Dim oPic As Shape

    ' Export slides
    Dim sImageName As String
    Dim oSlide As Slide '* Slide Object
    Dim img_format As String
    img_format = "png"
    For Each oSlide In oPres.Slides
        With oSlide
            ' If slide is not hidden
            If (.SlideShowTransition.Hidden = msoFalse) Then
                ' Export slide
                sImageName = sImagePath & "\" & sPrefix & "-" & Format$(.SlideIndex, "000") & "." & img_format
                .Export sImageName, img_format, newWidth, newHeight
                ' Add it to the temporary presentation
                Set oSlideNew = oPresTmp.Slides.Add(oPresTmp.Slides.Count + 1, ppLayoutBlank)
                Set oPic = oSlideNew.Shapes.AddPicture(FileName:=sImageName, _
                    LinkToFile:=msoFalse, _
                    SaveWithDocument:=msoTrue, _
                    Left:=0, _
                    Top:=0, _
                    Width:=-1, _
                    Height:=-1)
                    ' width/height of -1 tells PPT to import the image at its "natural" size
            End If
        End With
    Next oSlide
    
    With oPresTmp
        ' Export temp presentation to pdf
        Dim sPDFName As String
        sPDFName = sImagePath & ".pdf"
        .ExportAsFixedFormat sPDFName, ppFixedFormatTypePDF, ppFixedFormatIntentPrint, msoFalse, _
            ppPrintHandoutVerticalFirst, ppPrintOutputSlides, msoFalse
        
        ' Close temp presentation
        .Saved = True
        .Close
    End With

Err_ImageSave:
    If Err <> 0 Then
        MsgBox Err.Description
    End If
End Sub
2
  • >> Still have to concatenate images into a single PDF file. Or import them into a new PPT file one at a time as you export them, or in a batch after you're done exporting, then save that as PDF. Commented Oct 22, 2020 at 19:44
  • 1
    @SteveRindsberg - Done. It works great. Commented Oct 23, 2020 at 10:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .