PDFCLOUD-5217 Make the C# examples runnable (part 2, with sensitive file deletion merged in)#110
Closed
datalogics-kam wants to merge 33 commits into
Closed
Conversation
* Complex flow examples: redact-preview-and-finalize * /pdf-with-redacted-text-preview * /pdf-with-redacted-text-applied
* Complex flow examples: protected-watermark * /watermarked-pdf-image * /watermarked-pdf
* Complex flow examples: decrypt-add-reencrypt * /encrypted-pdf * /encrypted-pdf-new-password * /encrypted-pdf-change-password * /decrypted-pdf - deletes the decrypted outputs * /decrypted-pdf-with-permissions-password - deletes the decrypted outputs
* /restricted-pdf * /restricted-pdf-change-password * /restricted-pdf-add-password-with-open-password * /restricted-pdf-add-password-and-restrictions * /unrestricted-pdf * /unrestricted-pdf-with-open-password
* pdf-with-redacted-text-preview * pdf-with-redacted-text-applied * watermarked-pdf * encrypted-pdf * decrypted-pdf * restricted-pdf * unrestricted-pdf * Work done by Codex * Adds optional delete step to the above samples in all languages (besides cURL) with relevant comment. * For unrestricted or decrypted-pdf, delete the outputId. Otherwise, delete the inputId. * For pdf-with-redacted-text-preview samples, delete both the inputId and outputId as they are both unredacted, but add a warning comment.
* Fixes PDFWithRedactedTextPreview.java with missing bracket * Fixes remaining java samples with `mvn spotless:apply`
* Wrap whole delete block in parent if so that all variables are in scope
* Watermarking with text returns an inputId that is an array of 1 string id.
ff90d69 to
17cb74f
Compare
- Refined instructions for setting up and running samples with a .NET 8 dispatcher. - Added `.env.example` usage and environment configuration tips for API keys and GDPR compliance. - Updated coding conventions, testing guidelines, and sample adaptation steps. - Enhanced headers to standardize example descriptions and setup details.
- Added `DotNetSamples.csproj` with a minimal dispatcher (`Program.cs`) for routing commands. - Implemented `markdown-json` example: two-step upload and JSON-based Markdown conversion. - Introduced `.env.example` for API key configuration and optional EU/GDPR endpoint setup. - Updated `AGENTS.md` with setup, usage instructions, rationale for project structure, and coding conventions.
- Organized examples into `namespace Samples.EndpointExamples.JsonPayload` for logical grouping. - Replaced hardcoded API keys and URLs with environment variables for enhanced security and configurability. - Introduced input validation and error handling for required parameters and files. - Standardized execution methods in all examples, aligning with updated coding conventions.
- Documented purpose, setup, usage, and output for each sample. - Aligned all examples with established header format for consistency. - Included GDPR compliance API call details and environment variable instructions.
… handling - Added headers to new examples, documenting purpose, setup, usage, and output. - Replaced hardcoded file paths, API keys, and URLs with environment variables. - Enhanced input validation, error handling, and exception messages across samples. - Updated `merge-different-file-types` and `pdf-multipart` examples for clarity and alignment with guidelines.
…proved error handling - Introduced multipart handling for multiple formats: PNG, JPG, GIF, BMP, TIF, and Office files. - Enhanced headers to include purpose, setup, usage, and GDPR API details. - Standardized input validation, environment variable usage, and API key handling. - Updated `Program.cs` to route new multipart commands.
- Expanded `Program.cs` to route new multipart payload commands. - Implemented examples for multipart operations: encryption, decryption, text addition, image embedding, and more. - Enhanced error handling, input validation, and logging for multipart samples. - Updated `DotNetSamples.csproj` to include newly added multipart-specific implementations.
- Added detailed usage instructions, setup steps, and expected output headers to all multipart payload examples. - Enhanced consistency by aligning with standardized header format. - Included additional environment variable handling and GDPR API call details.
- Added detailed headers documenting the purpose, setup, usage, and output for complex flow examples. - Refactored to use environment variables for API keys, URLs, and input paths. - Enhanced input validation, error handling, and logging across all examples. - Simplified repetitive code by introducing clearer patterns for request creation and execution.
- Implemented `exported-form-data.cs` under JSON payload examples for two-step upload and form data export. - Enhanced headers with purpose, setup, usage, and output details for consistency. - Added routing to `Program.cs` and updated dispatcher for new command. - Enabled compilation in `DotNetSamples.csproj` by including new example. - Improved input validation, error handling, and environment variable usage for secure API integration.
- Added multiple new command usage examples to AGENTS.md for improved clarity and reference. - Refined explanations for sample adaptation steps, emphasizing header placement and formatting. - Enhanced consistency and alignment with established documentation standards.
…, and examples - Introduced a detailed README for .NET 8 C# pdfRest API samples covering setup, build, and usage instructions. - Documented various sample categories: JSON payload, multipart payload, and complex workflows. - Included regional API setup, environment variable usage, and handy runner scripts for enhanced usability. - Provided example commands, output descriptions, and verification steps for end-users. - Ensured alignment with standardized documentation practices for clarity and consistency.
… improved clarity and readability.
17cb74f to
e09c739
Compare
* Add a toggle to turn the deletion step on or off with the PDFREST_DELETE_SENSITIVE_FILES variable. * Use PDFREST_DELETE_SENSITIVE_FILES=true to turn on the deletion step. * Update global README.md and cURL README.md to explain this logic
* Make the delete step optional by adding a local variable which the user can toggle on/off to do the delete step. * The delete step is off by default.
* Match the rest of the samples and use DELETE_SENSITIVE_FILES.
…sharp-samples * security-optional-delete: Format Java samples Standardize variable naming in cURL Make delete step optional with local toggle cURL: Make deletion step toggleable Fix watermark samples for other languages Correct basic watermark sample Correct complex watermark example Correct typos and make headers consistent Fix jq syntax errors in cURL PDFWithRedactedTextPreview.java: fix formatting Update PDFWithRedactedTextPreview.java Run `mvn spotless:apply` to Java JSON samples Add optional delete step to base security samples cURL: Add delete step to restrict endpoints cURL: Add delete step to encrypt endpoints cURL: Add delete step to watermark endpoints cURL: Add delete step to redact endpoints
…ETE_SENSITIVE_FILES` environment variable - Updated `.env.example` with the new optional toggle. - Revised README to document the feature and its usage. - Refactored all C# JSON and multipart payload examples to use the environment variable for toggleable deletion. - Simplified deletion logic with default behavior and enhanced clarity. - Enhanced application usage documentation in `Program.cs` to include the new environment variable details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please review/merge #104 first
If the C# changes without the sensitive file delete are desired, merge #113