VBA: How to get high quality export to PDF in Powerpoint with VBA
I have a presentation of which I want to print specific slides to a single pdf file. Manually printing using "Microsoft print to PDF" gives perfect result.
The presentation however consists of about 72 sheets (36 pairs) I want to print regularly. Presentation contains set of 2 sheets of drawings per sample I want to create a document per sample type containing both sheets. Doing this manually is super repetitive, tedious and I am bound to make mistakes.
When I try to print using VBA code using ActivePresentation.ExportAsFixedFormat the result is significantly of poorer quality, very blurry. Manually printing 2 sheets gives a pdf file of about 1200 kb and the vba of the same 2 sheets Export is just 300 kb.
Attached detail showing the difference
I'm using code that goes something like this:
Sub ExportSlideDuoToIndividualPDF()
Dim sPath As String, xPath As String, myletters As String
Dim steps As Integer, j As Integer, i As Integer
' Presentation contains set of 2 sheets of drawings per sample type
' A pdf document per sample type to be printed containing the sheets
' Sample types are depicted with single digit
myletters = "ABC" 'Just 3 during code testing
sPath = "C:\Output\Drawings for sample @.pdf"
steps = Len(myletters)
j = 1 'Of set counter for tupple
For i = 1 To steps
xPath = Replace(sPath, "@", Mid(myletters, i, 1))
ActivePresentation.Slides.Range(Array(j, j + 1)).Select
ActivePresentation.ExportAsFixedFormat Path:=xPath, FixedFormatType:=ppFixedFormatTypePDF, RangeType:=ppPrintSelection
j = j + 2 ' jump to next tupple
Next i
End Sub