{
  "name": "scorpiox-pdfbooklet",
  "version": "1.0.4",
  "exports": [
    {
      "name": "pdfbooklet_init",
      "return": "int",
      "csharp_return": "int",
      "args": [],
      "note": "Returns 1."
    },
    {
      "name": "pdfbooklet_cleanup",
      "return": "void",
      "csharp_return": "void",
      "args": [],
      "note": "Clears the error buffer."
    },
    {
      "name": "pdfbooklet_create",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "output_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ],
      "note": "Saddle-stitch booklet (fold-and-staple). Returns 1 success / 0 failure. Sheet size derived from first page (portrait source -> landscape A4, landscape source -> landscape Letter). Output is a self-contained PDF 1.4 classic-xref file: one landscape page per physical sheet, source pages embedded as /Form XObjects with the page's /Resources (fonts) copied and references remapped."
    },
    {
      "name": "pdfbooklet_create_sized",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "output_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "sheet_size",
          "type": "int",
          "csharp_type": "int"
        }
      ],
      "note": "Same as pdfbooklet_create with explicit sheet size: 0=A4 (842x595), 1=Letter (792x612), 2=A3 (1190.55x841.89), all landscape. -1 = derive from first page. Other values are errors. Returns 1 success / 0 failure."
    },
    {
      "name": "pdfbooklet_page_count",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ],
      "note": "Page count of the input PDF, or -1 on error."
    },
    {
      "name": "pdfbooklet_last_error",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [],
      "note": "Static buffer, valid until next call. Empty string when no error. Marshal as IntPtr + PtrToStringAnsi on .NET (string return aborts on Linux .NET 9)."
    }
  ]
}
