{"id":24880742,"url":"https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java","last_synced_at":"2025-09-19T12:29:29.070Z","repository":{"id":39960921,"uuid":"134373809","full_name":"groupdocs-viewer-cloud/groupdocs-viewer-cloud-java","owner":"groupdocs-viewer-cloud","description":"Java SDK to communicate with GroupDocs.Viewer REST API. View or render Word, Excel, PowerPoint, CAD, Visio, PDF, OpenDocument, email \u0026 image formats.","archived":false,"fork":false,"pushed_at":"2024-12-24T07:05:23.000Z","size":1482,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-24T07:39:15.461Z","etag":null,"topics":["cad","excel","groupdocs","groupdocs-viewer-cloud","html","images","java","pdf","powerpoint","rest-api","sdk","viewer-cloud-sdk","visio"],"latest_commit_sha":null,"homepage":"https://products.groupdocs.cloud/viewer/java","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/groupdocs-viewer-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-22T06:58:58.000Z","updated_at":"2024-12-24T06:43:41.000Z","dependencies_parsed_at":"2024-08-26T11:21:16.006Z","dependency_job_id":null,"html_url":"https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupdocs-viewer-cloud%2Fgroupdocs-viewer-cloud-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupdocs-viewer-cloud%2Fgroupdocs-viewer-cloud-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupdocs-viewer-cloud%2Fgroupdocs-viewer-cloud-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupdocs-viewer-cloud%2Fgroupdocs-viewer-cloud-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groupdocs-viewer-cloud","download_url":"https://codeload.github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236652700,"owners_count":19183670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cad","excel","groupdocs","groupdocs-viewer-cloud","html","images","java","pdf","powerpoint","rest-api","sdk","viewer-cloud-sdk","visio"],"created_at":"2025-02-01T11:19:27.896Z","updated_at":"2025-09-19T12:29:29.049Z","avatar_url":"https://github.com/groupdocs-viewer-cloud.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GroupDocs.Viewer Cloud SDK for Java\n\nThis 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. This allows rendering any type of documents - Word, Excel, Presentation, Cad, Email, etc, to HTML, image or PDF format with the flexibility to render the whole document or custom range of pages.\n\n## Requirements\n\n* Java SE Development Kit 8\n\n## Installation\n\n### Maven\n\nAdd following repository and dependency to your project's POM\n\n```xml\n\u003crepository\u003e\n    \u003cid\u003egroupdocs-artifact-repository\u003c/id\u003e\n    \u003cname\u003eGroupDocs Artifact Repository\u003c/name\u003e\n    \u003curl\u003ehttps://repository.groupdocs.cloud/repo\u003c/url\u003e\n\u003c/repository\u003e\n```\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.groupdocs\u003c/groupId\u003e\n    \u003cartifactId\u003egroupdocs-viewer-cloud\u003c/artifactId\u003e\n    \u003cversion\u003e25.7\u003c/version\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\nAdd following repository and dependency to your build.gradle:\n\n```javascript\nrepositories {\n    maven {\n        url \"https://repository.groupdocs.cloud/repo/\"\n    }\n}\n\n...\ndependencies {\n    ...\n    implementation 'com.groupdocs:groupdocs-viewer-cloud:25.7'\n}\n```\n\n## Getting Started\n\n* Please follow the [installation](#installation) instruction\n* Get your AppSID and AppKey at [Dashboard](https://dashboard.groupdocs.cloud) and use them in your code\n* Build and execute\n* Explore more samples at [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples)\n\nBelow is an example demonstrating how to preview document using GroupDocs.Viewer Cloud SDK for Java:\n\n```java\nimport com.groupdocs.cloud.viewer.api.ViewApi;\nimport com.groupdocs.cloud.viewer.client.Configuration;\nimport com.groupdocs.cloud.viewer.model.requests.ConvertAndDownloadRequest;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.FileOutputStream;\n\npublic class Example {\n\n    public static void main(String[] args) {\n        // For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples\n        String myClientId = \"\"; // Get Client Id from https://dashboard.groupdocs.cloud\n        String myClientSecret = \"\"; // Get Client Secret from https://dashboard.groupdocs.cloud\n\n        Configuration configuration = new Configuration(myClientId, myClientSecret);\n        ViewApi viewApi = new ViewApi(configuration);\n\n        String format = \"jpg\";\n        try (InputStream fileStream = new FileInputStream(\"myfile.docx\")) {\n            ConvertAndDownloadRequest request = new ConvertAndDownloadRequest(format, fileStream);\n            InputStream result = viewApi.convertAndDownload(request);\n\n            // Save the resulting stream (a *.jpg file) for your purpose\n            try (OutputStream outStream = new FileOutputStream(\"output.jpg\")) {\n                byte[] buffer = new byte[8192];\n                int bytesRead;\n                while ((bytesRead = result.read(buffer)) != -1) {\n                    outStream.write(buffer, 0, bytesRead);\n                }\n            }\n            result.close();\n        } catch (Exception e) {\n            System.err.println(\"Failed to convert and download the document\");\n            e.printStackTrace();\n        }\n    }\n}\n```\n\nAnd here is an example demonstrating how to upload the document, render it, and download the result using GroupDocs.Viewer Cloud SDK for Java:\n\n```java\nimport com.groupdocs.cloud.viewer.api.ViewApi;\nimport com.groupdocs.cloud.viewer.api.FileApi;\nimport com.groupdocs.cloud.viewer.client.Configuration;\nimport com.groupdocs.cloud.viewer.model.*;\nimport com.groupdocs.cloud.viewer.model.requests.*;\n\nimport java.io.FileInputStream;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.FileOutputStream;\n\npublic class Example {\n\n    public static void main(String[] args) {\n        // For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples\n        String myClientId = \"\"; // Get Client Id from https://dashboard.groupdocs.cloud\n        String myClientSecret = \"\"; // Get Client Secret from https://dashboard.groupdocs.cloud\n\n        Configuration configuration = new Configuration(myClientId, myClientSecret);\n\n        try {\n            // Upload a file to cloud storage\n            FileApi fileApi = new FileApi(configuration);\n            try (InputStream uploadStream = new FileInputStream(\"myfile.docx\")) {\n                UploadFileRequest uploadRequest = new UploadFileRequest(\"myfile.docx\", uploadStream, null);\n                fileApi.uploadFile(uploadRequest);\n            }\n\n            // Render it to HTML\n            ViewApi viewApi = new ViewApi(configuration);\n            FileInfo fileInfo = new FileInfo();\n            fileInfo.setFilePath(\"myfile.docx\");\n\n            ViewOptions viewOptions = new ViewOptions();\n            viewOptions.setFileInfo(fileInfo);\n            viewOptions.setViewFormat(ViewOptions.ViewFormatEnum.HTML);\n            viewOptions.setOutputPath(\"myfile.html\");\n\n            CreateViewRequest viewRequest = new CreateViewRequest(viewOptions);\n            viewApi.createView(viewRequest);\n\n            // Download the result\n            DownloadFileRequest downloadRequest = new DownloadFileRequest(\"myfile.html\", null, null);\n            InputStream result = fileApi.downloadFile(downloadRequest);\n\n            // Use resulting stream (a *.html file in this example) for your purpose\n            try (OutputStream outStream = new FileOutputStream(\"output.html\")) {\n                byte[] buffer = new byte[8192];\n                int bytesRead;\n                while ((bytesRead = result.read(buffer)) != -1) {\n                    outStream.write(buffer, 0, bytesRead);\n                }\n            }\n            result.close();\n\n        } catch (Exception e) {\n            System.err.println(\"Failed to upload, render, or download the document\");\n            e.printStackTrace();\n        }\n    }\n}\n```\n\n## Manual build and installation from sources\n\nBuilding the API client library requires [Maven](https://maven.apache.org/) to be installed.\nRefer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.\n\nAt first generate the JAR by executing following command in \"/src\" working directory:\n\n```shell\nmvn package -D maven.test.skip=true\n```\n\nThen manually install the following JARs:\n\n* target/groupdocs-viewer-cloud-25.7.jar\n* target/lib/*.jar\n\n## Licensing\n\nAll GroupDocs.Viewer Cloud SDKs are licensed under [MIT License](LICENSE).\n\n## Resources\n\n* [**Website**](https://www.groupdocs.cloud)\n* [**Product Home**](https://products.groupdocs.cloud/viewer)\n* [**Documentation**](https://docs.groupdocs.cloud/viewer/)\n* [**Free Support Forum**](https://forum.groupdocs.cloud/c/viewer)\n* [**Blog**](https://blog.groupdocs.cloud/category/viewer)\n\n## Contact Us\n\nYour feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/viewer).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroupdocs-viewer-cloud%2Fgroupdocs-viewer-cloud-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroupdocs-viewer-cloud%2Fgroupdocs-viewer-cloud-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroupdocs-viewer-cloud%2Fgroupdocs-viewer-cloud-java/lists"}