<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-annotation</artifactId>
    <version>23.8</version>
</dependency>
copied!  
compile(group: 'com.groupdocs', name: 'groupdocs-annotation', version: '23.8')
copied!  
<dependency org="com.groupdocs" name="groupdocs-annotation" rev="23.8">
    <artifact name="groupdocs-annotation" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.groupdocs" % "groupdocs-annotation" % "23.8"
copied!  

製品 ドキュメント デモ APIリファレンス サンプル ブログ サポート ライセンス

GroupDocs.Annotation for Java 23.8の新機能

概要

GroupDocs.Annotation for Java 23.8のリリースには、価値ある新機能と重要なバグ修正が含まれています。このアップデートにより、ドキュメントの使いやすさとインタラクティブ性が向上し、ドキュメントとAPIリファレンスが最新の状態に保たれます。

主要機能

ドキュメントにコンポーネントを追加

  • ボタンコンポーネント: インタラクティブなボタンをドキュメント内に埋め込むことができ、ユーザーのインタラクションが向上します。
  • ドロップダウンコンポーネント: データ収集とユーザーのカスタマイズを向上させるために、ドロップダウンリストを作成します。
  • チェックボックスコンポーネント: ドキュメント内でタスクの追跡や条件付きインタラクションのためにチェックボックスを導入します。

修正点

  • Squigglyアノテーションのドキュメント: ドキュメント内で欠落していたSquigglyアノテーションの記事が復元され、その使用方法に関する詳細なガイダンスが提供されます。
  • APIリファレンスの更新: すべてのAPIリファレンスが最新情報に更新され、ユーザーが最新情報にアクセスできるようになりました。

コードサンプル

ボタンコンポーネントの追加

次のコードスニペットは、ボタンコンポーネントをPDFドキュメントに追加する方法を示しています。ボタンは、位置、ボーダースタイル、色、さらにはコメントを含めるなど、さまざまなプロパティでカスタマイズできます。

try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) {
    // ButtonComponentをインスタンス化し、プロパティを設定
    ButtonComponent buttonComponent = new ButtonComponent();
    buttonComponent.setCreatedOn(new Date()); // 作成日を設定
    buttonComponent.setStyle(BorderStyle.DASHED); // ボーダースタイルを破線に設定
    buttonComponent.setMessage("これはボタンコンポーネントです"); // ボタンのラベルテキストを設定
    buttonComponent.setBorderColor(1422623); // ボーダーの色を設定
    buttonComponent.setPenColor(14527697); // ペン(枠)の色を設定
    buttonComponent.setButtonColor(10832612); // ボタンの背景色を設定
    buttonComponent.setPageNumber(0); // ボタンを配置するページ番号を指定
    buttonComponent.setBorderWidth(12); // ボーダーの幅を設定
    buttonComponent.setBox(new Rectangle(100, 300, 90, 30)); // ボタンの位置とサイズを設定

    // ボタンにコメント(返信)を追加
    Reply reply1 = new Reply();
    reply1.setComment("最初のコメント");
    reply1.setRepliedOn(new Date());

    Reply reply2 = new Reply();
    reply2.setComment("2つ目のコメント");
    reply2.setRepliedOn(new Date());

    List<Reply> replies = new ArrayList<>();
    replies.add(reply1);
    replies.add(reply2);

    buttonComponent.setReplies(replies); // 返信をボタンに添付

    // ドキュメントにボタンコンポーネントを追加
    annotator.add(buttonComponent);

    // ボタンコンポーネントを含む修正されたドキュメントを保存
    annotator.save("result_button_component.pdf");
}

出典*

チェックボックスコンポーネントの追加

このコードスニペットは、チェックボックスコンポーネントをPDFドキュメントに追加する方法を示しています。チェックボックスは、選択されているかどうか、色、スタイルなどのプロパティでカスタマイズできます。

try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) {
    // CheckBoxComponentをインスタンス化し、プロパティを設定
    CheckBoxComponent checkbox = new CheckBoxComponent();
    checkbox.setChecked(true); // チェックボックスを選択状態に設定
    checkbox.setBox(new Rectangle(100, 100, 100, 100)); // チェックボックスの位置とサイズを設定
    checkbox.setPenColor(65535); // ペン(枠)の色を設定
    checkbox.setStyle(BoxStyle.STAR); // チェックボックスのスタイル(例:星形)を設定

    // チェックボックスにコメント(返信)を追加
    Reply reply1 = new Reply();
    reply1.setComment("最初のコメント");
    reply1.setRepliedOn(new Date());

    Reply reply2 = new Reply();
    reply2.setComment("2つ目のコメント");
    reply2.setRepliedOn(new Date());

    List<Reply> replies = new ArrayList<>();
    replies.add(reply1);
    replies.add(reply2);

    checkbox.setReplies(replies); // 返信をチェックボックスに添付

    // ドキュメントにチェックボックスコンポーネントを追加
    annotator.add(checkbox);

    // チェックボックスコンポーネントを含む修正されたドキュメントを保存
    annotator.save("result_checkbox_component.pdf");
}

出典*

ドロップダウンコンポーネントの追加

次のコードは、ドロップダウン(コンボボックス)コンポーネントをPDFドキュメントに追加する方法を示しています。このコンポーネントには選択可能なオプションのリストを保持させることができ、ボーダースタイルや色などのプロパティで外観をカスタマイズできます。

try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) {
    // DropdownComponentをインスタンス化し、プロパティを設定
    DropdownComponent dropdownComponent = new DropdownComponent();
    dropdownComponent.setOptions(new ArrayList<>(Arrays.asList("Item1", "Item2", "Item3"))); // ドロップダウンのオプションを設定
    dropdownComponent.setSelectedOption(null); // デフォルトでは選択されていない
    dropdownComponent.setPlaceholder("オプ

ションを選択"); // プレースホルダーテキストを設定
    dropdownComponent.setBox(new Rectangle(100, 100, 100, 100)); // ドロップダウンの位置とサイズを設定
    dropdownComponent.setCreatedOn(new Date()); // 作成日を設定
    dropdownComponent.setMessage("これはドロップダウンコンポーネントです"); // ドロップダウンのラベルテキストを設定
    dropdownComponent.setPageNumber(0); // ページ番号を指定
    dropdownComponent.setPenColor(65535); // ペン(枠)の色を設定
    dropdownComponent.setPenStyle(PenStyle.DOT); // 枠線のスタイル(点線)を設定
    dropdownComponent.setPenWidth((byte) 3); // 枠線の幅をピクセル単位で設定

    // ドロップダウンにコメント(返信)を追加
    List<Reply> replies = new ArrayList<>();
    Reply reply1 = new Reply();
    reply1.setComment("最初のコメント");
    reply1.setRepliedOn(new Date());

    Reply reply2 = new Reply();
    reply2.setComment("2つ目のコメント");
    reply2.setRepliedOn(new Date());

    replies.add(reply1);
    replies.add(reply2);

    dropdownComponent.setReplies(replies); // 返信をドロップダウンに添付

    // ドキュメントにドロップダウンコンポーネントを追加
    annotator.add(dropdownComponent);

    // ドロップダウンコンポーネントを含む修正されたドキュメントを保存
    annotator.save("result_dropdown_component.pdf");
}

出典*

🔍 完全なリリースの詳細を探る

このリリースで導入されたすべての新機能、強化、およびバグ修正の完全なリストを見るには、GroupDocs.Annotation for Java 23.8リリースノート をご覧ください。

製品 ドキュメント デモ APIリファレンス サンプル ブログ サポート ライセンス

VersionRelease Date
24.62024年6月30日
23.102023年10月9日
23.82023年8月28日
23.62023年6月23日
23.42023年4月17日
23.22023年4月16日
21.7.22022年1月25日
21.7.12022年1月25日
2.0.02022年1月25日
19.22022年1月25日
17.102022年1月25日
17.10.32022年1月25日
1.5.02022年1月25日
21.72021年7月21日
19.72020年2月19日
20.22020年2月13日
19.52019年5月30日
19.42019年4月15日
18.12018年10月16日
18.102018年10月16日
1.4.02018年4月18日
1.6.02018年4月18日
1.7.02018年4月18日
1.7.12018年4月18日
1.8.02018年4月18日
1.8.12018年4月18日
1.8.22018年4月18日
1.9.02018年4月18日
17.1.02018年4月18日
17.10.12018年4月18日
17.10.22018年4月18日
17.5.02018年4月18日
17.6.02018年4月18日
18.42018年4月18日
3.1.02018年4月18日