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