Skip to content

Commit 3cd21b1

Browse files
Google APIscopybara-github
authored andcommitted
feat: make page_range field public
fix: `OcrConfig.compute_style_info` is deprecated. Use `PremiumFeatures.compute_style_info` instead. PiperOrigin-RevId: 568225060
1 parent 38894df commit 3cd21b1

2 files changed

Lines changed: 49 additions & 3 deletions

File tree

google/cloud/documentai/v1/document_io.proto

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ message RawDocument {
3939
// the following:
4040
// `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,`
4141
// `~`, `=` and `:` are reserved.
42-
// If not specified, a default ID will be generated.
42+
// If not specified, a default ID is generated.
4343
string display_name = 3;
4444
}
4545

@@ -122,6 +122,19 @@ message OcrConfig {
122122
repeated string language_hints = 1;
123123
}
124124

125+
// Configurations for premium OCR features.
126+
message PremiumFeatures {
127+
// Turn on selection mark detector in OCR engine. Only available in OCR 2.0+
128+
// processors.
129+
bool enable_selection_mark_detection = 3;
130+
131+
// Turn on font identification model and return font style information.
132+
bool compute_style_info = 4;
133+
134+
// Turn on the model that can extract LaTeX math formulas.
135+
bool enable_math_ocr = 5;
136+
}
137+
125138
// Hints for the OCR model.
126139
Hints hints = 2;
127140

@@ -146,7 +159,16 @@ message OcrConfig {
146159
// Includes symbol level OCR information if set to true.
147160
bool enable_symbol = 6;
148161

149-
// Turn on font id model and returns font style information.
150-
// Use PremiumFeatures.compute_style_info instead.
162+
// Turn on font identification model and return font style information.
163+
// Deprecated, use
164+
// [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
165+
// instead.
151166
bool compute_style_info = 8 [deprecated = true];
167+
168+
// Turn off character box detector in OCR engine. Character box detection is
169+
// enabled by default in OCR 2.0+ processors.
170+
bool disable_character_boxes_detection = 10;
171+
172+
// Configurations for premium OCR features.
173+
PremiumFeatures premium_features = 11;
152174
}

google/cloud/documentai/v1/document_processor_service.proto

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,30 @@ service DocumentProcessorService {
328328

329329
// Options for Process API
330330
message ProcessOptions {
331+
// A list of individual page numbers.
332+
message IndividualPageSelector {
333+
// Optional. Indices of the pages (starting from 1).
334+
repeated int32 pages = 1 [(google.api.field_behavior) = OPTIONAL];
335+
}
336+
337+
// A subset of pages to process. If not specified, all pages will be
338+
// processed. NOTICE: If any of the page range is set, we will extract and
339+
// process only the given pages from the document. In the output document,
340+
// [Document.Page.page_number][google.cloud.documentai.v1.Document.Page.page_number]
341+
// is referring to the page number in the original document. This
342+
// configuration only applies to sync requests.
343+
oneof page_range {
344+
// Which pages to process (1-indexed).
345+
IndividualPageSelector individual_page_selector = 5;
346+
347+
// Only process certain pages from the start. Process all if the document
348+
// has fewer pages.
349+
int32 from_start = 6;
350+
351+
// Only process certain pages from the end, same as above.
352+
int32 from_end = 7;
353+
}
354+
331355
// Only applicable to `OCR_PROCESSOR`. Returns error if set on other
332356
// processor types.
333357
OcrConfig ocr_config = 1;

0 commit comments

Comments
 (0)