<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-editor-cloud</artifactId>
<version>22.5</version>
</dependency>compile(group: 'com.groupdocs', name: 'groupdocs-editor-cloud', version: '22.5')<dependency org="com.groupdocs" name="groupdocs-editor-cloud" rev="22.5">
<artifact name="groupdocs-editor-cloud" ext="jar"/>
</dependency>libraryDependencies += "com.groupdocs" % "groupdocs-editor-cloud" % "22.5"Belge Düzenleyici Java Cloud REST API
Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial
GroupDocs.Editor Cloud SDK for Java, herhangi bir 3. taraf yazılımı yüklemeden çalışan bulut Doküman Düzenleyici Java Uygulamaları oluşturmanıza yardımcı olur. GroupDocs.Editor Cloud REST APIs etrafındaki bir sarmalayıcıdır.
Gereksinimler
API istemci kitaplığının oluşturulması şunları gerektirir:
- Java 1.7+
- Uzman
Önkoşullar
GroupDocs.Editor Cloud SDK for Java’yı kullanmak için GroupDocs Cloud ile bir hesap kaydetmeniz ve Cloud Dashboard adresinde İstemci Kimliği ve İstemci Sırrı aramanız/oluşturmanız gerekir. Ücretsiz kontenjan mevcuttur. Daha fazla ayrıntı için bkz. GroupDocs Cloud Pricing.
Maven’den GroupDocs.Editor-Cloud’u kurun
GroupDocs Bulut deposunu uygulamanıza pom.xml ekleyin
<repository>
<id>repository.groupdocs.cloud</id>
<name>repository.groupdocs.cloud</name>
<url>https://releases.groupdocs.cloud/java/repo/</url>
</repository>
Kaynaktan yükleyin
API istemci kitaplığını yerel Maven deponuza yüklemek için aşağıdakileri yürütmeniz yeterlidir:
mvn clean install
Bunun yerine uzak bir Maven deposuna konuşlandırmak için deponun ayarlarını yapılandırın ve şunu çalıştırın:
mvn clean deploy
Daha fazla bilgi için OSSRH Guide konusuna bakın.
Maven kullanıcıları
Bu bağımlılığı projenizin POM’una ekleyin:
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-editor-cloud</artifactId>
<version>22.5</version>
<type>pom</type>
</dependency>
Diğerleri
İlk önce aşağıdakileri yürüterek JAR’ı oluşturun:
mvn clean package
Ardından aşağıdaki JAR’ları manuel olarak kurun:
target/groupdocs-editor-cloud-22.5.jartarget/lib/*.jar
Başlamak
Lütfen Quick Start talimatlarını uygulayın.
Bulutta bir “DOCX"i düzenlemek için örnek Java Kodu
/ For complete examples and data files, please go to https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-java-samples
String MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
String MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
Configuration configuration = new Configuration(MyAppSid, MyAppKey);
// Create necessary API instances
EditApi editApi = new EditApi(configuration);
FileApi fileApi = new FileApi(configuration);
// The document already uploaded into the storage.
// Load it into editable state
FileInfo fileInfo = new FileInfo();
fileInfo.setFilePath("WordProcessing/password-protected.docx");
fileInfo.setPassword("password");
WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions();
loadOptions.setFileInfo(fileInfo);
loadOptions.setOutputPath("output");
LoadResult loadResult = editApi.load(new LoadRequest(loadOptions));
// Download html document
File file = fileApi.downloadFile(new DownloadFileRequest(loadResult.getHtmlPath(), null, null));
// Edit something...
List<String> lines = Files.readAllLines(file.toPath());
List<String> newLines = new ArrayList<String>();
for (String line : lines) {
newLines.add(line.replaceAll("Sample test text", "Hello world"));
}
Files.write(file.toPath(), newLines);
// Upload html back to storage
fileApi.uploadFile(new UploadFileRequest(loadResult.getHtmlPath(), file, Common.MYStorage));
// Save html back to docx
WordProcessingSaveOptions saveOptions = new WordProcessingSaveOptions();
saveOptions.setFileInfo(fileInfo);
saveOptions.setOutputPath("output/edited.docx");
saveOptions.setHtmlPath(loadResult.getHtmlPath());
saveOptions.setResourcesPath(loadResult.getResourcesPath());
DocumentResult saveResult = editApi.save(new SaveRequest(saveOptions));
System.out.println("Document edited: " + saveResult.getPath());
Yetkilendirme ve Kimlik Doğrulama
API için tanımlanan Authentication schemes aşağıdaki gibidir:
JWT
- Tür: OAuth 2.0
- Akış: uygulama
- Yetkilendirme URL’si:https://api.groupdocs.cloud/connect/token
- Jeton Ömrü: 1 gün (Varsayılan)
Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial
GroupDocs Java REST API Maven SDK Java SDK Cloud REST REST API Cloud API MIT JWT oauth GroupDocs.Total Cloud GroupDocs.Editor Cloud JAR document automation document automation cloud document DOC DOCX DOCM DOT DOTM DOTX FlatOPC RTF WordML TXT ODT OTT XLS XLT XLSX XLSM XLTX XLTM XLSB XLAM SpreadsheetML DIF DSV CSV TSV SXC ODS FODS PPT PPTX PPTM PPS PPSX PPSM POT POTX POTM ODP OTP HTML XML editor editing multi lingual font appearance XML document structure highlight formatting extraction extract extractor

