LoginSignup
0
0

More than 3 years have passed since last update.

JavaはPPTドキュメントを最終状態としてマークします

Posted at

PPTドキュメントを設計および作成した後、ドキュメントが最終的な設計状態に達したことを示し、内部のコンテンツを誰も編集および変更したくない場合は、PPTドキュメントを最終状態としてマークできます。この記事では、Free Spire.Presentation for Javaを使用してPPTプレゼンテーションを最終版としてマークする方法について説明します。

JARパッケージのインポート
方法1:Free Spire.Presentation for Javaをダウンロードして解凍し、jarパッケージをlibフォルダーに依存関係としてJavaアプリケーションに直接インポートします。

方法2:Mavenリポジトリからjarパッケージをインストールし、pom.xmlファイルのコードを次のように構成します。

<repositories>
        <repository>
            <id>com.e-iceblue</id>
            <name>e-iceblue</name>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.presentation.free</artifactId>
        <version>2.6.1</version>
    </dependency>
</dependencies>

Javaコード

import com.spire.presentation.FileFormat;
import com.spire.presentation.Presentation;

public class MarkAsFinal {
    public static void main(String[] args) throws Exception {

        //サンプルドキュメントをロード
        Presentation presentation = new Presentation();
        presentation.loadFromFile("test.pptx");

        //ドキュメントプロパティMarkAsFinalをtrueに設定します
        presentation.getDocumentProperty().set("_MarkAsFinal", true);

        //文書を保存します
        presentation.saveToFile("MarkasFinal.pptx", FileFormat.PPTX_2010);
    }
}

ja.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0