tex/ppt_printout_ps.vbs
changeset 4 8b90d57759c9
child 5 105778ace30a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tex/ppt_printout_ps.vbs	Mon Sep 13 03:54:21 2010 +0900
     1.3 @@ -0,0 +1,41 @@
     1.4 +Dim filein
     1.5 +Dim fileout
     1.6 +If WScript.Arguments.Count <> 2 then
     1.7 +   WScript.quit
     1.8 +End If
     1.9 +filein = WScript.Arguments.item(0)
    1.10 +fileout = WScript.Arguments.item(1)
    1.11 +
    1.12 +Dim pptApp
    1.13 +Dim pptPres
    1.14 +Set pptApp = Wscript.CreateObject("PowerPoint.Application")
    1.15 +pptApp.Visible = True
    1.16 +Set pptPres = pptApp.Presentations.Open(filein)
    1.17 +
    1.18 +With pptPres.PrintOptions
    1.19 + .RangeType = ppPrintAll
    1.20 + .NumberOfCopies = 1
    1.21 + .PrintHiddenSlides = msoTrue
    1.22 + .PrintColorType = ppPrintColor
    1.23 + .FitToPage = msoFalse
    1.24 + .FrameSlides = msoFalse
    1.25 + .ActivePrinter = "Generic PostScript Writer"
    1.26 + .PrintInBackground = False 
    1.27 +End With
    1.28 +pptPres.PrintOut , , fileout
    1.29 +
    1.30 +Dim i
    1.31 +Dim note
    1.32 +For i = 1 To pptPres.Slides.Count
    1.33 +  Wscript.StdErr.Write "Processing slide " & i & "... "
    1.34 +  note = pptPres.Slides(i).NotesPage.Shapes(2).TextFrame.TextRange
    1.35 +  WScript.StdOut.WriteLine note
    1.36 +  WScript.StdOut.WriteLine Chr(12)
    1.37 +  If InStr(note, "@file=") > 0 Then
    1.38 +    pptPres.Slides(i).Export filein & ".tmp_slide" & i & ".png", "PNG"
    1.39 +  End If
    1.40 +  Wscript.StdErr.WriteLine "done"
    1.41 +Next
    1.42 +
    1.43 +pptPres.Close
    1.44 +