aspose_slides_cloud 22.12.0 → 23.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7e5e3edfea8959c86da77680457e105c2243313f84979618f02e9fe71383cce
4
- data.tar.gz: adff1df0046e43a07aea6e38a606832d000d30c24a59442c6ee19b6a5241a926
3
+ metadata.gz: 88aefb794bb45689427bc94bad2b71e04b7782c233cc7ca3603cf4981632a63b
4
+ data.tar.gz: 1f64270f680c341dc4feb2a8601e805a98c98ce03e3b320c89b603802431c7a0
5
5
  SHA512:
6
- metadata.gz: c0acd705fa8ca5d2ca3b3fa3661c6ae284b0f824846466b1a31f4831de270c968d3ab0851d98900ee9bcb4127eeecc4f3d81531e56aa4008e990066d66f6d639
7
- data.tar.gz: 8e0b1791ad44661fa1fb2245a994b48913f9c1bb1f7f2a114694b86654fb96afe39db34e79a7b5d45c86a4979a13fc60eab51f0e56ff2eea1a32ecb6c36f9797
6
+ metadata.gz: c6515a09b27e503bd140fe62cb9699f2b8c2c51443003b11d70a26fcc606b09c88527c19ae824ad0bdf413df97f14436e2cd925cba3e5478d39c11f507fdcf1f
7
+ data.tar.gz: 5dda87bc716166e759da340cd843dfb6cb43c9b7a1d49931a69fc1c0d1c7be319a4c7f371dc7f355cc81aea3c8bf4128e5f0d3c04e3e39e4d08c1e653e7a0a30
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aspose_slides_cloud (22.12.0)
4
+ aspose_slides_cloud (23.1.0)
5
5
  faraday (~> 0.17, >= 0.17.3)
6
6
  json (~> 2.1, >= 2.1.0)
7
7
 
@@ -25,7 +25,7 @@ GEM
25
25
  ffi (1.15.5)
26
26
  hashdiff (1.0.1)
27
27
  json (2.6.3)
28
- multipart-post (2.2.3)
28
+ multipart-post (2.3.0)
29
29
  public_suffix (5.0.1)
30
30
  rake (12.3.3)
31
31
  rexml (3.2.5)
@@ -35,10 +35,10 @@ GEM
35
35
  rspec-mocks (~> 3.12.0)
36
36
  rspec-core (3.12.0)
37
37
  rspec-support (~> 3.12.0)
38
- rspec-expectations (3.12.1)
38
+ rspec-expectations (3.12.2)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.12.0)
41
- rspec-mocks (3.12.1)
41
+ rspec-mocks (3.12.3)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
43
  rspec-support (~> 3.12.0)
44
44
  rspec-support (3.12.0)
data/README.md CHANGED
@@ -27,96 +27,9 @@ You may want to check out Aspose free [Powerpoint to PDF](https://products.aspos
27
27
  **Web:** HTML/HTML5
28
28
  **Other:** MPEG4, SWF (export whole presentations)
29
29
 
30
- ## Enhancements in Version 22.9
31
-
32
- * Added new **ReplaceFont** and **ReplaceFontOnline** methods that allow replacing presentation fonts.
33
- * Added new **SetEmbeddedFontFromRequest** and **SetEmbeddedFontFromRequestOnline** that allow to embed fonts without uploading them to the storage.
34
- * Added an optional **fontsFolder** parameter to **SetEmbeddedFont** and **SetEmbeddedFontOnline** methods to enable using custom fonts with those methods.
35
- * Added **FontSubstRules** property to **ExportOptions** class to allow specifying font substitution rules in conversion methods.
36
- * Added an optional **group** parameter to **ImportImagesFromSvg** method to allow importing SVG images as a GroupShape.
37
- * Added new **CreateSmartArtNode** and **DeleteSmartArtNode** methods to manage individual nodes in SmartArt shapes.
38
- * Added **FillFomat**, **LineFormat**, **EffectFormat** and **ThreeDFormat** properties to **DataPoint** class that allow formatting individual chart data points.
39
-
40
- ## Enhancements in Version 22.8
41
-
42
- * With new **GetFonts** and **GetFontsOnline** methods you can get a list for fonts used in the presentation.
43
- * Added new **SetEmbeddedFont**, **SetEmbeddedFontOnline**, **DeleteEmbeddedFont** and **DeleteEmbeddedFontOnline** methods to embed/unembed presentation fonts.
44
- * Added new **ImportImagesFromSvg** method to import SVG images as individual geometry shapes.
45
-
46
- ## Enhancements in Version 22.7
47
-
48
- * Added **Html**, **Pdf**, **Xps**, **Pptx**, **Odp**, **Otp**, **Ppt**, **Pps**, **Ppsx**, **Pptm**, **Ppsm**, **Potx**, **Pot**, **Potm**, **Svg**, **Fodp**, **Xaml**, **Html5** to the list of allowed values for **SlideExportFormat** enum. You can now export slide notes to those formats.
49
- * Added **Html5** to the list of allowed values for **SlideExportFormat** enum. You can now export individual slides to HTML5.
50
- * Added **Url** to the list of allowed values for **PresentationToMerge.SourceEnum** enum. You can now merge presentations from external URLs.
51
- * New **DeleteUnusedMasterSlides** and **DeleteUnusedMasterSlidesOnline** methods.
52
- * New **SetChartAxis**, **SetChartLegend**, **SetChartWall** methods allow to moduly chart elements more conveniently.
53
- * **UpdateChartSeriesGroup** method was renamed to **SetChartSeriesGroup**.
54
-
55
- ## Enhancements in Version 22.6
56
- * Added ned **GetSubshapeParagraphEffective**, **GetParagraphEffective** and **GetSubshapePortionEffective**, **GetPortionEffective** methods to retrieve actual format values for paragraphs and portions, whether they are inherited from parent entities or not.
57
- * Password parameter is now optional for **GetProtectionProperties** method. So, you don't need to specify the password to check whether a presentation has a password.
58
- * Added new **ChartSeriesGroup** class and **SeriesGroups** property to **Chart** class to enable managing chart series groups. Added new **UpdateChartSeriesGroup** method.
59
- * Added **HasRoundedCorners** property to **Chart** class.
60
- * Added **InvertIfNegative** property to **OneValueChartDataPoint** class.
61
- * Changed **FormatScheme** class to return actual format values instead of resource links.
62
-
63
- ## Enhancements in Version 22.5
64
- * Added **Paragraphs** property to **SmartArtNode** class to enable getting and setting text for SmartArt nodes.
65
- * Added **ImageTransformList** property to **PictureFill** class to enable setting image transform effects. Added **ImageTransformEffect** class and subclasses for different kind of of effects.
66
- * Added **PictureFillFormat** property to **VideoFrame** class to enable setting poster image for video frames.
67
- * Added **SlideIndex** and **ShapeIndex** properties to **ResourceUri** class to simplify retrieveing slide & shape indexes for resources.
68
- * Removed redundant **BoxAndWhiskersSeries**, **WaterfallSeries** and **WaterfallChartDataPoint** classes.
69
-
70
- ## Enhancements in Version 22.4
71
- * Added **TransitionType** and **SlidesTransitionDuration** properties to **VideoExportOptions** class to enable creation videos with transitions.
72
- * Added **DefaultPortionFormat** property to **Paragraph** class. Added new **PortionFormat** class.
73
- * Added **EmbeddedFileBase64Data** and a number of other properties to **OleObjectFrame** class to enable creation of OLE Object frames.
74
- * Added **AccessPermissions** class to support access permissions for PDF export.
75
- * Added **PictureFillformat** property to **AudioFrame** class.
76
- * Added **RowIndex** and **ColumnIndex** properties to **TableCell** class.
77
- * Moved **Width** and **Height** properties from **ExportOptions** base class to the new **ImageExportOptionsBase class**. This is a superclass for **ImageExportOptions**, **GifExportOptions** and **TiffExportOptions** classes.
78
- * Removed redundant **Shapes** property from **ShapeBase** class. It is only left for **GroupShape** class.
79
-
80
- ## Enhancements in Version 22.3
81
- * Added **ModernSlideComment** class to support modern comments. Also added **SlideCommentBase** as base class for comments.
82
- * Added optional **shapeIndex** parameter to **CreateComment** and **CreateCommentOnline** methods.
83
- * Added **GetParagraphRectangle**, **GetPortionRectangle** method and new **TextBounds** class to get paragraph or portion bounds.
84
- * Added optional **shapeType** parameter for **GetShapes** method. You can now get list of shapes of a particular type (e.g. charts or tables).
85
- * Added **FontFallbackRules** class and **FontFallbackRules** property to **ExportOptions** class.
86
- * Added **LatinFont**, **EastAsianFont** and **ComplexScriptFont** properties to **Portion** class to enable getting and seting portion font name.
87
- * Added **ChartLinesFormat** class; added **MajorGridLinesFormat** and **MinorGridLinesFormat** properties to Axis class.
88
- * Added **HideLegend** boolean property to **Legend** class.
89
-
90
- ## Enhancements in Version 22.2
91
- * Added **Mpeg4** to the list of allowed values for **ExportFormat** type. You can now convert presentations to video.
92
- * New **HighlightShapeText** and **HighlightShapeRegex** methods.
93
- * New **DeleteUnusedLayoutSlides** and **DeleteUnusedLayoutSlides** methods.
94
- * New **ZoomFrame** and **ZoomObject** classes with a number of subclasses.
95
- * Added **TextFrameFormat** property to **Shape** class to support WordArt.
96
- * Added **XYSeries** class as a supercalss for **ScatterSeries** and **BubbleSeries** methods.
97
- * Added **None** to the list of allowed values for **TimeUnitType** enum type.
98
- * **Level** property of **Category** class is deprecated and will be removed after v22.4.
99
-
100
- ## Enhancements in Version 22.11
101
-
102
- * You can now specify data sources for chart elements. This is done with new **DataSource** type which is use with propertries **Chart.DataSourceForCategories**, **Series.DataSourceForName**, **OneValueSeries.DataSourceForValues**, **XYSeries.DataSourceForXValues**, **XYSeries.DataSourceForYValues**, **BubbleSeries.DataSourceForBubbleSizeValues**.
103
- * You can now specify formulas for data points using new properties **OneValueChartDataPoint.ValueFormula**, **ScatterChartDataPoint.XValueFormula**, **ScatterChartDataPoint.YValueFormula**, **BubbleChartDataPoint.BubbleSizeFormula**.
104
- * Added boolean **UseFrameSize** and **UseFrameRotation** properties to **SvgExportOptions** class.
105
-
106
- ## Enhancements in Version 22.10
107
-
108
- * Added new **GetSlideShowProperties** and **SetSlideShowProperties** methods to get & set slideshow properties.
109
- * Methods that work with shapes, paragraphs and portions now have an optional **subShape** parameter which can be used to access subshapes (SmartArt elements, grouped shapes). Separate methods for subshapes (**GetSubshapeParagraphs**, **CreateSubshape**, **AlignSubshapes** etc.) have been removed.
110
- * Added boolean **RepeatUntilEndSlide** and **RepeatUntilNextClick** properties to **Effect** class.
111
-
112
- ## Enhancements in Version 22.1
113
- * New **MathParagraph** property of **Portion** class allows to get and set math formulas. A set of **MathElement** subclasses allows to specify complex mathematical expressions.
114
- * New **DownloadPortionAsMathMl** and **SavePortionAsMathMl** methods allow to export math formulas to MathML format.
115
- * New **HyperlinkClick** and **HyperlinkMouseOver** methods of **ShapeBase** and **Portion** classes enable creation and manipulating hyperlinks for shapes and portions.
116
- * New methods **GetShapeGeometryPath** and **SetShapeGeometryPath** can be used to get or set geometry paths for shapes. You can use lines, arcs and curves to specify custom shape boundaries.
117
- * New **AlignSubshapes** method enables aligning shapes within a shape group.
118
- * New **PlayAcrossSlides** and **RewindAudio** properties are added to **AudioFrame** class.
119
- * Added **InClickSequence** to the list of allowable values for **AudioPlayModePreset** and **AudioPlayModePreset** enum types.
30
+ ## Enhancements in Version 23.1
31
+
32
+ * New **CompressEmbeddedFonts** and **CompressEmbeddedFontsOnline** methods allow to reduce the size taken by embedded fonts by excluding unused characters.
120
33
 
121
34
  ## Licensing
122
35
  All Aspose.Slides Cloud SDKs are licensed under MIT License.
@@ -209,6 +209,115 @@ module AsposeSlidesCloud
209
209
  :return_type => 'Shapes')
210
210
  return data, status_code, headers
211
211
  end
212
+ # Compresses embedded fonts by removing unused characters.
213
+ # @param name Document name.
214
+ # @param password Document password.
215
+ # @param folder Document folder.
216
+ # @param storage Document storage.
217
+ def compress_embedded_fonts(name, password = nil, folder = nil, storage = nil)
218
+ compress_embedded_fonts_with_http_info(name, password, folder, storage)
219
+ nil
220
+ end
221
+
222
+ # Compresses embedded fonts by removing unused characters.
223
+ # @param name Document name.
224
+ # @param password Document password.
225
+ # @param folder Document folder.
226
+ # @param storage Document storage.
227
+ def compress_embedded_fonts_with_http_info(name, password = nil, folder = nil, storage = nil)
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug 'Calling API: SlidesApi.compress_embedded_fonts ...'
230
+ end
231
+
232
+ # verify the required parameter 'name' is set
233
+ if @api_client.config.client_side_validation && name.nil?
234
+ fail ArgumentError, "Missing the required parameter 'name' when calling SlidesApi.compress_embedded_fonts"
235
+ end
236
+ # resource path
237
+ local_var_path = '/slides/{name}/fonts/embedded/compress'
238
+ local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)
239
+
240
+ # query parameters
241
+ query_params = {}
242
+ query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?
243
+ query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?
244
+
245
+ # header parameters
246
+ header_params = {}
247
+ # HTTP header 'Accept' (if needed)
248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
249
+ # HTTP header 'Content-Type'
250
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
251
+ header_params[:'password'] = password unless password.nil?
252
+
253
+ # http body (model)
254
+ post_body = nil
255
+
256
+ # form parameters
257
+ post_files = []
258
+
259
+ auth_names = ['JWT']
260
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
261
+ :header_params => header_params,
262
+ :query_params => query_params,
263
+ :body => post_body,
264
+ :files => post_files,
265
+ :auth_names => auth_names)
266
+ return data, status_code, headers
267
+ end
268
+ # Compresses embedded fonts by removing unused characters.
269
+ # @param document Document data.
270
+ # @param password Document password.
271
+ def compress_embedded_fonts_online(document, password = nil)
272
+ data, _status_code, _headers = compress_embedded_fonts_online_with_http_info(document, password)
273
+ data
274
+ end
275
+
276
+ # Compresses embedded fonts by removing unused characters.
277
+ # @param document Document data.
278
+ # @param password Document password.
279
+ def compress_embedded_fonts_online_with_http_info(document, password = nil)
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug 'Calling API: SlidesApi.compress_embedded_fonts_online ...'
282
+ end
283
+
284
+ # verify the required parameter 'document' is set
285
+ if @api_client.config.client_side_validation && document.nil?
286
+ fail ArgumentError, "Missing the required parameter 'document' when calling SlidesApi.compress_embedded_fonts_online"
287
+ end
288
+ # resource path
289
+ local_var_path = '/slides/fonts/embedded/compress'
290
+
291
+ # query parameters
292
+ query_params = {}
293
+
294
+ # header parameters
295
+ header_params = {}
296
+ # HTTP header 'Accept' (if needed)
297
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
298
+ # HTTP header 'Content-Type'
299
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
300
+ header_params[:'password'] = password unless password.nil?
301
+
302
+ # http body (model)
303
+ post_body = nil
304
+
305
+ # form parameters
306
+ post_files = []
307
+ if document
308
+ post_files = post_files.push(document)
309
+ end
310
+
311
+ auth_names = ['JWT']
312
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
313
+ :header_params => header_params,
314
+ :query_params => query_params,
315
+ :body => post_body,
316
+ :files => post_files,
317
+ :auth_names => auth_names,
318
+ :return_type => 'File')
319
+ return data, status_code, headers
320
+ end
212
321
  # Convert presentation from request content to format specified.
213
322
  # @param document Document data.
214
323
  # @param format Export format.
@@ -21,5 +21,5 @@ SOFTWARE.
21
21
  =end
22
22
 
23
23
  module AsposeSlidesCloud
24
- VERSION = '22.12.0'
24
+ VERSION = '23.1.0'
25
25
  end
@@ -636,6 +636,179 @@ describe 'SlidesApi' do
636
636
  end
637
637
  end
638
638
 
639
+ # unit tests for compress_embedded_fonts
640
+ # Compresses embedded fonts by removing unused characters.
641
+ # @param name Document name.
642
+ # @param [Hash] opts the optional parameters
643
+ # @option opts [String] :password Document password.
644
+ # @option opts [String] :folder Document folder.
645
+ # @option opts [String] :storage Document storage.
646
+ # @return [nil]
647
+ describe 'compress_embedded_fonts test' do
648
+ it 'should work' do
649
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'CompressEmbeddedFonts', 'String')
650
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFonts', 'String')
651
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'CompressEmbeddedFonts', 'String')
652
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'CompressEmbeddedFonts', 'String')
653
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFonts', nil, nil)
654
+ o, c, _h = AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_with_http_info(paramname, parampassword, paramfolder, paramstorage)
655
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', nil, nil, nil)
656
+ expect(c).to eq(code)
657
+ end
658
+
659
+ it 'invalid name' do
660
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'CompressEmbeddedFonts', 'String')
661
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFonts', 'String')
662
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'CompressEmbeddedFonts', 'String')
663
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'CompressEmbeddedFonts', 'String')
664
+ paramname = AsposeSlidesCloud::SpecUtils.invalidize_param_value('name', 'CompressEmbeddedFonts', paramname, 'String')
665
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFonts', 'name', paramname)
666
+ begin
667
+ AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_with_http_info(paramname, parampassword, paramfolder, paramstorage)
668
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('CompressEmbeddedFonts', 'name')
669
+ fail "An exception expected"
670
+ end
671
+ rescue AsposeSlidesCloud::ApiError => e
672
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'name', paramname, 'String')
673
+ expect(e.code).to eq(code)
674
+ expect(e.response_body).to include(message)
675
+ rescue ArgumentError => e
676
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'name', paramname, 'String')
677
+ expect(400).to eq(code)
678
+ expect(e.message).to include(message)
679
+ end
680
+ end
681
+
682
+ it 'invalid password' do
683
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'CompressEmbeddedFonts', 'String')
684
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFonts', 'String')
685
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'CompressEmbeddedFonts', 'String')
686
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'CompressEmbeddedFonts', 'String')
687
+ parampassword = AsposeSlidesCloud::SpecUtils.invalidize_param_value('password', 'CompressEmbeddedFonts', parampassword, 'String')
688
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFonts', 'password', parampassword)
689
+ begin
690
+ AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_with_http_info(paramname, parampassword, paramfolder, paramstorage)
691
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('CompressEmbeddedFonts', 'password')
692
+ fail "An exception expected"
693
+ end
694
+ rescue AsposeSlidesCloud::ApiError => e
695
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'password', parampassword, 'String')
696
+ expect(e.code).to eq(code)
697
+ expect(e.response_body).to include(message)
698
+ rescue ArgumentError => e
699
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'password', parampassword, 'String')
700
+ expect(400).to eq(code)
701
+ expect(e.message).to include(message)
702
+ end
703
+ end
704
+
705
+ it 'invalid folder' do
706
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'CompressEmbeddedFonts', 'String')
707
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFonts', 'String')
708
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'CompressEmbeddedFonts', 'String')
709
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'CompressEmbeddedFonts', 'String')
710
+ paramfolder = AsposeSlidesCloud::SpecUtils.invalidize_param_value('folder', 'CompressEmbeddedFonts', paramfolder, 'String')
711
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFonts', 'folder', paramfolder)
712
+ begin
713
+ AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_with_http_info(paramname, parampassword, paramfolder, paramstorage)
714
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('CompressEmbeddedFonts', 'folder')
715
+ fail "An exception expected"
716
+ end
717
+ rescue AsposeSlidesCloud::ApiError => e
718
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'folder', paramfolder, 'String')
719
+ expect(e.code).to eq(code)
720
+ expect(e.response_body).to include(message)
721
+ rescue ArgumentError => e
722
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'folder', paramfolder, 'String')
723
+ expect(400).to eq(code)
724
+ expect(e.message).to include(message)
725
+ end
726
+ end
727
+
728
+ it 'invalid storage' do
729
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'CompressEmbeddedFonts', 'String')
730
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFonts', 'String')
731
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'CompressEmbeddedFonts', 'String')
732
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'CompressEmbeddedFonts', 'String')
733
+ paramstorage = AsposeSlidesCloud::SpecUtils.invalidize_param_value('storage', 'CompressEmbeddedFonts', paramstorage, 'String')
734
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFonts', 'storage', paramstorage)
735
+ begin
736
+ AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_with_http_info(paramname, parampassword, paramfolder, paramstorage)
737
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('CompressEmbeddedFonts', 'storage')
738
+ fail "An exception expected"
739
+ end
740
+ rescue AsposeSlidesCloud::ApiError => e
741
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'storage', paramstorage, 'String')
742
+ expect(e.code).to eq(code)
743
+ expect(e.response_body).to include(message)
744
+ rescue ArgumentError => e
745
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFonts', 'storage', paramstorage, 'String')
746
+ expect(400).to eq(code)
747
+ expect(e.message).to include(message)
748
+ end
749
+ end
750
+ end
751
+
752
+ # unit tests for compress_embedded_fonts_online
753
+ # Compresses embedded fonts by removing unused characters.
754
+ # @param document Document data.
755
+ # @param [Hash] opts the optional parameters
756
+ # @option opts [String] :password Document password.
757
+ # @return [File]
758
+ describe 'compress_embedded_fonts_online test' do
759
+ it 'should work' do
760
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'CompressEmbeddedFontsOnline', 'File')
761
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFontsOnline', 'String')
762
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFontsOnline', nil, nil)
763
+ o, c, _h = AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_online_with_http_info(paramdocument, parampassword)
764
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFontsOnline', nil, nil, nil)
765
+ expect(c).to eq(code)
766
+ expect(o).not_to be_nil
767
+ end
768
+
769
+ it 'invalid document' do
770
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'CompressEmbeddedFontsOnline', 'File')
771
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFontsOnline', 'String')
772
+ paramdocument = AsposeSlidesCloud::SpecUtils.invalidize_param_value('document', 'CompressEmbeddedFontsOnline', paramdocument, 'File')
773
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFontsOnline', 'document', paramdocument)
774
+ begin
775
+ AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_online_with_http_info(paramdocument, parampassword)
776
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('CompressEmbeddedFontsOnline', 'document')
777
+ fail "An exception expected"
778
+ end
779
+ rescue AsposeSlidesCloud::ApiError => e
780
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFontsOnline', 'document', paramdocument, 'File')
781
+ expect(e.code).to eq(code)
782
+ expect(e.response_body).to include(message)
783
+ rescue ArgumentError => e
784
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFontsOnline', 'document', paramdocument, 'File')
785
+ expect(400).to eq(code)
786
+ expect(e.message).to include(message)
787
+ end
788
+ end
789
+
790
+ it 'invalid password' do
791
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'CompressEmbeddedFontsOnline', 'File')
792
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'CompressEmbeddedFontsOnline', 'String')
793
+ parampassword = AsposeSlidesCloud::SpecUtils.invalidize_param_value('password', 'CompressEmbeddedFontsOnline', parampassword, 'String')
794
+ AsposeSlidesCloud::SpecUtils.initialize('CompressEmbeddedFontsOnline', 'password', parampassword)
795
+ begin
796
+ AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_online_with_http_info(paramdocument, parampassword)
797
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('CompressEmbeddedFontsOnline', 'password')
798
+ fail "An exception expected"
799
+ end
800
+ rescue AsposeSlidesCloud::ApiError => e
801
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFontsOnline', 'password', parampassword, 'String')
802
+ expect(e.code).to eq(code)
803
+ expect(e.response_body).to include(message)
804
+ rescue ArgumentError => e
805
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('CompressEmbeddedFontsOnline', 'password', parampassword, 'String')
806
+ expect(400).to eq(code)
807
+ expect(e.message).to include(message)
808
+ end
809
+ end
810
+ end
811
+
639
812
  # unit tests for convert
640
813
  # Convert presentation from request content to format specified.
641
814
  # @param document Document data.
@@ -78,6 +78,27 @@ describe 'UseCases' do
78
78
  expect(response.size).not_to eq(sourceDocument.size)
79
79
  end
80
80
 
81
+ it "compress embedded fonts" do
82
+ folder_name = "TempSlidesSDK"
83
+ file_name = "test.pptx"
84
+ font_name = "Calibri"
85
+ AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
86
+ response = AsposeSlidesCloud::SpecUtils.api.set_embedded_font(file_name, font_name, false, "password", folder_name)
87
+ expect(response.list[2].is_embedded).to eq(true)
88
+ #In a real world example, you would rather get the same result by calling set_embedded_font with onlyUsed = true
89
+ AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts(file_name, "password", folder_name)
90
+ end
91
+
92
+ it "compress embedded fonts online" do
93
+ source = File.binread("TestData/test.pptx")
94
+ font_name = "Calibri"
95
+ response_embedded = AsposeSlidesCloud::SpecUtils.api.set_embedded_font_online(source, font_name, false, "password")
96
+ expect(response_embedded.size).not_to eq(source.size)
97
+ #In a real world example, you would rather get the same result by calling set_embedded_font with onlyUsed = true
98
+ response_compressed = AsposeSlidesCloud::SpecUtils.api.compress_embedded_fonts_online(response_embedded, "password")
99
+ expect(response_compressed.size).to be < response_embedded.size
100
+ end
101
+
81
102
  it "delete embedded font" do
82
103
  folder_name = "TempSlidesSDK"
83
104
  file_name = "test.pptx"
data/testRules.json CHANGED
@@ -18,7 +18,8 @@
18
18
  { "Action": "Delete", "Folder": "TempSlidesSDKinvalid", "File": "changedtest.pptx", "Method": "/CreatePresentationFrom/" },
19
19
  { "Action": "Delete", "Folder": "invalidTempSlidesSDK", "File": "test.pptx", "Method": "/CreatePresentationFrom/" },
20
20
  { "Action": "Delete", "Folder": "invalidTempSlidesSDK", "File": "test.pptx", "Parameter": "CloneFrom" },
21
- { "Action": "Delete", "Folder": "invalidTempSlidesSDK", "File": "test.pptx", "Parameter": "/S.?.?rc.?Path/" }
21
+ { "Action": "Delete", "Folder": "invalidTempSlidesSDK", "File": "test.pptx", "Parameter": "/S.?.?rc.?Path/" },
22
+ { "Action": "Delete", "Folder": "", "File": "NewTestFolder", "Method": "CreateFolder" }
22
23
  ],
23
24
  "Values": [
24
25
  { "Value": "test%n", "InvalidValue": "%vinvalid" },
@@ -78,6 +79,7 @@
78
79
  { "Value": null, "Parameter": "SubNode" },
79
80
  { "Value": null, "Parameter": "SubShape" },
80
81
  { "Value": "TempSlidesSDK/test.pptx", "InvalidValue": "invalid%v", "Parameter": "/Path/" },
82
+ { "Value": "NewTestFolder", "Parameter": "Path", "Method": "CreateFolder" },
81
83
  { "Value": "TempSlidesSDK", "Parameter": "Path", "Method": "DeleteFolder" },
82
84
  { "Value": "TempSlidesSDK/changedtest.pptx", "Parameter": "DestPath" },
83
85
  { "Value": "TempSlidesSDK/test.pptx", "InvalidValue": "invalid%v", "Parameter": "CloneFrom" },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_slides_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.12.0
4
+ version: 23.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Putrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-24 00:00:00.000000000 Z
11
+ date: 2023-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday