データ構造

1. 注釈保存ファイル (.clrop - ClassRoom PDF Annotation)

.clrop は、PDF 本体を一切傷つけずに注釈・手書きペン・テキスト・図形を別保存するための標準 JSON フォーマットです。

全体構造 (Root JSON Schema)

{
  "version": 1,
  "app_version": "0.9.003",
  "target_pdf_hash": "a1b2c3d4...",
  "page_count": 12,
  "pages": [
    {
      "page_index": 0,
      "annotations": [
        {
          "id": "annot-uuid-1",
          "type": "ink",
          "color": "#FF0000",
          "opacity": 1.0,
          "thickness": 2.5,
          "points": [
            { "x": 100.5, "y": 200.0 },
            { "x": 105.0, "y": 202.5 }
          ]
        },
        {
          "id": "annot-uuid-2",
          "type": "text",
          "color": "#0000FF",
          "font_size": 14,
          "bounds": { "x": 50, "y": 80, "w": 200, "h": 100 },
          "content": "ここに注釈メモ"
        }
      ]
    }
  ]
}

注釈オブジェクトプロパティ (AnnotationObject)

フィールド説明
idstring注釈ごとの固有識別子 (UUID v4)
typestringink (フリーハンド), highlight (マーカー), text (テキスト), rect (矩形), line (直線), math (TeX数式)
colorstringHEX カラーコード (#RRGGBB または #RRGGBBAA)
thicknessnumber線の太さ(ピクセル)
opacitynumber不透明度 (0.01.0)
pointsarrayink / line の場合の座標配列 [ {x, y}, ... ]
boundsobjecttext / rect の描画領域 {x, y, w, h}
contentstringtextmath の内容テキスト

2. アプリ標準ノート (.clro - ClassRoom Note)

.clro は、Markdown をハイパーセットとしてサポートする標準テキストノートです。


3. アプリ設定ファイル (pdf_workspace_setup.json)

配布物およびワークスペースで環境設定を管理する JSON ファイルです。

{
  "version": 1,
  "ui": {
    "theme": "light",
    "sidebar_width": 280,
    "last_workspace_dir": ""
  },
  "annotation_defaults": {
    "pen_color": "#FF0000",
    "pen_thickness": 2.0,
    "highlight_color": "#FFFF0040"
  },
  "safety": {
    "no_network_strict": true,
    "silent_warning_policy": true,
    "atomic_save": true
  }
}