1c966c276SAndrew Rist' ************************************************************* 2c966c276SAndrew Rist' 3c966c276SAndrew Rist' Licensed to the Apache Software Foundation (ASF) under one 4c966c276SAndrew Rist' or more contributor license agreements. See the NOTICE file 5c966c276SAndrew Rist' distributed with this work for additional information 6c966c276SAndrew Rist' regarding copyright ownership. The ASF licenses this file 7c966c276SAndrew Rist' to you under the Apache License, Version 2.0 (the 8c966c276SAndrew Rist' "License")' you may not use this file except in compliance 9c966c276SAndrew Rist' with the License. You may obtain a copy of the License at 10c966c276SAndrew Rist' 11c966c276SAndrew Rist' http://www.apache.org/licenses/LICENSE-2.0 12c966c276SAndrew Rist' 13c966c276SAndrew Rist' Unless required by applicable law or agreed to in writing, 14c966c276SAndrew Rist' software distributed under the License is distributed on an 15c966c276SAndrew Rist' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16c966c276SAndrew Rist' KIND, either express or implied. See the License for the 17c966c276SAndrew Rist' specific language governing permissions and limitations 18c966c276SAndrew Rist' under the License. 19c966c276SAndrew Rist' 20c966c276SAndrew Rist' ************************************************************* 21cdf0e10cSrcweirSub Main 22cdf0e10cSrcweir 23cdf0e10cSrcweirDim oSettings(11) as new com.sun.star.beans.PropertyValue 24cdf0e10cSrcweiroSettings(0).Name = "JPEGCompression" 25cdf0e10cSrcweiroSettings(0).Value= True 26cdf0e10cSrcweiroSettings(1).Name = "JPEGQuality" 27cdf0e10cSrcweiroSettings(1).Value= 25 28cdf0e10cSrcweiroSettings(2).Name = "RemoveCropArea" 29cdf0e10cSrcweiroSettings(2).Value= True 30cdf0e10cSrcweiroSettings(3).Name = "ImageResolution" 31cdf0e10cSrcweiroSettings(3).Value= 90 32cdf0e10cSrcweiroSettings(4).Name = "OLEOptimization" 33cdf0e10cSrcweiroSettings(4).Value= False 34cdf0e10cSrcweiroSettings(5).Name = "OLEOptimizationType" 35cdf0e10cSrcweiroSettings(5).Value= 1 36cdf0e10cSrcweiroSettings(6).Name = "DeleteUnusedMasterPages" 37cdf0e10cSrcweiroSettings(6).Value= True 38cdf0e10cSrcweiroSettings(7).Name = "DeleteHiddenSlides" 39cdf0e10cSrcweiroSettings(7).Value= True 40cdf0e10cSrcweiroSettings(8).Name = "DeleteNotesPages" 41cdf0e10cSrcweiroSettings(8).Value= True 42cdf0e10cSrcweiroSettings(9).Name = "SaveAs" 43cdf0e10cSrcweiroSettings(9).Value= true 44cdf0e10cSrcweiroSettings(10).Name = "EmbedLinkedGraphics" 45cdf0e10cSrcweiroSettings(10).Value = false 46cdf0e10cSrcweiroSettings(11).Name = "SaveAsURL" 47cdf0e10cSrcweiroSettings(11).Value = "" 48cdf0e10cSrcweiroSettings(12).Name = "FilterName" 49cdf0e10cSrcweiroSettings(12).Value = "impress8" 50cdf0e10cSrcweir 51cdf0e10cSrcweir 52cdf0e10cSrcweir 53cdf0e10cSrcweirDim oArg(0) as new com.sun.star.beans.PropertyValue 54cdf0e10cSrcweiroArg(0).Name = "Settings" 55cdf0e10cSrcweiroArg(0).Value= oSettings 56cdf0e10cSrcweir 57cdf0e10cSrcweirDim url As String 58cdf0e10cSrcweirDim oPresentations(17) as String 59cdf0e10cSrcweiroPresentations( 0)="d:\data\sunpresentations\01-22-07SunIntelAnnouncementPresentation,01-22-2007.star_impress_8x.odp" 60cdf0e10cSrcweiroPresentations( 1)="d:\data\sunpresentations\01_Schwartz_SAS_VF.odp" 61cdf0e10cSrcweiroPresentations( 2)="d:\data\sunpresentations\CorporateSocialResponsibilityCustomerPresentation,02-12-2007.star_impress_8x.odp" 62cdf0e10cSrcweiroPresentations( 3)="d:\data\sunpresentations\Current-ProjectBlackboxCustomerPresentation,03-07-2007.star_impress_8x.odp" 63cdf0e10cSrcweiroPresentations( 4)="d:\data\sunpresentations\JavaSE6CustomerPresentation,12-11-2006(2).star_impress_8x.odp" 64cdf0e10cSrcweiroPresentations( 5)="d:\data\sunpresentations\JavaSE6CustomerPresentation,12-11-2006.star_impress_8x.odp" 65cdf0e10cSrcweiroPresentations( 6)="d:\data\sunpresentations\NetworkComputingLaunchPresentation,Q22006,Washington,DC,05-08-2006.star_impress_8x.odp" 66cdf0e10cSrcweiroPresentations( 7)="d:\data\sunpresentations\ProjectBlackboxTechnicalPresentation-NDAONLY,11-09-2006.star_impress_8x.odp" 67cdf0e10cSrcweiroPresentations( 8)="d:\data\sunpresentations\ScottMcNealy,IntlAssocofPrivacyProfessionals)ConferenceOpeningKeynote,'PlayingonSunday-GettingPrivacyRight',March,8,2007,Washington,DC,,03-08-2007.star_impress_8x.odp" 68cdf0e10cSrcweiroPresentations( 9)="d:\data\sunpresentations\Sun'sStoragetekAcademy-JonathanSchwartzTheSky'sTheLimit!,February,292007,SanFrancisco,CA,02-28-2007.star_impress_8x.odp" 69cdf0e10cSrcweiroPresentations(10)="d:\data\sunpresentations\SunAnalystSummit2007(SAS)-DonGranthamExecutingonStrategy,February,6,2007,SanFrancisco,CA,02-07-2007.star_impress_8x.odp" 70cdf0e10cSrcweiroPresentations(11)="d:\data\sunpresentations\SunConsultingServicesPortfolio-Presentation,03-17-2006.star_impress_6x.sxi" 71cdf0e10cSrcweiroPresentations(12)="d:\data\sunpresentations\SunFedOpenYourMindandSunFedTechDayatGTSI,ScottMcNealy,January23and24,2007,Washington,DC,01-23-2007.star_impress_8x.odp" 72cdf0e10cSrcweiroPresentations(13)="d:\data\sunpresentations\SunFedTechDaysatAccenture,ScottMcNealy,January24,2007,Washington,DC,01-24-2007.star_impress_8x.odp" 73cdf0e10cSrcweiroPresentations(14)="d:\data\sunpresentations\SunManagedServicesGoldenPitch,03-22-2007.star_impress_8x.odp" 74cdf0e10cSrcweiroPresentations(15)="d:\data\sunpresentations\SunServicesEducationServicesGeneralPresentation,01-11-2006.star_impress_6x.sxi" 75cdf0e10cSrcweiroPresentations(16)="d:\data\sunpresentations\SunSystemPacks-CustomerReadyPresentation,01-23-2007.star_impress_8x.odp" 76cdf0e10cSrcweiroPresentations(17)="d:\data\sunpresentations\U.S.SalesMeetingCustomerPresentation(08-01-2006),08-01-2006.odp" 77cdf0e10cSrcweir 78cdf0e10cSrcweirFOR I = 0 TO 17 79cdf0e10cSrcweirurl=oPresentations( I ) 80cdf0e10cSrcweiroSettings(11)=url+string( I, 2 ) 81cdf0e10cSrcweirurl=converttourl( url ) 82cdf0e10cSrcweiroptimize( url, oArg() ) 83cdf0e10cSrcweirNEXT I 84cdf0e10cSrcweir 85cdf0e10cSrcweirEnd Sub 86cdf0e10cSrcweir 87cdf0e10cSrcweirSub Optimize( url as String, oArg ) 88cdf0e10cSrcweir 89cdf0e10cSrcweirDim oPPPOptimizerDialog as Object 90cdf0e10cSrcweirDim oUrl as new com.sun.star.util.URL 91cdf0e10cSrcweirDim oTrans as Object 92cdf0e10cSrcweiroTrans = createUNOService("com.sun.star.util.URLTransformer") 93cdf0e10cSrcweiroUrl.Complete = "vnd.com.sun.star.comp.PPPOptimizer:optimize" 94cdf0e10cSrcweiroTrans.parsestrict(oUrl) 95cdf0e10cSrcweir 96cdf0e10cSrcweirDim oDoc As Object 97cdf0e10cSrcweirDim FileProperties(0) As New com.sun.star.beans.PropertyValue 98cdf0e10cSrcweiroSM = CreateObject("com.sun.star.ServiceManager") 99cdf0e10cSrcweiroDesk = oSM.createInstance("com.sun.star.frame.Desktop") 100cdf0e10cSrcweiroDoc = oDesk.loadComponentFromURL( url, "_blank", 0, FileProperties() ) 101cdf0e10cSrcweir 102cdf0e10cSrcweirDim oInitialization( 0 ) as Object 103cdf0e10cSrcweiroInitialization(0) = oDoc.getCurrentController.getFrame 104*8c5bb9c6SAriel Constenla-HaileoPPPOptimizerDialog = createUNOservice("com.sun.star.comp.presentation.PresentationOptimizer") 105cdf0e10cSrcweiroPPPOptimizerDialog.initialize( oInitialization ) 106cdf0e10cSrcweiroPPPOptimizerDialog.dispatch(oURL, oArg) 107cdf0e10cSrcweirodoc.dispose 108cdf0e10cSrcweirEnd Sub 109cdf0e10cSrcweir 110