Record Class FixedDocument

java.lang.Object
java.lang.Record
io.leandev.appfuse.pdf.FixedDocument

@ExperimentalApi public record FixedDocument(String title, List<FixedDocument.Page> pages, List<FixedDocument.LayoutIssue> layoutIssues) extends Record
固定版面文件;幾何為 mm(左上原點,x 向右、y 向下),文字、字距、線寬與虛線長度為 pt。 頁面、明細容量及續頁由模板明確建立,不自動流動或分頁;元素依清單順序繪製。
Since:
4.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
    static final record 
    黑白向量條碼。moduleMm 不縮放;一維碼 heightMm 為條高,QR 高度由模組數決定。 quietModules 為每側靜區,QR 至少 4、一維碼至少 10。payload 的業務檢查碼由應用提供。 不自動加入人眼可讀文字,需另建 Text。
    static enum 
     
    static interface 
     
    static final record 
    橢圓外接框,可用於蓋章區;填色可省略。
    static final record 
    固定文字框/圖像框;座標為外框左上角。
    static final record 
    PNG/JPEG 於框中等比置中,不拉伸;位元組防禦複製。
    static enum 
    STATIC 為框線/底圖等預印內容;VARIABLE 為每份資料。套印只輸出 VARIABLE。
    static final record 
    建立者判定的幾何問題,例如區塊重疊;不可用此接點表示權限、資料或版本錯誤。 自訂 code 應使用應用自己的穩定命名空間。嚴格政策拒絕,警示政策完整繪製。
    static final record 
    任意方向線段,可用於撕線、點線或虛線分隔。 dashPatternPt 為交替的線段與空白長度(pt,與線寬同單位);空清單為實線,奇數個元素由 PDF 重複兩次形成週期。 dashPhasePt 為週期起點偏移,實線必須為 0。整條線以單一路徑繪製,不需拆段。
    static final record 
    固定頁;同頁 ID 不得重複。嚴格政策要求框線筆畫也位於紙張內。
    static final record 
    PDF 頁面外觀底稿,固定為 STATIC 層。頁碼從 1 起,不匯入註解、AcroForm 或動作。 來源頁面須無旋轉、CropBox 原點為 0、UserUnit 為 1,尺寸與目標頁相同;不自動縮放。
    static final record 
    fillRgb 為 null 表示不填色;線寬必須大於 0。
    static final record 
    CRLF/CR 正規化為 LF,Tab 展開成四個空格(非 tab stop);其他控制字元拒絕。 lineHeightPt 為基線間距;使用整個文字框所用字型的最大 ascent/descent 檢查上下界,不以裁切掩蓋超框。 letterSpacingPt 為同一行相鄰 code point 之間額外加的距離(非負,預設 0);行尾不加, 對齊、換行與超框檢查都以含字距的寬度計算。不做字距微調(kerning)。
    static enum 
    超框依 LayoutPolicy 回報警示或拒絕;不靜默縮字或截斷。
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Creates an instance of a FixedDocument record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the layoutIssues record component.
    Returns the value of the pages record component.
    Returns the value of the title record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FixedDocument

      public FixedDocument(String title, List<FixedDocument.Page> pages, List<FixedDocument.LayoutIssue> layoutIssues)
      Creates an instance of a FixedDocument record class.
      Parameters:
      title - the value for the title record component
      pages - the value for the pages record component
      layoutIssues - the value for the layoutIssues record component
    • FixedDocument

      public FixedDocument(String title, List<FixedDocument.Page> pages)
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • pages

      public List<FixedDocument.Page> pages()
      Returns the value of the pages record component.
      Returns:
      the value of the pages record component
    • layoutIssues

      public List<FixedDocument.LayoutIssue> layoutIssues()
      Returns the value of the layoutIssues record component.
      Returns:
      the value of the layoutIssues record component