Skip to content

Commit 990785f

Browse files
authored
Merge pull request #114 from aspose-pdf-cloud/develop
update to 25.4
2 parents f1ab527 + 568ba84 commit 990785f

File tree

13 files changed

+1591
-5
lines changed

13 files changed

+1591
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
2929
## Read PDF Formats
3030
MHT, PCL, PS, XSLFO, MD
3131

32-
## Enhancements in Version 25.3
32+
## Enhancements in Version 25.4
33+
- Add method for adding Stamp per page in batch.
3334
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3435

3536
## Unit Tests

docs/ImageStampPageSpecified.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Aspose.Pdf.Cloud.Sdk.Model.ImageStampPageSpecified
2+
Represents Pdf stamps.
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**Links** | [**List<Link>**](Link.md) | Link to the document. | [optional]
9+
**Background** | **bool?** | Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top. | [optional]
10+
**HorizontalAlignment** | [**HorizontalAlignment**](HorizontalAlignment.md) | Gets or sets Horizontal alignment of stamp on the page. | [optional]
11+
**Opacity** | **double?** | Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0. | [optional]
12+
**Rotate** | [**Rotation**](Rotation.md) | Sets or gets the rotation of stamp content according Rotation values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None. | [optional]
13+
**RotateAngle** | **double?** | Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle. | [optional]
14+
**XIndent** | **double?** | Horizontal stamp coordinate, starting from the left. | [optional]
15+
**YIndent** | **double?** | Vertical stamp coordinate, starting from the bottom. | [optional]
16+
**Zoom** | **double?** | Zooming factor of the stamp. Allows to scale stamp. | [optional]
17+
**FileName** | **string** | Gets or sets the file name. | [optional]
18+
**Width** | **double?** | Gets or sets image width. Setting this property allos to scal image horizontally. | [optional]
19+
**Height** | **double?** | Gets or sets image height. Setting this image allows to scale image vertically. | [optional]
20+
**VerticalAlignment** | [**VerticalAlignment**](VerticalAlignment.md) | Gets or sets vertical alignment of stamp on page. | [optional]
21+
**BottomMargin** | **double?** | Gets or sets bottom margin of stamp. | [optional]
22+
**LeftMargin** | **double?** | Gets or sets left margin of stamp. | [optional]
23+
**TopMargin** | **double?** | Gets or sets top margin of stamp. | [optional]
24+
**RightMargin** | **double?** | Gets or sets right margin of stamp. | [optional]
25+
**PageNumber** | **int?** | Page number. |
26+
27+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
28+

docs/PdfApi.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,13 @@ Method | HTTP request | Description
209209
[**PostDocumentImageFooter**](PdfApi.md#postdocumentimagefooter) | **POST** /pdf/\{name}/footer/image | Add document image footer.
210210
[**PostDocumentImageHeader**](PdfApi.md#postdocumentimageheader) | **POST** /pdf/\{name}/header/image | Add document image header.
211211
[**PostDocumentImageStamps**](PdfApi.md#postdocumentimagestamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps.
212+
[**PostDocumentImageStampsPageSpecified**](PdfApi.md#postdocumentimagestampspagespecified) | **POST** /pdf/\{name}/stamps/image/pagespecified | Add document image stamps to specified pages.
212213
[**PostDocumentPageNumberStamps**](PdfApi.md#postdocumentpagenumberstamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps.
213214
[**PostDocumentTextFooter**](PdfApi.md#postdocumenttextfooter) | **POST** /pdf/\{name}/footer/text | Add document text footer.
214215
[**PostDocumentTextHeader**](PdfApi.md#postdocumenttextheader) | **POST** /pdf/\{name}/header/text | Add document text header.
215216
[**PostDocumentTextReplace**](PdfApi.md#postdocumenttextreplace) | **POST** /pdf/\{name}/text/replace | Document's replace text method.
216217
[**PostDocumentTextStamps**](PdfApi.md#postdocumenttextstamps) | **POST** /pdf/\{name}/stamps/text | Add document pages text stamps.
218+
[**PostDocumentTextStampsPageSpecified**](PdfApi.md#postdocumenttextstampspagespecified) | **POST** /pdf/\{name}/stamps/text/pagespecified | Add document text stamps to specified pages.
217219
[**PostEncryptDocumentInStorage**](PdfApi.md#postencryptdocumentinstorage) | **POST** /pdf/\{name}/encrypt | Encrypt document in storage.
218220
[**PostFlattenDocument**](PdfApi.md#postflattendocument) | **POST** /pdf/\{name}/flatten | Flatten the document.
219221
[**PostHtmlToPdf**](PdfApi.md#posthtmltopdf) | **POST** /pdf/create/html | Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
@@ -5982,6 +5984,34 @@ Name | Type | Description | Notes
59825984

59835985
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
59845986

5987+
<a name="postdocumentimagestampspagespecified"></a>
5988+
# **PostDocumentImageStampsPageSpecified**
5989+
> AsposeResponse PostDocumentImageStampsPageSpecified (string name, List<ImageStampPageSpecified> stamps, string storage = null, string folder = null, string password = null)
5990+
5991+
Add document image stamps to specified pages.
5992+
5993+
5994+
### Parameters
5995+
5996+
Name | Type | Description | Notes
5997+
------------- | ------------- | ------------- | -------------
5998+
**name** | **string**| The document name. |
5999+
**stamps** | [**List&lt;ImageStampPageSpecified&gt;**](ImageStampPageSpecified.md)| The array of stamps. |
6000+
**storage** | **string**| The document storage. | [optional]
6001+
**folder** | **string**| The document folder. | [optional]
6002+
**password** | **string**| Base64 encoded password. | [optional]
6003+
6004+
### Return type
6005+
6006+
[**AsposeResponse**](AsposeResponse.md)
6007+
6008+
### HTTP request headers
6009+
6010+
- **Content-Type**: application/json
6011+
- **Accept**: application/json
6012+
6013+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
6014+
59856015
<a name="postdocumentpagenumberstamps"></a>
59866016
# **PostDocumentPageNumberStamps**
59876017
> AsposeResponse PostDocumentPageNumberStamps (string name, PageNumberStamp stamp, int? startPageNumber = null, int? endPageNumber = null, string storage = null, string folder = null, string password = null)
@@ -6125,6 +6155,34 @@ Name | Type | Description | Notes
61256155

61266156
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
61276157

6158+
<a name="postdocumenttextstampspagespecified"></a>
6159+
# **PostDocumentTextStampsPageSpecified**
6160+
> AsposeResponse PostDocumentTextStampsPageSpecified (string name, List<TextStampPageSpecified> stamps, string storage = null, string folder = null, string password = null)
6161+
6162+
Add document text stamps to specified pages.
6163+
6164+
6165+
### Parameters
6166+
6167+
Name | Type | Description | Notes
6168+
------------- | ------------- | ------------- | -------------
6169+
**name** | **string**| The document name. |
6170+
**stamps** | [**List&lt;TextStampPageSpecified&gt;**](TextStampPageSpecified.md)| The array of stamps. |
6171+
**storage** | **string**| The document storage. | [optional]
6172+
**folder** | **string**| The document folder. | [optional]
6173+
**password** | **string**| Base64 encoded password. | [optional]
6174+
6175+
### Return type
6176+
6177+
[**AsposeResponse**](AsposeResponse.md)
6178+
6179+
### HTTP request headers
6180+
6181+
- **Content-Type**: application/json
6182+
- **Accept**: application/json
6183+
6184+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
6185+
61286186
<a name="postencryptdocumentinstorage"></a>
61296187
# **PostEncryptDocumentInStorage**
61306188
> AsposeResponse PostEncryptDocumentInStorage (string name, string userPassword, string ownerPassword, string cryptoAlgorithm, List<PermissionsFlags> permissionsFlags = null, bool? usePdf20 = null, string storage = null, string folder = null)

docs/TextStampPageSpecified.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Aspose.Pdf.Cloud.Sdk.Model.TextStampPageSpecified
2+
Represents Pdf stamps.
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**Links** | [**List&lt;Link&gt;**](Link.md) | Link to the document. | [optional]
9+
**Background** | **bool?** | Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top. | [optional]
10+
**HorizontalAlignment** | [**HorizontalAlignment**](HorizontalAlignment.md) | Gets or sets Horizontal alignment of stamp on the page. | [optional]
11+
**Opacity** | **double?** | Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0. | [optional]
12+
**Rotate** | [**Rotation**](Rotation.md) | Sets or gets the rotation of stamp content according Rotation values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None. | [optional]
13+
**RotateAngle** | **double?** | Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle. | [optional]
14+
**XIndent** | **double?** | Horizontal stamp coordinate, starting from the left. | [optional]
15+
**YIndent** | **double?** | Vertical stamp coordinate, starting from the bottom. | [optional]
16+
**Zoom** | **double?** | Zooming factor of the stamp. Allows to scale stamp. | [optional]
17+
**TextAlignment** | [**HorizontalAlignment**](HorizontalAlignment.md) | Alignment of the text inside the stamp. | [optional]
18+
**Value** | **string** | Gets or sets string value which is used as stamp on the page. | [optional]
19+
**TextState** | [**TextState**](TextState.md) | Gets text properties of the stamp. See TextState for details. | [optional]
20+
**VerticalAlignment** | [**VerticalAlignment**](VerticalAlignment.md) | Gets or sets vertical alignment of stamp on page. | [optional]
21+
**BottomMargin** | **double?** | Gets or sets bottom margin of stamp. | [optional]
22+
**LeftMargin** | **double?** | Gets or sets left margin of stamp. | [optional]
23+
**TopMargin** | **double?** | Gets or sets top margin of stamp. | [optional]
24+
**RightMargin** | **double?** | Gets or sets right margin of stamp. | [optional]
25+
**PageNumber** | **int?** | Page number. |
26+
27+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
28+

src/Aspose.Pdf.Cloud.Sdk.Test/StampsTests.cs

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,59 @@ public void PostDocumentTextStampsTest()
152152
Assert.That(response.Code, Is.EqualTo(200));
153153
}
154154

155+
/// <summary>
156+
/// Test PostDocumentTextStampsPageSpecified
157+
/// </summary>
158+
[Test]
159+
public void PostDocumentTextStampsPageSpecifiedTest()
160+
{
161+
List<TextStampPageSpecified> stamps = new List<TextStampPageSpecified>
162+
{
163+
new TextStampPageSpecified(PageNumber: 2)
164+
{
165+
Background = true,
166+
LeftMargin = 1,
167+
RightMargin = 2,
168+
TopMargin = 3,
169+
BottomMargin = 4,
170+
HorizontalAlignment = HorizontalAlignment.Center,
171+
VerticalAlignment = VerticalAlignment.Center,
172+
Opacity = 1,
173+
Rotate = Rotation.None,
174+
RotateAngle = 0,
175+
XIndent = 0,
176+
YIndent = 0,
177+
Zoom = 1,
178+
TextAlignment = HorizontalAlignment.Center,
179+
Value = "Text Stamp 1",
180+
TextState = new TextState(FontSize: 14D, Font: "Arial")
181+
},
182+
new TextStampPageSpecified(PageNumber: 4)
183+
{
184+
PageNumber = 4,
185+
Background = true,
186+
LeftMargin = 1,
187+
RightMargin = 2,
188+
TopMargin = 3,
189+
BottomMargin = 4,
190+
HorizontalAlignment = HorizontalAlignment.Center,
191+
VerticalAlignment = VerticalAlignment.Center,
192+
Opacity = 1,
193+
Rotate = Rotation.None,
194+
RotateAngle = 0,
195+
XIndent = 0,
196+
YIndent = 0,
197+
Zoom = 1,
198+
TextAlignment = HorizontalAlignment.Center,
199+
Value = "Text Stamp 2",
200+
TextState = new TextState(FontSize: 14D, Font: "Arial")
201+
}
202+
};
203+
204+
var response = PdfApi.PostDocumentTextStampsPageSpecified(Name, stamps, folder: TempFolder);
205+
Assert.That(response.Code, Is.EqualTo(200));
206+
}
207+
155208
/// <summary>
156209
/// Test PostPageImageStamps
157210
/// </summary>
@@ -218,6 +271,58 @@ public void PostDocumentImageStampsTest()
218271
Assert.That(response.Code, Is.EqualTo(200));
219272
}
220273

274+
/// <summary>
275+
/// Test PostDocumentImageStampsPageSpecified
276+
/// </summary>
277+
[Test]
278+
public void PostDocumentImageStampsPageSpecifiedTest()
279+
{
280+
string imageFileName = "Koala.jpg";
281+
UploadFile(imageFileName, imageFileName);
282+
List<ImageStampPageSpecified> stamps = new List<ImageStampPageSpecified>
283+
{
284+
new ImageStampPageSpecified(PageNumber: 2)
285+
{
286+
PageNumber = 2,
287+
Background = true,
288+
LeftMargin = 1,
289+
RightMargin = 2,
290+
TopMargin = 3,
291+
BottomMargin = 4,
292+
HorizontalAlignment = HorizontalAlignment.Center,
293+
VerticalAlignment = VerticalAlignment.Center,
294+
Opacity = 1,
295+
Rotate = Rotation.None,
296+
RotateAngle = 0,
297+
XIndent = 0,
298+
YIndent = 0,
299+
Zoom = 1,
300+
FileName = Path.Combine(TempFolder, imageFileName)
301+
},
302+
new ImageStampPageSpecified(PageNumber: 4)
303+
{
304+
PageNumber = 4,
305+
Background = true,
306+
LeftMargin = 1,
307+
RightMargin = 2,
308+
TopMargin = 3,
309+
BottomMargin = 4,
310+
HorizontalAlignment = HorizontalAlignment.Center,
311+
VerticalAlignment = VerticalAlignment.Center,
312+
Opacity = 1,
313+
Rotate = Rotation.None,
314+
RotateAngle = 0,
315+
XIndent = 0,
316+
YIndent = 0,
317+
Zoom = 1,
318+
FileName = Path.Combine(TempFolder, imageFileName)
319+
}
320+
};
321+
322+
var response = PdfApi.PostDocumentImageStampsPageSpecified(Name, stamps, folder: TempFolder);
323+
Assert.That(response.Code, Is.EqualTo(200));
324+
}
325+
221326
/// <summary>
222327
/// Test PostPagePdfPageStamps
223328
/// </summary>

0 commit comments

Comments
 (0)