<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"ドキュメント エディタ Java クラウド REST API
Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | {{ハイパーリンク8}}
GroupDocs.Editor Cloud SDK for Java は、サードパーティ ソフトウェアをインストールしなくても動作するクラウド ドキュメント エディター Java アプリの構築を支援します。 GroupDocs.Editor Cloud REST APIs のラッパーです。
要件
API クライアント ライブラリを構築するには、次のものが必要です。
- Java 1.7+
- メイヴン
前提条件
GroupDocs.Editor Cloud SDK for Java を使用するには、GroupDocs Cloud でアカウントを登録し、Cloud Dashboard でクライアント ID とクライアント シークレットを検索/作成する必要があります。無料枠あります。詳細については、GroupDocs Cloud Pricing を参照してください。
Maven から GroupDocs.Editor-Cloud をインストールする
GroupDocs Cloud リポジトリをアプリケーションの pom.xml に追加します
<repository>
<id>repository.groupdocs.cloud</id>
<name>repository.groupdocs.cloud</name>
<url>https://releases.groupdocs.cloud/java/repo/</url>
</repository>
ソースからインストール
API クライアント ライブラリをローカルの Maven リポジトリにインストールするには、次のコマンドを実行するだけです。
mvn clean install
代わりにリモートの Maven リポジトリにデプロイするには、リポジトリの設定を構成し、次を実行します。
mvn clean deploy
詳細については、OSSRH Guide を参照してください。
Maven ユーザー
この依存関係をプロジェクトの POM に追加します。
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-editor-cloud</artifactId>
<version>22.5</version>
<type>pom</type>
</dependency>
その他
最初に、次を実行して JAR を生成します。
mvn clean package
次に、次の JAR を手動でインストールします。
target/groupdocs-editor-cloud-22.5.jartarget/lib/*.jar
始めましょう
Quick Startの指示に従ってください。
クラウドで「DOCX」を編集する Java コードのサンプル
/ 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());
承認と認証
API 用に定義された Authentication schemes は次のとおりです。
JWT
- タイプ: OAuth 2.0
- フロー: アプリケーション
- 認証 URL:https://api.groupdocs.cloud/connect/token
- トークンの有効期間: 1 日 (デフォルト)
Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | {{ハイパーリンク8}}
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

