{
  "name": "scorpiox-pdfredact",
  "version": "1.0.7",
  "exports": [
    {
      "name": "pdfredact_init",
      "return": "int",
      "csharp_return": "int",
      "args": [],
      "note": "Initialises the library subsystem. Returns 1."
    },
    {
      "name": "pdfredact_cleanup",
      "return": "void",
      "csharp_return": "void",
      "args": [],
      "note": "Releases library resources and clears the error buffer."
    },
    {
      "name": "pdfredact_region",
      "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",
          "type": "int",
          "csharp_type": "int",
          "note": "1-based page number."
        },
        {
          "name": "x",
          "type": "float",
          "csharp_type": "float",
          "note": "X coordinate in points from bottom-left."
        },
        {
          "name": "y",
          "type": "float",
          "csharp_type": "float",
          "note": "Y coordinate in points from bottom-left."
        },
        {
          "name": "width",
          "type": "float",
          "csharp_type": "float",
          "note": "Width in points."
        },
        {
          "name": "height",
          "type": "float",
          "csharp_type": "float",
          "note": "Height in points."
        },
        {
          "name": "r",
          "type": "int",
          "csharp_type": "int",
          "note": "Red component (0-255)."
        },
        {
          "name": "g",
          "type": "int",
          "csharp_type": "int",
          "note": "Green component (0-255)."
        },
        {
          "name": "b",
          "type": "int",
          "csharp_type": "int",
          "note": "Blue component (0-255)."
        }
      ],
      "note": "Redacts a rectangular region on a page (coordinates in points from bottom-left). Returns 1 on success, 0 on failure. Decodes content streams filtered with /ASCIIHexDecode or /AHx (v1.0.6). Decodes and redacts /Subtype /Form XObject content recursively (v1.0.5). Sanitizes hidden information by default (v1.0.4): /Info, XMP /Metadata, annotations, widget /V, outlines, embedded files. Returns 0 with a named last_error and writes nothing if any search-text occurrence survives."
    },
    {
      "name": "pdfredact_text",
      "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": "search_text",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str",
          "note": "Text to search and redact on all pages."
        },
        {
          "name": "r",
          "type": "int",
          "csharp_type": "int",
          "note": "Red component (0-255)."
        },
        {
          "name": "g",
          "type": "int",
          "csharp_type": "int",
          "note": "Green component (0-255)."
        },
        {
          "name": "b",
          "type": "int",
          "csharp_type": "int",
          "note": "Blue component (0-255)."
        }
      ],
      "note": "Redacts text matching a pattern on all pages. Replaces text in content streams and overlays blackout rectangle. Returns 1 on success, 0 on failure. Decodes content streams filtered with /ASCIIHexDecode or /AHx (v1.0.6). Decodes and redacts /Subtype /Form XObject content recursively (v1.0.5). Sanitizes hidden information by default (v1.0.4): /Info, XMP /Metadata, annotations, widget /V, outlines, embedded files. Returns 0 with a named last_error and writes nothing if any search-text occurrence survives."
    },
    {
      "name": "pdfredact_regions",
      "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": "regions",
          "type": "const float*",
          "csharp_type": "float[]",
          "marshal": "UnmanagedType.LPArray",
          "note": "Array of floats with 5 elements per region: {page, x, y, width, height}."
        },
        {
          "name": "region_count",
          "type": "int",
          "csharp_type": "int",
          "note": "Number of regions in the array."
        },
        {
          "name": "r",
          "type": "int",
          "csharp_type": "int",
          "note": "Red component (0-255)."
        },
        {
          "name": "g",
          "type": "int",
          "csharp_type": "int",
          "note": "Green component (0-255)."
        },
        {
          "name": "b",
          "type": "int",
          "csharp_type": "int",
          "note": "Blue component (0-255)."
        }
      ],
      "note": "Redacts multiple regions (batch). regions = array of {page, x, y, w, h}. Returns 1 on success, 0 on failure. Decodes content streams filtered with /ASCIIHexDecode or /AHx (v1.0.6). Decodes and redacts /Subtype /Form XObject content recursively (v1.0.5). Sanitizes hidden information by default (v1.0.4): /Info, XMP /Metadata, annotations, widget /V, outlines, embedded files. Returns 0 with a named last_error and writes nothing if any search-text occurrence survives."
    },
    {
      "name": "pdfredact_count_matches",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "search_text",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str",
          "note": "Literal text to search for (case-insensitive), same matching as pdfredact_text."
        }
      ],
      "note": "Counts occurrences of search_text across all pages without writing output. Returns the number of matches (>= 0), or -1 on failure with pdfredact_last_error() set (including undecodable content streams). Use to distinguish '0 occurrences' from 'redacted'."
    },
    {
      "name": "pdfredact_last_error",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [],
      "note": "Returns a static error message string. Valid until next call. Marshal as IntPtr + PtrToStringAnsi on C# Linux."
    }
  ]
}
