bump product version to 4.1.6.2
[LibreOffice.git] / sdext / source / minimizer / basic.txt
blob2ff6286018d941a66497b882236cd8ba1c893808
2 ' This file is part of the LibreOffice project.
4 ' This Source Code Form is subject to the terms of the Mozilla Public
5 ' License, v. 2.0. If a copy of the MPL was not distributed with this
6 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 ' This file incorporates work covered by the following license notice:
10 '   Licensed to the Apache Software Foundation (ASF) under one or more
11 '   contributor license agreements. See the NOTICE file distributed
12 '   with this work for additional information regarding copyright
13 '   ownership. The ASF licenses this file to you under the Apache
14 '   License, Version 2.0 (the "License"); you may not use this file
15 '   except in compliance with the License. You may obtain a copy of
16 '   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 Sub Main
20 Dim oSettings(11) as new com.sun.star.beans.PropertyValue
21 oSettings(0).Name = "JPEGCompression"
22 oSettings(0).Value= True
23 oSettings(1).Name = "JPEGQuality"
24 oSettings(1).Value= 25
25 oSettings(2).Name = "RemoveCropArea"
26 oSettings(2).Value= True
27 oSettings(3).Name = "ImageResolution"
28 oSettings(3).Value= 90
29 oSettings(4).Name = "OLEOptimization"
30 oSettings(4).Value= False
31 oSettings(5).Name = "OLEOptimizationType"
32 oSettings(5).Value= 1
33 oSettings(6).Name = "DeleteUnusedMasterPages"
34 oSettings(6).Value= True
35 oSettings(7).Name = "DeleteHiddenSlides"
36 oSettings(7).Value= True
37 oSettings(8).Name = "DeleteNotesPages"
38 oSettings(8).Value= True
39 oSettings(9).Name = "SaveAs"
40 oSettings(9).Value= true
41 oSettings(10).Name = "EmbedLinkedGraphics"
42 oSettings(10).Value = false
43 oSettings(11).Name = "SaveAsURL"
44 oSettings(11).Value = ""
45 oSettings(12).Name = "FilterName"
46 oSettings(12).Value = "impress8"
50 Dim oArg(0) as new com.sun.star.beans.PropertyValue
51 oArg(0).Name = "Settings"
52 oArg(0).Value= oSettings
54 Dim url As String
55 Dim oPresentations(17) as String
56 oPresentations( 0)="d:\data\sunpresentations\01-22-07SunIntelAnnouncementPresentation,01-22-2007.star_impress_8x.odp"
57 oPresentations( 1)="d:\data\sunpresentations\01_Schwartz_SAS_VF.odp"
58 oPresentations( 2)="d:\data\sunpresentations\CorporateSocialResponsibilityCustomerPresentation,02-12-2007.star_impress_8x.odp"
59 oPresentations( 3)="d:\data\sunpresentations\Current-ProjectBlackboxCustomerPresentation,03-07-2007.star_impress_8x.odp"
60 oPresentations( 4)="d:\data\sunpresentations\JavaSE6CustomerPresentation,12-11-2006(2).star_impress_8x.odp"
61 oPresentations( 5)="d:\data\sunpresentations\JavaSE6CustomerPresentation,12-11-2006.star_impress_8x.odp"
62 oPresentations( 6)="d:\data\sunpresentations\NetworkComputingLaunchPresentation,Q22006,Washington,DC,05-08-2006.star_impress_8x.odp"
63 oPresentations( 7)="d:\data\sunpresentations\ProjectBlackboxTechnicalPresentation-NDAONLY,11-09-2006.star_impress_8x.odp"
64 oPresentations( 8)="d:\data\sunpresentations\ScottMcNealy,IntlAssocofPrivacyProfessionals)ConferenceOpeningKeynote,'PlayingonSunday-GettingPrivacyRight',March,8,2007,Washington,DC,,03-08-2007.star_impress_8x.odp"
65 oPresentations( 9)="d:\data\sunpresentations\Sun'sStoragetekAcademy-JonathanSchwartzTheSky'sTheLimit!,February,292007,SanFrancisco,CA,02-28-2007.star_impress_8x.odp"
66 oPresentations(10)="d:\data\sunpresentations\SunAnalystSummit2007(SAS)-DonGranthamExecutingonStrategy,February,6,2007,SanFrancisco,CA,02-07-2007.star_impress_8x.odp"
67 oPresentations(11)="d:\data\sunpresentations\SunConsultingServicesPortfolio-Presentation,03-17-2006.star_impress_6x.sxi"
68 oPresentations(12)="d:\data\sunpresentations\SunFedOpenYourMindandSunFedTechDayatGTSI,ScottMcNealy,January23and24,2007,Washington,DC,01-23-2007.star_impress_8x.odp"
69 oPresentations(13)="d:\data\sunpresentations\SunFedTechDaysatAccenture,ScottMcNealy,January24,2007,Washington,DC,01-24-2007.star_impress_8x.odp"
70 oPresentations(14)="d:\data\sunpresentations\SunManagedServicesGoldenPitch,03-22-2007.star_impress_8x.odp"
71 oPresentations(15)="d:\data\sunpresentations\SunServicesEducationServicesGeneralPresentation,01-11-2006.star_impress_6x.sxi"
72 oPresentations(16)="d:\data\sunpresentations\SunSystemPacks-CustomerReadyPresentation,01-23-2007.star_impress_8x.odp"
73 oPresentations(17)="d:\data\sunpresentations\U.S.SalesMeetingCustomerPresentation(08-01-2006),08-01-2006.odp"
75 FOR I = 0 TO 17
76 url=oPresentations( I )
77 oSettings(11)=url+string( I, 2 )
78 url=converttourl( url )
79 optimize( url, oArg() )
80 NEXT I
82 End Sub
84 Sub Optimize( url as String, oArg )
86 Dim oPPPOptimizerDialog as Object
87 Dim oUrl as new com.sun.star.util.URL
88 Dim oTrans as Object
89 oTrans = createUNOService("com.sun.star.util.URLTransformer")
90 oUrl.Complete = "vnd.com.sun.star.comp.PPPOptimizer:optimize"
91 oTrans.parsestrict(oUrl)
93 Dim oDoc As Object
94 Dim FileProperties(0) As New com.sun.star.beans.PropertyValue
95 oSM = CreateObject("com.sun.star.ServiceManager")
96 oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
97 oDoc = oDesk.loadComponentFromURL( url, "_blank", 0, FileProperties() )
99 Dim oInitialization( 0 ) as Object
100 oInitialization(0) = oDoc.getCurrentController.getFrame
101 oPPPOptimizerDialog = createUNOservice("com.sun.star.comp.PPPOptimizerImp")
102 oPPPOptimizerDialog.initialize( oInitialization )
103 oPPPOptimizerDialog.dispatch(oURL, oArg)
104 odoc.dispose
105 End Sub