Skip to content

Commit 831ba13

Browse files
committed
Updated sources
1 parent b949df5 commit 831ba13

101 files changed

Lines changed: 177 additions & 254 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2003-2020 Aspose Pty Ltd
3+
Copyright (c) 2003-2019 Aspose Pty Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 54 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,11 @@
1-
![](https://img.shields.io/badge/api-v2.0-lightgrey) [![GitHub license](https://img.shields.io/github/license/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java)](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java/blob/master/LICENSE)
1+
# GroupDocs.Viewer Cloud SDK for Java
2+
This repository contains GroupDocs.Viewer Cloud SDK for Java source code. This SDK allows you to work with GroupDocs.Viewer Cloud REST APIs in your Java applications.
23

3-
# Java SDK to View Documents in the Cloud
4-
5-
[GroupDocs.Viewer Cloud SDK for Java](https://products.groupdocs.cloud/viewer/java) wraps GroupDocs.Viewer RESTful APIs so you may integrate Document Viewing features in your own apps with zero initial cost.
6-
7-
GroupDocs.Viewer REST API allows the developers to view & render a number of popular files formats including Word documents, Excel spreadsheets, PowerPoint presentations, CAD drawings, Visio diagram, PDF, OpenDocument formats, emails & images.
8-
9-
## Document Viewer Services in REST
10-
11-
- 90+ supported file formats.
12-
- View documents as PDF, HTML or images.
13-
- Render documents as raster & vector images.
14-
- Render documents with comments & notes.
15-
- Flip or rotate documents pages at 90, 180 or 270 degrees.
16-
- Reorder document pages.
17-
- Render hidden, consecutive or selected document pages.
18-
- Watermark PDF, image or HTML output pages.
19-
- Render with custom fonts as well as replace any missing fonts.
20-
- Load password-protected documents.
21-
- Extract attachment information such as attachment count & names.
22-
- Extract document information like file format, page count, size and visibility, text coordinates, and so on.
23-
- Integrated storage API.
24-
25-
Check out the [Developer's Guide](https://docs.groupdocs.cloud/viewer/developer-guide/) to know more about GroupDocs.Viewer REST API.
26-
27-
## Microsoft File Formats
28-
29-
**Microsoft Word:** DOC, DOCM, DOCX, DOT, DOTM, DOTX\
30-
**Microsoft Excel:** XLS, XLSX, XLSB, XLSM\
31-
**Microsoft PowerPoint:** PPTX, PPTM, PPT, PPSX, PPSM, PPS, POTX, POTM\
32-
**Microsoft Project:** MPP, MPT\
33-
**Microsoft Outlook:** MSG, OST, PST\
34-
**Microsoft Visio:** VDW, VDX, VSD, VSDM, VSDX, VSS, VSSM, VSSX, VST, VSTM, VSTX, VSX, VTX\
35-
**Microsoft OneNote:** ONE
36-
37-
## Other Formats
38-
39-
**Page Layout Formats:** PDF, XPS, TEX\
40-
**OpenDocument:** ODT, OTT, ODS, OTS, ODP, OTP\
41-
**CAD:** DNG, DWF, DWG, DXF, IDC, STL\
42-
**Images:** BMP, CGM, DCM, DJVU, EMP, EPS, GIF, ICO, JP2, JPG, ODG, PCL, PNG, PS, PSD, SVG, TIFF, WEBP, WMF\
43-
**Web:** HTML, MHT, MHTML\
44-
**Emails:** EML, EMLX\
45-
**eBooks:** EPUB, MOBI\
46-
**Others:** TXT, RTF, CSV, TSV
47-
48-
## Get Started with GroupDocs.Viewer Cloud SDK for Java
49-
50-
First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, follow the steps as below.
51-
52-
### Requirements
4+
## Requirements
535

546
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
557

56-
### Installation
8+
## Installation
579

5810
To install the API client library to your local Maven repository, execute:
5911

@@ -69,9 +21,9 @@ mvn deploy
6921

7022
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
7123

72-
#### Maven
24+
### Maven users
7325

74-
Add following repository and dependency to your project's POM.
26+
Add following repository and dependency to your project's POM
7527

7628
```xml
7729
<repository>
@@ -85,51 +37,66 @@ Add following repository and dependency to your project's POM.
8537
<dependency>
8638
<groupId>com.groupdocs</groupId>
8739
<artifactId>groupdocs-viewer-cloud</artifactId>
88-
<version>20.5</version>
40+
<version>21.3</version>
8941
<scope>compile</scope>
9042
</dependency>
9143
```
9244

93-
#### Others
45+
### Others
9446

95-
At first generate the JAR by executing `mvn package`, then manually install the following JARs.
47+
At first generate the JAR by executing:
9648

97-
* target/groupdocs-viewer-cloud-20.5.jar
98-
* target/lib/*.jar
49+
mvn package
9950

100-
## Protect PDF while Rendering DOCX as PDF
101-
102-
```java
103-
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples
104-
// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
105-
String MyClientId = "";
106-
String MyClientSecret = "";
51+
Then manually install the following JARs:
10752

108-
Configuration configuration = new Configuration(MyClientId, MyClientSecret);
109-
ViewApi apiInstance = new ViewApi(configuration);
110-
111-
FileInfo fileInfo = new FileInfo();
112-
fileInfo.setFilePath("SampleFiles/sample.docx");
53+
* target/groupdocs-viewer-cloud-21.3.jar
54+
* target/lib/*.jar
11355

114-
ViewOptions viewOptions = new ViewOptions();
115-
viewOptions.setFileInfo(fileInfo);
116-
viewOptions.setViewFormat(ViewFormatEnum.PDF);
56+
## Getting Started
11757

118-
PdfOptions renderOptions = new PdfOptions();
119-
renderOptions.setPermissions(PermissionsEnum.DENYMODIFICATION);
120-
renderOptions.setPermissionsPassword("p123");
121-
renderOptions.setDocumentOpenPassword("o123");
122-
viewOptions.setRenderOptions(renderOptions);
58+
Please follow the [installation](#installation) instruction and execute the following Java code:
12359

124-
ViewResult response = apiInstance.createView(new CreateViewRequest(viewOptions));
60+
```java
61+
import com.groupdocs.cloud.viewer.client.*;
62+
import com.groupdocs.cloud.viewer.model.*;
63+
import com.groupdocs.cloud.viewer.api.InfoApi;
64+
65+
import java.util.*;
66+
67+
public class ApiExample {
68+
69+
public static void main(String[] args) {
70+
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
71+
String appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
72+
String appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
73+
74+
Configuration configuration = new Configuration(appSid, appKey);
75+
76+
InfoApi infoApi = new InfoApi(configuration);
77+
78+
try {
79+
FormatsResult response = infoApi.getSupportedFileFormats();
80+
for (Format format : response.getFormats()) {
81+
System.out.println(format.getFileFormat());
82+
}
83+
} catch (ApiException e) {
84+
System.err.println("Failed to get supported file formats");
85+
e.printStackTrace();
86+
}
87+
}
88+
}
12589
```
12690

91+
## Licensing
92+
All GroupDocs.Viewer Cloud SDKs are licensed under [MIT License](LICENSE).
12793

128-
## GroupDocs.Viewer Cloud SDKs in Popular Languages
129-
130-
| .NET | Java | PHP | Python | Ruby | Node.js | Android |
131-
|---|---|---|---|---|---|---|
132-
| [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-android) |
133-
| [NuGet](https://www.nuget.org/packages/GroupDocs.Viewer-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-viewer-cloud) | [PIP](https://pypi.org/project/groupdocs-viewer-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_viewer_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-viewer-cloud) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud-android) |
94+
## Resources
95+
+ [**Website**](https://www.groupdocs.cloud)
96+
+ [**Product Home**](https://products.groupdocs.cloud/viewer)
97+
+ [**Documentation**](https://docs.groupdocs.cloud/display/viewercloud/Home)
98+
+ [**Free Support Forum**](https://forum.groupdocs.cloud/c/viewer)
99+
+ [**Blog**](https://blog.groupdocs.cloud/category/viewer)
134100

135-
[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/viewer/java) | [Documentation](https://docs.groupdocs.cloud/viewer/) | [Live Demo](https://products.groupdocs.app/viewer/total) | [API Reference](https://apireference.groupdocs.cloud/viewer/) | [Code Samples](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples) | [Blog](https://blog.groupdocs.cloud/category/viewer/) | [Free Support](https://forum.groupdocs.cloud/c/viewer) | [Free Trial](https://dashboard.groupdocs.cloud)
101+
## Contact Us
102+
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/viewer).

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>groupdocs-viewer-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>groupdocs-viewer-cloud</name>
8-
<version>20.5</version>
8+
<version>21.3</version>
99
<url>https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java</url>
1010
<description>Java library for communicating with the GroupDocs.Viewer Cloud API</description>
1111
<scm>

src/main/java/com/groupdocs/cloud/viewer/api/FileApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------------------------------------------------
33
* <copyright company="Aspose Pty Ltd" file="FileApi.java">
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
* </copyright>
66
* <summary>
77
* Permission is hereby granted, free of charge, to any person obtaining a copy

src/main/java/com/groupdocs/cloud/viewer/api/FolderApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------------------------------------------------
33
* <copyright company="Aspose Pty Ltd" file="FolderApi.java">
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
* </copyright>
66
* <summary>
77
* Permission is hereby granted, free of charge, to any person obtaining a copy

src/main/java/com/groupdocs/cloud/viewer/api/InfoApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------------------------------------------------
33
* <copyright company="Aspose Pty Ltd" file="InfoApi.java">
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
* </copyright>
66
* <summary>
77
* Permission is hereby granted, free of charge, to any person obtaining a copy

src/main/java/com/groupdocs/cloud/viewer/api/StorageApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------------------------------------------------
33
* <copyright company="Aspose Pty Ltd" file="StorageApi.java">
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
* </copyright>
66
* <summary>
77
* Permission is hereby granted, free of charge, to any person obtaining a copy

src/main/java/com/groupdocs/cloud/viewer/api/ViewApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------------------------------------------------
33
* <copyright company="Aspose Pty Ltd" file="ViewApi.java">
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
* </copyright>
66
* <summary>
77
* Permission is hereby granted, free of charge, to any person obtaining a copy

src/main/java/com/groupdocs/cloud/viewer/client/ApiCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------------------------------------------------
33
* <copyright company="Aspose Pty Ltd" file="ApiCallback.java">
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
* </copyright>
66
* <summary>
77
* Permission is hereby granted, free of charge, to any person obtaining a copy

src/main/java/com/groupdocs/cloud/viewer/client/ApiClient.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------------------------------------------------
33
* <copyright company="Aspose Pty Ltd" file="ApiClient.java">
4-
* Copyright (c) 2003-2020 Aspose Pty Ltd
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
55
* </copyright>
66
* <summary>
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -97,7 +97,7 @@ public ApiClient(Configuration configuration) {
9797
this.json = new JSON();
9898

9999
// Set default User-Agent.
100-
setUserAgent("java-sdk/20.5");
100+
setUserAgent("java-sdk/21.3");
101101

102102
// Set connection timeout
103103
setConnectTimeout(configuration.getTimeout());
@@ -868,15 +868,15 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
868868
throw new ApiException(response.message(), response.code());
869869
}
870870

871-
ApiError apiError = null;
871+
com.groupdocs.cloud.viewer.model.Error apiError = null;
872872
try {
873-
apiError = json.deserialize(respBody, ApiError.class);
873+
apiError = json.deserialize(respBody, com.groupdocs.cloud.viewer.model.Error.class);
874874
} catch (Exception e) {
875875
//NOTE: ignore
876876
}
877-
if(apiError != null && apiError.getError() != null) {
878-
throw new ApiException(apiError.getError().getMessage(), response.code());
879-
}
877+
if(apiError != null && apiError.getCode() != null) {
878+
throw new ApiException(apiError.getMessage(), response.code());
879+
}
880880

881881
AuthError authError = null;
882882
try {

0 commit comments

Comments
 (0)