{
  "name": "scorpiox-pdfrotate",
  "version": "1.0.2",
  "exports": [
    {
      "name": "pdfrotate_init",
      "return": "int",
      "csharp_return": "int",
      "args": []
    },
    {
      "name": "pdfrotate_cleanup",
      "return": "void",
      "csharp_return": "void",
      "args": []
    },
    {
      "name": "pdfrotate_all",
      "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": "degrees",
          "type": "int",
          "csharp_type": "int"
        }
      ],
      "note": "Returns 1 success / 0 failure. degrees must be 90, 180 or 270, applied RELATIVE to each page's effective rotation (ISO 32000 /Rotate, override inheritance). Output is a fresh classic-xref PDF 1.4 with explicit /Rotate on the affected pages."
    },
    {
      "name": "pdfrotate_pages",
      "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": "pages",
          "type": "const int*",
          "csharp_type": "int[]"
        },
        {
          "name": "page_count",
          "type": "int",
          "csharp_type": "int"
        },
        {
          "name": "degrees",
          "type": "int",
          "csharp_type": "int"
        }
      ],
      "note": "pages is a 1-based array of page numbers (document order). Returns 1 success / 0 failure. Out-of-range pages are errors."
    },
    {
      "name": "pdfrotate_page",
      "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": "page_number",
          "type": "int",
          "csharp_type": "int"
        },
        {
          "name": "degrees",
          "type": "int",
          "csharp_type": "int"
        }
      ],
      "note": "Single 1-based page. Returns 1 success / 0 failure."
    },
    {
      "name": "pdfrotate_get_rotation",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "page_number",
          "type": "int",
          "csharp_type": "int"
        }
      ],
      "note": "Effective rotation of a 1-based page: 0/90/180/270, honouring /Rotate inheritance (override semantics: own value wins, else nearest ancestor). Returns -1 on error (missing file, bad page number, encrypted PDF, no pages)."
    },
    {
      "name": "pdfrotate_last_error",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [],
      "note": "Static buffer, valid until the next call. Empty string when no error. On C# marshal as IntPtr + Marshal.PtrToStringAnsi — do NOT declare the P/Invoke return as string (Linux .NET 9 aborts: free(): invalid pointer)."
    }
  ]
}
