aspose_pdf_cloud 24.7.0 → 24.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -8
- data/docs/OptimizeOptions.md +3 -3
- data/docs/PdfApi.md +54 -0
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +160 -0
- data/lib/aspose_pdf_cloud/api_client.rb +9 -1
- data/lib/aspose_pdf_cloud/models/optimize_options.rb +3 -3
- data/lib/aspose_pdf_cloud/version.rb +1 -1
- data/test/pdf_tests.rb +64 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac5c97cfac0ff947f54e9f380ad0b66d156a49384f5a08ab53d0d89344820a84
|
4
|
+
data.tar.gz: 2fd03bfbf30f838d8dd21514dfe28bcbda7283a1f282beac3b182fa2a49bb131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 780280be54bd6774f28931fbefdf06cf558d08c0bcddb1b7c63d001c84c950fb21fae19ccafb8d7229e4f82f971f9dfebc1d350c45cecb24c1702eb4f0c2b84a
|
7
|
+
data.tar.gz: 13e418921547b8fb7af995fc0b1a4e0b82bfe6f19a3abe2cf1634499cb358fa815ea57c59fee4fe76a2f551dca526b4d02b913564f0f7baaf813214420d03d86
|
data/README.md
CHANGED
@@ -29,13 +29,11 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
|
|
29
29
|
## Read PDF Formats
|
30
30
|
MHT, PCL, PS, XSLFO, MD
|
31
31
|
|
32
|
-
## Enhancements in Version 24.
|
32
|
+
## Enhancements in Version 24.8
|
33
|
+
- Adding Text stamps to multiple pages.
|
34
|
+
- Adding Image stamps to multiple pages.
|
33
35
|
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
|
34
36
|
|
35
|
-
## Bugs fixed in Version 24.7
|
36
|
-
- PutPsInStorageToPdf throws: Cannot find resource ‘Aspose.PDF.dependencies.ZapfDingbats.ttf.
|
37
|
-
- Ocr method is not working.
|
38
|
-
|
39
37
|
## Installation
|
40
38
|
|
41
39
|
### Build a gem
|
@@ -49,15 +47,15 @@ gem build aspose_pdf_cloud.gemspec
|
|
49
47
|
Then either install the gem locally:
|
50
48
|
|
51
49
|
```shell
|
52
|
-
gem install ./aspose_pdf_cloud-24.
|
50
|
+
gem install ./aspose_pdf_cloud-24.8.0.gem
|
53
51
|
```
|
54
|
-
(for development, run `gem install --dev ./aspose_pdf_cloud-24.
|
52
|
+
(for development, run `gem install --dev ./aspose_pdf_cloud-24.8.0.gem` to install the development dependencies)
|
55
53
|
|
56
54
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
57
55
|
|
58
56
|
Finally add this to the Gemfile:
|
59
57
|
|
60
|
-
gem 'aspose_pdf_cloud', '~> 24.
|
58
|
+
gem 'aspose_pdf_cloud', '~> 24.8.0'
|
61
59
|
|
62
60
|
### Install from Git
|
63
61
|
|
data/docs/OptimizeOptions.md
CHANGED
@@ -5,16 +5,16 @@ Represents Pdf optimize options.
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
7
|
**password** | **String** | Specifies document password (if any) encoded with base-64. | [optional]
|
8
|
-
**allow_reuse_page_content** | **BOOLEAN** | If true page contents will be reused when document is optimized for equal pages. | [optional]
|
8
|
+
**allow_reuse_page_content** | **BOOLEAN** | If true page contents will be reused when document is optimized for equal pages. LinkDuplcateStreams option must be set to true. | [optional]
|
9
9
|
**compress_images** | **BOOLEAN** | If this flag is set to true images will be compressed in the document. Compression level is specified with ImageQuality property. | [optional]
|
10
10
|
**image_quality** | **Integer** | Specifies level of image compression when CompressImages flag is used. | [optional]
|
11
11
|
**link_duplcate_streams** | **BOOLEAN** | If this flag is set to true, Resource streams will be analyzed. If duplicate streams are found (i.e. if stream contents is equal), then thees streams will be stored as one object. This allows to decrease document size in some cases (for example, when same document was concatenated multiple times). | [optional]
|
12
12
|
**remove_unused_objects** | **BOOLEAN** | If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does not have any reference) are removed from document. | [optional]
|
13
13
|
**remove_unused_streams** | **BOOLEAN** | If this flag set to true, every resource is checked on it's usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document. | [optional]
|
14
|
-
**unembed_fonts** | **BOOLEAN** | Make fonts not embedded if set to true.
|
14
|
+
**unembed_fonts** | **BOOLEAN** | Make fonts not embedded if set to true. Unembedding a font means removing the embedded byte stream data of the font included in a PDF document. | [optional]
|
15
15
|
**resize_images** | **BOOLEAN** | If this flag set to true and CompressImages is true images will be resized if image resolution is greater then specified MaxResolution parameter. | [optional]
|
16
16
|
**max_resolution** | **Integer** | Specifies maximum resolution of images. If image has higher resolution it will be scaled. | [optional]
|
17
|
-
**subset_fonts** | **BOOLEAN** | Fonts will be converted into subsets if set to true. | [optional]
|
17
|
+
**subset_fonts** | **BOOLEAN** | Fonts will be converted into subsets if set to true. Only those characters that are actually used in the layout are stored in the PDF. | [optional]
|
18
18
|
**remove_private_info** | **BOOLEAN** | Remove private information (page piece info). | [optional]
|
19
19
|
**image_encoding** | [**ImageEncoding**](ImageEncoding.md) | Image encode which will be used. | [optional]
|
20
20
|
**image_compression_version** | [**ImageCompressionVersion**](ImageCompressionVersion.md) | Version of compression algorithm. Possible values are: "Standard" - standard compression, "Fast" - fast (improved compression which is faster then standard but may be applicable not for all images), "Mixed" - mixed (standard compression is applied to images which can not be compressed by faster algorithm, this may give best compression but more slow then "Fast" algorithm. Version "Fast" is not applicable for resizing images (standard method will be used). Default is "Standard". | [optional]
|
data/docs/PdfApi.md
CHANGED
@@ -203,10 +203,12 @@ Method | HTTP request | Description
|
|
203
203
|
[**post_decrypt_document_in_storage**](PdfApi.md#post_decrypt_document_in_storage) | **POST** /pdf/\{name}/decrypt | Decrypt document in storage.
|
204
204
|
[**post_document_image_footer**](PdfApi.md#post_document_image_footer) | **POST** /pdf/\{name}/footer/image | Add document image footer.
|
205
205
|
[**post_document_image_header**](PdfApi.md#post_document_image_header) | **POST** /pdf/\{name}/header/image | Add document image header.
|
206
|
+
[**post_document_image_stamps**](PdfApi.md#post_document_image_stamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps.
|
206
207
|
[**post_document_page_number_stamps**](PdfApi.md#post_document_page_number_stamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps.
|
207
208
|
[**post_document_text_footer**](PdfApi.md#post_document_text_footer) | **POST** /pdf/\{name}/footer/text | Add document text footer.
|
208
209
|
[**post_document_text_header**](PdfApi.md#post_document_text_header) | **POST** /pdf/\{name}/header/text | Add document text header.
|
209
210
|
[**post_document_text_replace**](PdfApi.md#post_document_text_replace) | **POST** /pdf/\{name}/text/replace | Document's replace text method.
|
211
|
+
[**post_document_text_stamps**](PdfApi.md#post_document_text_stamps) | **POST** /pdf/\{name}/stamps/text | Add document pages text stamps.
|
210
212
|
[**post_encrypt_document_in_storage**](PdfApi.md#post_encrypt_document_in_storage) | **POST** /pdf/\{name}/encrypt | Encrypt document in storage.
|
211
213
|
[**post_flatten_document**](PdfApi.md#post_flatten_document) | **POST** /pdf/\{name}/flatten | Flatten the document.
|
212
214
|
[**post_html_to_pdf**](PdfApi.md#post_html_to_pdf) | **POST** /pdf/create/html | Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
|
@@ -5409,6 +5411,32 @@ Name | Type | Description | Notes
|
|
5409
5411
|
|
5410
5412
|
|
5411
5413
|
|
5414
|
+
# **post_document_image_stamps**
|
5415
|
+
> AsposeResponse post_document_image_stamps(name, stamps, opts)
|
5416
|
+
|
5417
|
+
Add document pages image stamps.
|
5418
|
+
|
5419
|
+
### Parameters
|
5420
|
+
|
5421
|
+
Name | Type | Description | Notes
|
5422
|
+
------------- | ------------- | ------------- | -------------
|
5423
|
+
**name** | **String**| The document name. |
|
5424
|
+
**stamps** | [**Array<ImageStamp>**](ImageStamp.md)| The array of stamp. |
|
5425
|
+
**storage** | **String**| The document storage. | [optional]
|
5426
|
+
**folder** | **String**| The document folder. | [optional]
|
5427
|
+
**password** | **String**| Base64 encoded password. | [optional]
|
5428
|
+
|
5429
|
+
### Return type
|
5430
|
+
|
5431
|
+
[**AsposeResponse**](AsposeResponse.md)
|
5432
|
+
|
5433
|
+
### HTTP request headers
|
5434
|
+
|
5435
|
+
- **Content-Type**: application/json
|
5436
|
+
- **Accept**: application/json
|
5437
|
+
|
5438
|
+
|
5439
|
+
|
5412
5440
|
# **post_document_page_number_stamps**
|
5413
5441
|
> AsposeResponse post_document_page_number_stamps(name, stamp, opts)
|
5414
5442
|
|
@@ -5516,6 +5544,32 @@ Name | Type | Description | Notes
|
|
5516
5544
|
|
5517
5545
|
|
5518
5546
|
|
5547
|
+
# **post_document_text_stamps**
|
5548
|
+
> AsposeResponse post_document_text_stamps(name, stamps, opts)
|
5549
|
+
|
5550
|
+
Add document pages text stamps.
|
5551
|
+
|
5552
|
+
### Parameters
|
5553
|
+
|
5554
|
+
Name | Type | Description | Notes
|
5555
|
+
------------- | ------------- | ------------- | -------------
|
5556
|
+
**name** | **String**| The document name. |
|
5557
|
+
**stamps** | [**Array<TextStamp>**](TextStamp.md)| The array of stamp. |
|
5558
|
+
**storage** | **String**| The document storage. | [optional]
|
5559
|
+
**folder** | **String**| The document folder. | [optional]
|
5560
|
+
**password** | **String**| Base64 encoded password. | [optional]
|
5561
|
+
|
5562
|
+
### Return type
|
5563
|
+
|
5564
|
+
[**AsposeResponse**](AsposeResponse.md)
|
5565
|
+
|
5566
|
+
### HTTP request headers
|
5567
|
+
|
5568
|
+
- **Content-Type**: application/json
|
5569
|
+
- **Accept**: application/json
|
5570
|
+
|
5571
|
+
|
5572
|
+
|
5519
5573
|
# **post_encrypt_document_in_storage**
|
5520
5574
|
> AsposeResponse post_encrypt_document_in_storage(name, user_password, owner_password, crypto_algorithm, opts)
|
5521
5575
|
|
@@ -15608,6 +15608,86 @@ module AsposePdfCloud
|
|
15608
15608
|
return data, status_code, headers
|
15609
15609
|
end
|
15610
15610
|
|
15611
|
+
# Add document pages image stamps.
|
15612
|
+
#
|
15613
|
+
# @param name The document name.
|
15614
|
+
# @param stamps The array of stamp.
|
15615
|
+
# @param [Hash] opts the optional parameters
|
15616
|
+
# @option opts [String] :storage The document storage.
|
15617
|
+
# @option opts [String] :folder The document folder.
|
15618
|
+
# @option opts [String] :password Base64 encoded password.
|
15619
|
+
# @return [AsposeResponse]
|
15620
|
+
def post_document_image_stamps(name, stamps, opts = {})
|
15621
|
+
@api_client.request_token_if_needed
|
15622
|
+
data, _status_code, _headers = post_document_image_stamps_with_http_info(name, stamps, opts)
|
15623
|
+
rescue ApiError => error
|
15624
|
+
if error.code == 401
|
15625
|
+
@api_client.request_token_if_needed
|
15626
|
+
data, _status_code, _headers = post_document_image_stamps_with_http_info(name, stamps, opts)
|
15627
|
+
else
|
15628
|
+
raise
|
15629
|
+
end
|
15630
|
+
return data
|
15631
|
+
end
|
15632
|
+
|
15633
|
+
# Add document pages image stamps.
|
15634
|
+
#
|
15635
|
+
# @param name The document name.
|
15636
|
+
# @param stamps The array of stamp.
|
15637
|
+
# @param [Hash] opts the optional parameters
|
15638
|
+
# @option opts [String] :storage The document storage.
|
15639
|
+
# @option opts [String] :folder The document folder.
|
15640
|
+
# @option opts [String] :password Base64 encoded password.
|
15641
|
+
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
15642
|
+
def post_document_image_stamps_with_http_info(name, stamps, opts = {})
|
15643
|
+
if @api_client.config.debugging
|
15644
|
+
@api_client.config.logger.debug "Calling API: PdfApi.post_document_image_stamps ..."
|
15645
|
+
end
|
15646
|
+
# verify the required parameter 'name' is set
|
15647
|
+
if @api_client.config.client_side_validation && name.nil?
|
15648
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.post_document_image_stamps"
|
15649
|
+
end
|
15650
|
+
# verify the required parameter 'stamps' is set
|
15651
|
+
if @api_client.config.client_side_validation && stamps.nil?
|
15652
|
+
fail ArgumentError, "Missing the required parameter 'stamps' when calling PdfApi.post_document_image_stamps"
|
15653
|
+
end
|
15654
|
+
# resource path
|
15655
|
+
local_var_path = "/pdf/{name}/stamps/image".sub('{' + 'name' + '}', name.to_s)
|
15656
|
+
|
15657
|
+
# query parameters
|
15658
|
+
query_params = {}
|
15659
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
15660
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
15661
|
+
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
|
15662
|
+
|
15663
|
+
# header parameters
|
15664
|
+
header_params = {}
|
15665
|
+
# HTTP header 'Accept' (if needed)
|
15666
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
15667
|
+
# HTTP header 'Content-Type'
|
15668
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
15669
|
+
|
15670
|
+
# form parameters
|
15671
|
+
form_params = {}
|
15672
|
+
# Fix header in file
|
15673
|
+
post_body = nil
|
15674
|
+
|
15675
|
+
# http body (model)
|
15676
|
+
post_body = @api_client.object_to_http_body(stamps)
|
15677
|
+
auth_names = ['JWT']
|
15678
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
15679
|
+
:header_params => header_params,
|
15680
|
+
:query_params => query_params,
|
15681
|
+
:form_params => form_params,
|
15682
|
+
:body => post_body,
|
15683
|
+
:auth_names => auth_names,
|
15684
|
+
:return_type => 'AsposeResponse')
|
15685
|
+
if @api_client.config.debugging
|
15686
|
+
@api_client.config.logger.debug "API called: PdfApi#post_document_image_stamps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
15687
|
+
end
|
15688
|
+
return data, status_code, headers
|
15689
|
+
end
|
15690
|
+
|
15611
15691
|
# Add document page number stamps.
|
15612
15692
|
#
|
15613
15693
|
# @param name The document name.
|
@@ -15937,6 +16017,86 @@ module AsposePdfCloud
|
|
15937
16017
|
return data, status_code, headers
|
15938
16018
|
end
|
15939
16019
|
|
16020
|
+
# Add document pages text stamps.
|
16021
|
+
#
|
16022
|
+
# @param name The document name.
|
16023
|
+
# @param stamps The array of stamp.
|
16024
|
+
# @param [Hash] opts the optional parameters
|
16025
|
+
# @option opts [String] :storage The document storage.
|
16026
|
+
# @option opts [String] :folder The document folder.
|
16027
|
+
# @option opts [String] :password Base64 encoded password.
|
16028
|
+
# @return [AsposeResponse]
|
16029
|
+
def post_document_text_stamps(name, stamps, opts = {})
|
16030
|
+
@api_client.request_token_if_needed
|
16031
|
+
data, _status_code, _headers = post_document_text_stamps_with_http_info(name, stamps, opts)
|
16032
|
+
rescue ApiError => error
|
16033
|
+
if error.code == 401
|
16034
|
+
@api_client.request_token_if_needed
|
16035
|
+
data, _status_code, _headers = post_document_text_stamps_with_http_info(name, stamps, opts)
|
16036
|
+
else
|
16037
|
+
raise
|
16038
|
+
end
|
16039
|
+
return data
|
16040
|
+
end
|
16041
|
+
|
16042
|
+
# Add document pages text stamps.
|
16043
|
+
#
|
16044
|
+
# @param name The document name.
|
16045
|
+
# @param stamps The array of stamp.
|
16046
|
+
# @param [Hash] opts the optional parameters
|
16047
|
+
# @option opts [String] :storage The document storage.
|
16048
|
+
# @option opts [String] :folder The document folder.
|
16049
|
+
# @option opts [String] :password Base64 encoded password.
|
16050
|
+
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
16051
|
+
def post_document_text_stamps_with_http_info(name, stamps, opts = {})
|
16052
|
+
if @api_client.config.debugging
|
16053
|
+
@api_client.config.logger.debug "Calling API: PdfApi.post_document_text_stamps ..."
|
16054
|
+
end
|
16055
|
+
# verify the required parameter 'name' is set
|
16056
|
+
if @api_client.config.client_side_validation && name.nil?
|
16057
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.post_document_text_stamps"
|
16058
|
+
end
|
16059
|
+
# verify the required parameter 'stamps' is set
|
16060
|
+
if @api_client.config.client_side_validation && stamps.nil?
|
16061
|
+
fail ArgumentError, "Missing the required parameter 'stamps' when calling PdfApi.post_document_text_stamps"
|
16062
|
+
end
|
16063
|
+
# resource path
|
16064
|
+
local_var_path = "/pdf/{name}/stamps/text".sub('{' + 'name' + '}', name.to_s)
|
16065
|
+
|
16066
|
+
# query parameters
|
16067
|
+
query_params = {}
|
16068
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
16069
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
16070
|
+
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
|
16071
|
+
|
16072
|
+
# header parameters
|
16073
|
+
header_params = {}
|
16074
|
+
# HTTP header 'Accept' (if needed)
|
16075
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
16076
|
+
# HTTP header 'Content-Type'
|
16077
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
16078
|
+
|
16079
|
+
# form parameters
|
16080
|
+
form_params = {}
|
16081
|
+
# Fix header in file
|
16082
|
+
post_body = nil
|
16083
|
+
|
16084
|
+
# http body (model)
|
16085
|
+
post_body = @api_client.object_to_http_body(stamps)
|
16086
|
+
auth_names = ['JWT']
|
16087
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
16088
|
+
:header_params => header_params,
|
16089
|
+
:query_params => query_params,
|
16090
|
+
:form_params => form_params,
|
16091
|
+
:body => post_body,
|
16092
|
+
:auth_names => auth_names,
|
16093
|
+
:return_type => 'AsposeResponse')
|
16094
|
+
if @api_client.config.debugging
|
16095
|
+
@api_client.config.logger.debug "API called: PdfApi#post_document_text_stamps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
16096
|
+
end
|
16097
|
+
return data, status_code, headers
|
16098
|
+
end
|
16099
|
+
|
15940
16100
|
# Encrypt document in storage.
|
15941
16101
|
#
|
15942
16102
|
# @param name Document name.
|
@@ -464,8 +464,16 @@ module AsposePdfCloud
|
|
464
464
|
end
|
465
465
|
|
466
466
|
response = conn.post tokenUrl, form_params, req_opts[:body]
|
467
|
-
|
467
|
+
|
468
|
+
begin
|
469
|
+
data = JSON.parse("[#{response.body}]", :symbolize_names => true)[0]
|
470
|
+
rescue Exception => exception
|
471
|
+
raise ApiError.new(response.body)
|
472
|
+
end
|
468
473
|
|
474
|
+
if data.nil? || data[:access_token].nil? || data[:access_token] == ""
|
475
|
+
raise("empty token (#{response.body})")
|
476
|
+
end
|
469
477
|
@config.access_token = data[:access_token]
|
470
478
|
end
|
471
479
|
|
@@ -28,7 +28,7 @@ module AsposePdfCloud
|
|
28
28
|
# Specifies document password (if any) encoded with base-64.
|
29
29
|
attr_accessor :password
|
30
30
|
|
31
|
-
# If true page contents will be reused when document is optimized for equal pages.
|
31
|
+
# If true page contents will be reused when document is optimized for equal pages. LinkDuplcateStreams option must be set to true.
|
32
32
|
attr_accessor :allow_reuse_page_content
|
33
33
|
|
34
34
|
# If this flag is set to true images will be compressed in the document. Compression level is specified with ImageQuality property.
|
@@ -46,7 +46,7 @@ module AsposePdfCloud
|
|
46
46
|
# If this flag set to true, every resource is checked on it's usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document.
|
47
47
|
attr_accessor :remove_unused_streams
|
48
48
|
|
49
|
-
# Make fonts not embedded if set to true.
|
49
|
+
# Make fonts not embedded if set to true. Unembedding a font means removing the embedded byte stream data of the font included in a PDF document.
|
50
50
|
attr_accessor :unembed_fonts
|
51
51
|
|
52
52
|
# If this flag set to true and CompressImages is true images will be resized if image resolution is greater then specified MaxResolution parameter.
|
@@ -55,7 +55,7 @@ module AsposePdfCloud
|
|
55
55
|
# Specifies maximum resolution of images. If image has higher resolution it will be scaled.
|
56
56
|
attr_accessor :max_resolution
|
57
57
|
|
58
|
-
# Fonts will be converted into subsets if set to true.
|
58
|
+
# Fonts will be converted into subsets if set to true. Only those characters that are actually used in the layout are stored in the PDF.
|
59
59
|
attr_accessor :subset_fonts
|
60
60
|
|
61
61
|
# Remove private information (page piece info).
|
data/test/pdf_tests.rb
CHANGED
@@ -4702,6 +4702,39 @@ class PdfTests < Minitest::Test
|
|
4702
4702
|
assert(response, 'Failed to add Text Stamp into page.')
|
4703
4703
|
end
|
4704
4704
|
|
4705
|
+
def test_post_document_text_stamps
|
4706
|
+
file_name = 'PageNumberStamp.pdf'
|
4707
|
+
upload_file(file_name)
|
4708
|
+
|
4709
|
+
opts = {
|
4710
|
+
:folder => @temp_folder
|
4711
|
+
}
|
4712
|
+
|
4713
|
+
text_state = TextState.new
|
4714
|
+
text_state.font_size = 14
|
4715
|
+
|
4716
|
+
stamp = TextStamp.new
|
4717
|
+
stamp.background = true
|
4718
|
+
stamp.left_margin = 1
|
4719
|
+
stamp.right_margin = 2
|
4720
|
+
stamp.top_margin = 3
|
4721
|
+
stamp.bottom_margin = 4
|
4722
|
+
stamp.horizontal_alignment = HorizontalAlignment::CENTER
|
4723
|
+
stamp.vertical_alignment = VerticalAlignment::CENTER
|
4724
|
+
stamp.opacity = 1
|
4725
|
+
stamp.rotate = Rotation::NONE
|
4726
|
+
stamp.rotate_angle = 0
|
4727
|
+
stamp.x_indent = 0
|
4728
|
+
stamp.y_indent = 0
|
4729
|
+
stamp.zoom = 1
|
4730
|
+
stamp.text_alignment = HorizontalAlignment::CENTER
|
4731
|
+
stamp.value = 'Text Stamp'
|
4732
|
+
stamp.text_state = text_state
|
4733
|
+
|
4734
|
+
response = @pdf_api.post_document_text_stamps(file_name, [stamp], opts)
|
4735
|
+
assert(response, 'Failed to add Text Stamp into document.')
|
4736
|
+
end
|
4737
|
+
|
4705
4738
|
def test_post_page_image_stamps
|
4706
4739
|
file_name = 'PageNumberStamp.pdf'
|
4707
4740
|
upload_file(file_name)
|
@@ -4735,6 +4768,37 @@ class PdfTests < Minitest::Test
|
|
4735
4768
|
assert(response, 'Failed to add Image Stamp into page.')
|
4736
4769
|
end
|
4737
4770
|
|
4771
|
+
def test_post_document_image_stamps
|
4772
|
+
file_name = 'PageNumberStamp.pdf'
|
4773
|
+
upload_file(file_name)
|
4774
|
+
|
4775
|
+
image_name = 'Koala.jpg'
|
4776
|
+
upload_file(image_name)
|
4777
|
+
|
4778
|
+
opts = {
|
4779
|
+
:folder => @temp_folder
|
4780
|
+
}
|
4781
|
+
|
4782
|
+
stamp = ImageStamp.new
|
4783
|
+
stamp.background = true
|
4784
|
+
stamp.left_margin = 1
|
4785
|
+
stamp.right_margin = 2
|
4786
|
+
stamp.top_margin = 3
|
4787
|
+
stamp.bottom_margin = 4
|
4788
|
+
stamp.horizontal_alignment = HorizontalAlignment::CENTER
|
4789
|
+
stamp.vertical_alignment = VerticalAlignment::CENTER
|
4790
|
+
stamp.opacity = 1
|
4791
|
+
stamp.rotate = Rotation::NONE
|
4792
|
+
stamp.rotate_angle = 0
|
4793
|
+
stamp.x_indent = 0
|
4794
|
+
stamp.y_indent = 0
|
4795
|
+
stamp.zoom = 1
|
4796
|
+
stamp.file_name = @temp_folder + '/' + image_name
|
4797
|
+
|
4798
|
+
response = @pdf_api.post_document_image_stamps(file_name, [stamp], opts)
|
4799
|
+
assert(response, 'Failed to add Image Stamp into document.')
|
4800
|
+
end
|
4801
|
+
|
4738
4802
|
def test_post_page_pdf_page_stamps
|
4739
4803
|
file_name = 'PageNumberStamp.pdf'
|
4740
4804
|
upload_file(file_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_pdf_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 24.
|
4
|
+
version: 24.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aspose PDF Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|