Repository navigation
Add search, highlight, redaction, and text replacement samples - #136
datalogics-dliang merged 13 commits into
Conversation
- Demonstrate direct search, AI search, highlighting, and replacement with JSON resource IDs and multipart uploads. - Pass retained search matches to highlight, redact preview/apply, and replacement calls using the same unchanged PDF. - Explain per-match replacement and stop cleanly when no matches exist. Assisted-by: Codex
- Use Axios and FormData for direct JSON and multipart requests. - Show search results passed to highlight, redact preview/apply, and replacement without changing the source PDF between calls. - Demonstrate per-match replacement and clean no-match handling. Assisted-by: Codex
- Use Guzzle for direct JSON resource-ID and multipart requests. - Pass retained search results to highlighting, redaction preview/apply, and per-match replacement using the unchanged source PDF. - Print processing responses and stop on HTTP errors or empty results. Assisted-by: Codex
- Demonstrate direct JSON resource-ID and multipart requests. - Use jq to retain search selections and add replacement text before passing them to highlight, redact preview/apply, or replace. - Stop on failed requests and leave the PDF unchanged on no matches. Assisted-by: Codex
- Add direct search, AI search, highlight, and replacement examples for JSON resource IDs and multipart uploads. - Demonstrate retained search selections passed to highlighting, redaction preview/apply, and per-match replacement. - Register all examples in the dispatcher and command help. Assisted-by: Codex
- Use OkHttp and org.json for direct JSON and multipart requests. - Demonstrate search selections reused by highlighting, redaction preview/apply, and per-match replacement. - Preserve existing dotenv and regional API configuration conventions. Assisted-by: Codex
- Index the six-language JSON and multipart examples and .NET commands. - Explain optional match filtering, required replacement text, unchanged source PDFs, and redaction preview/apply behavior. - Clarify Cloud-only AI search and Starter replacement considerations. Assisted-by: Codex
- Find confidentiality obligations with a custom AI search description, without requiring known clause wording or regex patterns. - Pass reviewed selections to highlighting in six languages with JSON resource-ID and multipart request examples. - Explain confidence review, optional filtering, and unchanged inputs. Assisted-by: Codex
- Discover potentially identifying content without supplying known names, addresses, or regex patterns. - Pass retained AI findings to redaction preview and apply in six languages with JSON resource-ID and multipart requests. - Explain reviewing AI findings and previews before permanent removal. Assisted-by: Codex
- Find people's names with the AI category instead of a supplied list of names or deterministic matching rules. - Add Person and explicit shrink_to_fit settings to retained matches before replacement, preserving surrounding text positions. - Cover six languages with JSON resource-ID and multipart requests. Assisted-by: Codex
- Register JSON and multipart AI workflow commands in .NET. - Explain how meaning-based discovery differs from literal, regex, and pattern-preset searches in the sample guide. - Distinguish discovered-name replacement from deterministic examples and document the explicit layout choice. Assisted-by: Codex
- Remove unsupported EU switch comments from AI endpoint and workflow samples across all six languages. - Clarify .NET URL configuration and US Cloud availability in the workflow guide without changing executable requests. Assisted-by: Codex
|
Corrected AI Search regional guidance in 6bc193d. All 48 AI endpoint/workflow samples now identify the US Cloud service and no longer suggest switching to EU. The guide also clarifies the .NET URL setting. Only comments and documentation changed; executable requests are unchanged. Validation passed: comment-only diff checks, unchanged Python ASTs, JavaScript/PHP/shell syntax checks, all three Java Maven verification builds, and the .NET build (zero errors; existing warnings remain). |
datalogics-dliang
left a comment
There was a problem hiding this comment.
The new samples are consistent with the repository's JSON and multipart layout and are easy to follow across languages. The guide explains the search-first workflows, AI availability, and redaction preview/apply behavior clearly. Given the reported successful runs, I have no execution concerns from this conventions review.
- List curl and jq setup checks in the cURL README. - Link the search and modify guide to the prerequisite instructions. Assisted-by: Codex
Why this change
Developers need working examples for finding PDF text and using the results to highlight, redact, or replace selected content. These samples show both direct processing and search-first workflows in each of the repository's six primary languages.
What changed
Adds 120 examples in C#, Java, JavaScript, PHP, Python, and cURL. Every scenario has both a multipart example and a JSON example that uploads the PDF first and passes its resource ID:
The examples use the existing language dependencies, payload directories, and configuration conventions. The .NET dispatcher exposes the new commands. A short guide links the examples and explains how the workflows fit together.
Behavior changes
These are opt-in samples only; API behavior and existing direct-redaction examples are unchanged. Search-first examples identify where a program can remove unwanted matches and reuse the same unchanged PDF for processing. Replacement comments explain that each retained match can have its own replacement text and layout mode.
AI Search is identified as Cloud-only. Its workflows use a custom description or AI category rather than known literal strings or regex patterns. Name replacement explicitly uses
shrink_to_fitto preserve surrounding text positions when several names share a paragraph. More advanced combinations are outside this sample set.Validation
All 120 examples ran successfully against a Cloud test deployment, covering both payload styles in all six languages. Another 30 no-match workflow checks passed. Output checks confirmed expected matches and AI confidence fields, replacement text, permanently removed redacted text, and unchanged text in highlighted PDFs.
All 120 generated PDF outputs, including redaction previews, passed qpdf checks and reopened with PDFL. Representative input/output pages were rendered and visually inspected. Shell syntax, JavaScript syntax, PHP lint, Python execution, all three Java Maven verification builds, and the .NET 8 build passed. The .NET project retains existing warnings outside these samples.
Risks and follow-ups
Samples use placeholder keys and input paths that developers replace before running. Redaction workflows demonstrate immediate preview-to-apply processing and explicitly recommend inspecting previews before applying redactions in a review workflow. The guide notes that masked Starter search text cannot validate for replacement.
No packages, API contracts, or existing samples are changed.