syntax = "proto3";
import "basic.proto";
import "pdfium_pdf_document.proto";
package ironpdfengineproto;

option java_package = "com.ironsoftware.ironpdf.internal.proto";
option java_multiple_files = true;

message PdfiumExtractAllTextRequestP {
  PdfDocumentP document = 1;
  repeated int32 page_indexes = 2; // null/empty for all pages
  optional bool is_license = 3;
}

message PdfiumReplaceTextRequestP {
  PdfDocumentP document = 1;
  int32 page_index = 2;
  string current_text = 3;
  string new_text = 4;
  optional PdfiumFontInfoP custom_font = 5;
  optional float custom_font_size = 6;
}

message PdfiumDrawTextRequestP {
  PdfDocumentP document = 1;
  int32 page_index = 2;
  string text = 3;
  PdfiumFontInfoP font = 4;
  double font_size = 5;
  double x = 6;
  double y = 7;
  double scale = 8;
  double rotation = 9;
  string color = 10;
}

message PdfiumRedactTextRequestP {
	PdfDocumentP document = 1;
	int32 page_index = 2;
	string replace_text = 3;
	bool is_draw_boxes = 4;
	bool match_whole_words = 5;
	string replacement_text = 6;
	bool case_sensitive = 7;
}

message PdfiumRedactRegionsRequestP {
	PdfDocumentP document = 1;
	int32 page_index = 2;
	repeated Rectangle regions = 3;
	bool is_draw_boxes = 4;
}

// DrawTexts batch operation proto definitions
message PdfiumDrawTextObjectP {
  string text = 1;
  double x = 2;
  double y = 3;
  PdfiumFontInfoP font = 4;
  double font_size = 5;
  double scale = 6;
  double rotation = 7;
  string color = 8;
}

message PdfiumDrawTextsRequestStreamP {
  message InfoP {
    PdfDocumentP document = 1;
    int32 page_index = 2;
    int32 text_count = 3;
  }
  oneof request_data {
    InfoP info = 1;
    PdfiumDrawTextObjectP text_object = 2;
  }
}
