Skip to content

Commit fe6c212

Browse files
authored
Merge pull request #101 from aspose-pdf-cloud/develop
update 24.8
2 parents 9c1c579 + 120f243 commit fe6c212

File tree

9 files changed

+641
-29
lines changed

9 files changed

+641
-29
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ 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 24.7
32+
## Enhancements in Version 24.8
33+
- Adding Text stamps to multiple pages.
34+
- Adding Image stamps to multiple pages.
3335
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3436

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-
3937
## Unit Tests
4038
Aspose PDF SDK includes a suite of unit tests. These Unit Tests also serves as examples of how to use the Aspose PDF SDK.
4139

docs/OptimizeOptions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Represents Pdf optimize options.
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**Password** | **string** | Specifies document password (if any) encoded with base-64. | [optional]
9-
**AllowReusePageContent** | **bool?** | If true page contents will be reused when document is optimized for equal pages. | [optional]
9+
**AllowReusePageContent** | **bool?** | If true page contents will be reused when document is optimized for equal pages. LinkDuplcateStreams option must be set to true. | [optional]
1010
**CompressImages** | **bool?** | If this flag is set to true images will be compressed in the document. Compression level is specified with ImageQuality property. | [optional]
1111
**ImageQuality** | **int?** | Specifies level of image compression when CompressImages flag is used. | [optional]
1212
**LinkDuplcateStreams** | **bool?** | 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]
1313
**RemoveUnusedObjects** | **bool?** | 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]
1414
**RemoveUnusedStreams** | **bool?** | 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]
15-
**UnembedFonts** | **bool?** | Make fonts not embedded if set to true. | [optional]
15+
**UnembedFonts** | **bool?** | 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]
1616
**ResizeImages** | **bool?** | If this flag set to true and CompressImages is true images will be resized if image resolution is greater then specified MaxResolution parameter. | [optional]
1717
**MaxResolution** | **int?** | Specifies maximum resolution of images. If image has higher resolution it will be scaled. | [optional]
18-
**SubsetFonts** | **bool?** | Fonts will be converted into subsets if set to true. | [optional]
18+
**SubsetFonts** | **bool?** | 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]
1919
**RemovePrivateInfo** | **bool?** | Remove private information (page piece info). | [optional]
2020
**ImageEncoding** | [**ImageEncoding**](ImageEncoding.md) | Image encode which will be used. | [optional]
2121
**ImageCompressionVersion** | [**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]

docs/PdfApi.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,12 @@ Method | HTTP request | Description
203203
[**PostDecryptDocumentInStorage**](PdfApi.md#postdecryptdocumentinstorage) | **POST** /pdf/\{name}/decrypt | Decrypt document in storage.
204204
[**PostDocumentImageFooter**](PdfApi.md#postdocumentimagefooter) | **POST** /pdf/\{name}/footer/image | Add document image footer.
205205
[**PostDocumentImageHeader**](PdfApi.md#postdocumentimageheader) | **POST** /pdf/\{name}/header/image | Add document image header.
206+
[**PostDocumentImageStamps**](PdfApi.md#postdocumentimagestamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps.
206207
[**PostDocumentPageNumberStamps**](PdfApi.md#postdocumentpagenumberstamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps.
207208
[**PostDocumentTextFooter**](PdfApi.md#postdocumenttextfooter) | **POST** /pdf/\{name}/footer/text | Add document text footer.
208209
[**PostDocumentTextHeader**](PdfApi.md#postdocumenttextheader) | **POST** /pdf/\{name}/header/text | Add document text header.
209210
[**PostDocumentTextReplace**](PdfApi.md#postdocumenttextreplace) | **POST** /pdf/\{name}/text/replace | Document's replace text method.
211+
[**PostDocumentTextStamps**](PdfApi.md#postdocumenttextstamps) | **POST** /pdf/\{name}/stamps/text | Add document pages text stamps.
210212
[**PostEncryptDocumentInStorage**](PdfApi.md#postencryptdocumentinstorage) | **POST** /pdf/\{name}/encrypt | Encrypt document in storage.
211213
[**PostFlattenDocument**](PdfApi.md#postflattendocument) | **POST** /pdf/\{name}/flatten | Flatten the document.
212214
[**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.
@@ -5807,6 +5809,34 @@ Name | Type | Description | Notes
58075809

58085810
[[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)
58095811

5812+
<a name="postdocumentimagestamps"></a>
5813+
# **PostDocumentImageStamps**
5814+
> AsposeResponse PostDocumentImageStamps (string name, List<ImageStamp> stamps, string storage = null, string folder = null, string password = null)
5815+
5816+
Add document pages image stamps.
5817+
5818+
5819+
### Parameters
5820+
5821+
Name | Type | Description | Notes
5822+
------------- | ------------- | ------------- | -------------
5823+
**name** | **string**| The document name. |
5824+
**stamps** | [**List&lt;ImageStamp&gt;**](ImageStamp.md)| The array of stamp. |
5825+
**storage** | **string**| The document storage. | [optional]
5826+
**folder** | **string**| The document folder. | [optional]
5827+
**password** | **string**| Base64 encoded password. | [optional]
5828+
5829+
### Return type
5830+
5831+
[**AsposeResponse**](AsposeResponse.md)
5832+
5833+
### HTTP request headers
5834+
5835+
- **Content-Type**: application/json
5836+
- **Accept**: application/json
5837+
5838+
[[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)
5839+
58105840
<a name="postdocumentpagenumberstamps"></a>
58115841
# **PostDocumentPageNumberStamps**
58125842
> AsposeResponse PostDocumentPageNumberStamps (string name, PageNumberStamp stamp, int? startPageNumber = null, int? endPageNumber = null, string storage = null, string folder = null, string password = null)
@@ -5922,6 +5952,34 @@ Name | Type | Description | Notes
59225952

59235953
[[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)
59245954

5955+
<a name="postdocumenttextstamps"></a>
5956+
# **PostDocumentTextStamps**
5957+
> AsposeResponse PostDocumentTextStamps (string name, List<TextStamp> stamps, string storage = null, string folder = null, string password = null)
5958+
5959+
Add document pages text stamps.
5960+
5961+
5962+
### Parameters
5963+
5964+
Name | Type | Description | Notes
5965+
------------- | ------------- | ------------- | -------------
5966+
**name** | **string**| The document name. |
5967+
**stamps** | [**List&lt;TextStamp&gt;**](TextStamp.md)| The array of stamp. |
5968+
**storage** | **string**| The document storage. | [optional]
5969+
**folder** | **string**| The document folder. | [optional]
5970+
**password** | **string**| Base64 encoded password. | [optional]
5971+
5972+
### Return type
5973+
5974+
[**AsposeResponse**](AsposeResponse.md)
5975+
5976+
### HTTP request headers
5977+
5978+
- **Content-Type**: application/json
5979+
- **Accept**: application/json
5980+
5981+
[[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)
5982+
59255983
<a name="postencryptdocumentinstorage"></a>
59265984
# **PostEncryptDocumentInStorage**
59275985
> AsposeResponse PostEncryptDocumentInStorage (string name, string userPassword, string ownerPassword, string cryptoAlgorithm, List<PermissionsFlags> permissionsFlags = null, bool? usePdf20 = null, string storage = null, string folder = null)

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

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,39 @@ public void PostPageTextStampsTest()
119119
Assert.That(response.Code, Is.EqualTo(200));
120120
}
121121

122+
/// <summary>
123+
/// Test PostDocumentTextStamps
124+
/// </summary>
125+
[Test]
126+
public void PostDocumentTextStampsTest()
127+
{
128+
List<TextStamp> stamps = new List<TextStamp>
129+
{
130+
new TextStamp()
131+
{
132+
Background = true,
133+
LeftMargin = 1,
134+
RightMargin = 2,
135+
TopMargin = 3,
136+
BottomMargin = 4,
137+
HorizontalAlignment = HorizontalAlignment.Center,
138+
VerticalAlignment = VerticalAlignment.Center,
139+
Opacity = 1,
140+
Rotate = Rotation.None,
141+
RotateAngle = 0,
142+
XIndent = 0,
143+
YIndent = 0,
144+
Zoom = 1,
145+
TextAlignment = HorizontalAlignment.Center,
146+
Value = "Text Stamp",
147+
TextState = new TextState(FontSize: 14D, Font: "Arial")
148+
}
149+
};
150+
151+
var response = PdfApi.PostDocumentTextStamps(Name, stamps, folder: TempFolder);
152+
Assert.That(response.Code, Is.EqualTo(200));
153+
}
154+
122155
/// <summary>
123156
/// Test PostPageImageStamps
124157
/// </summary>
@@ -152,6 +185,38 @@ public void PostPageImageStampsTest()
152185
Assert.That(response.Code, Is.EqualTo(200));
153186
}
154187

188+
/// <summary>
189+
/// Test PostDocumentImageStamps
190+
/// </summary>
191+
[Test]
192+
public void PostDocumentImageStampsTest()
193+
{
194+
string imageFileName = "Koala.jpg";
195+
UploadFile(imageFileName, imageFileName);
196+
List<ImageStamp> stamps = new List<ImageStamp>
197+
{
198+
new ImageStamp()
199+
{
200+
Background = true,
201+
LeftMargin = 1,
202+
RightMargin = 2,
203+
TopMargin = 3,
204+
BottomMargin = 4,
205+
HorizontalAlignment = HorizontalAlignment.Center,
206+
VerticalAlignment = VerticalAlignment.Center,
207+
Opacity = 1,
208+
Rotate = Rotation.None,
209+
RotateAngle = 0,
210+
XIndent = 0,
211+
YIndent = 0,
212+
Zoom = 1,
213+
FileName = Path.Combine(TempFolder, imageFileName)
214+
}
215+
};
216+
217+
var response = PdfApi.PostDocumentImageStamps(Name, stamps, folder: TempFolder);
218+
Assert.That(response.Code, Is.EqualTo(200));
219+
}
155220

156221
/// <summary>
157222
/// Test PostPagePdfPageStamps

0 commit comments

Comments
 (0)