|
8 | 8 | static void PrintUsage() |
9 | 9 | { |
10 | 10 | Console.Error.WriteLine("Usage: dotnet run -- <command> [args]\n"); |
11 | | - Console.Error.WriteLine("Commands:"); |
12 | | - Console.Error.WriteLine(" markdown-json <inputFile> Upload then convert to Markdown (JSON two-step)"); |
13 | | - Console.Error.WriteLine(" rasterized-pdf <inputFile> Upload then rasterize PDF (JSON two-step)"); |
14 | | - Console.Error.WriteLine(" pdf-multipart <inputFile> Convert to PDF via multipart"); |
15 | | - Console.Error.WriteLine(" png-multipart <file> Convert to PNG via multipart"); |
16 | | - Console.Error.WriteLine(" jpg-multipart <file> Convert to JPG via multipart"); |
17 | | - Console.Error.WriteLine(" gif-multipart <file> Convert to GIF via multipart"); |
18 | | - Console.Error.WriteLine(" bmp-multipart <file> Convert to BMP via multipart"); |
19 | | - Console.Error.WriteLine(" tif-multipart <file> Convert to TIFF via multipart"); |
20 | | - Console.Error.WriteLine(" merge-different-file-types <imageFile> <pptFile> Convert then merge (complex flow)"); |
21 | | - Console.Error.WriteLine(" decrypt-add-reencrypt <pdf> <image> [pass] Decrypt, add image, re-encrypt"); |
22 | | - Console.Error.WriteLine(" ocr-with-extract-text <pdf> OCR then extract text (complex flow)"); |
23 | | - Console.Error.WriteLine(" pdfa-3b-with-attachment <pdf> <xml> Attach XML then PDF/A-3b"); |
24 | | - Console.Error.WriteLine(" preserve-word-document <file> Office -> PDF -> PDF/A-3b"); |
25 | | - Console.Error.WriteLine(" protected-watermark <pdf> Watermark then restrict permissions"); |
26 | | - Console.Error.WriteLine(" redact-preview-and-finalize <pdf> Preview then apply redactions"); |
27 | | - Console.Error.WriteLine(" extracted-text <inputFile> Upload then extract text (JSON two-step)"); |
28 | | - Console.Error.WriteLine(" extracted-images <inputFile> Upload then extract images (JSON two-step)"); |
29 | | - Console.Error.WriteLine(" exported-form-data <inputFile> Upload then export form data (JSON two-step)"); |
30 | | - Console.Error.WriteLine(" pdf-info <inputFile> Upload then query document info (JSON two-step)"); |
31 | | - Console.Error.WriteLine(" merged-pdf <file1> <file2> Upload two files then merge by id"); |
32 | | - Console.Error.WriteLine(" split-pdf <inputFile> Upload then split into ranges"); |
33 | | - Console.Error.WriteLine(" upload <inputFile> Upload a file (resource id)"); |
34 | | - Console.Error.WriteLine(" upload-multipart <inputFile> Upload via multipart (resource id)"); |
35 | | - Console.Error.WriteLine(" get-resource <id> [out] Download resource file by id"); |
36 | | - Console.Error.WriteLine(" get-resource-multipart <id> [out] Download via multipart route"); |
37 | | - Console.Error.WriteLine(" delete-resource <id> Delete a resource by id"); |
38 | | - Console.Error.WriteLine(" delete-resource-multipart <id> Delete via multipart route"); |
39 | | - Console.Error.WriteLine(" batch-delete <id1> [id2] [...] Delete multiple resources by ids"); |
40 | | - Console.Error.WriteLine(" batch-delete-multipart <id1> [id2] [...] Delete multiple via multipart route"); |
41 | | - Console.Error.WriteLine(" png|jpg|gif|bmp <inputFile> Upload then convert to image format (JSON two-step)"); |
42 | | - Console.Error.WriteLine(" pdf|pdfa|pdfx <inputFile> Upload then process to target PDF standard"); |
43 | | - Console.Error.WriteLine(" word|excel|powerpoint|tif <file> Upload then convert to Office/TIFF"); |
44 | | - Console.Error.WriteLine(" excel-multipart <file> Convert to Excel via multipart"); |
45 | | - Console.Error.WriteLine(" powerpoint-multipart <file> Convert to PowerPoint via multipart"); |
46 | | - Console.Error.WriteLine(" word-multipart <file> Convert to Word via multipart"); |
47 | | - Console.Error.WriteLine(" compressed-pdf <inputFile> Upload then compress PDF"); |
48 | | - Console.Error.WriteLine(" compressed-pdf-multipart <file> Compress PDF via multipart"); |
49 | | - Console.Error.WriteLine(" linearized-pdf <inputFile> Upload then linearize PDF"); |
50 | | - Console.Error.WriteLine(" linearized-pdf-multipart <file> Linearize PDF via multipart"); |
51 | | - Console.Error.WriteLine(" encrypted-pdf <inputFile> Upload then set open password"); |
52 | | - Console.Error.WriteLine(" encrypted-pdf-multipart <pdf> <password> Encrypt via multipart"); |
53 | | - Console.Error.WriteLine(" decrypted-pdf <inputFile> Upload then remove open password"); |
54 | | - Console.Error.WriteLine(" decrypted-pdf-multipart <pdf> <password> Decrypt via multipart"); |
55 | | - Console.Error.WriteLine(" restricted-pdf <inputFile> Upload then set permissions restrictions"); |
56 | | - Console.Error.WriteLine(" restricted-pdf-multipart <pdf> <permPass> Set restrictions via multipart"); |
57 | | - Console.Error.WriteLine(" unrestricted-pdf <inputFile> Upload then remove permissions restrictions"); |
58 | | - Console.Error.WriteLine(" unrestricted-pdf-multipart <pdf> <permPass> Remove restrictions via multipart"); |
59 | | - Console.Error.WriteLine(" flattened-forms-pdf <inputFile> Upload then flatten forms"); |
60 | | - Console.Error.WriteLine(" flattened-forms-pdf-multipart <file> Flatten forms via multipart"); |
61 | | - Console.Error.WriteLine(" flattened-annotations-pdf <file> Upload then flatten annotations"); |
62 | | - Console.Error.WriteLine(" flattened-annotations-pdf-multipart <file> Flatten annotations via multipart"); |
63 | | - Console.Error.WriteLine(" flattened-layers-pdf <file> Upload then flatten layers"); |
64 | | - Console.Error.WriteLine(" flattened-layers-pdf-multipart <file> Flatten layers via multipart"); |
65 | | - Console.Error.WriteLine(" flattened-transparencies-pdf <file> Upload then flatten transparencies"); |
66 | | - Console.Error.WriteLine(" flattened-transparencies-pdf-multipart <file> Flatten transparencies via multipart"); |
67 | | - Console.Error.WriteLine(" pdf-with-ocr-text <file> Upload then add OCR text layer"); |
68 | | - Console.Error.WriteLine(" pdf-with-ocr-text-multipart <file> Add OCR text via multipart"); |
69 | | - Console.Error.WriteLine(" pdf-with-imported-form-data <pdf> <xml/fdf> Import form data"); |
70 | | - Console.Error.WriteLine(" pdf-with-imported-form-data-multipart <pdf> <data> Import form data via multipart"); |
71 | | - Console.Error.WriteLine(" pdf-with-added-image <pdf> <image> Add image to PDF"); |
72 | | - Console.Error.WriteLine(" pdf-with-added-image-multipart <pdf> <image> Add image via multipart"); |
73 | | - Console.Error.WriteLine(" pdf-with-added-attachment <pdf> <file> Attach file to PDF"); |
74 | | - Console.Error.WriteLine(" pdf-with-added-attachment-multipart <pdf> <file> Attach via multipart"); |
75 | | - Console.Error.WriteLine(" pdf-with-converted-colors <file> Convert colors to a profile"); |
76 | | - Console.Error.WriteLine(" pdf-with-converted-colors-multipart <file> Convert colors via multipart"); |
77 | | - Console.Error.WriteLine(" pdf-with-added-text <file> Add text to PDF"); |
78 | | - Console.Error.WriteLine(" pdf-with-added-text-multipart <file> Add text via multipart"); |
79 | | - Console.Error.WriteLine(" pdf-with-acroforms <file> Add acroforms to PDF"); |
80 | | - Console.Error.WriteLine(" pdf-with-acroforms-multipart <file> Add acroforms via multipart"); |
81 | | - Console.Error.WriteLine(" pdf-with-page-boxes-set <file> Set page boxes"); |
82 | | - Console.Error.WriteLine(" pdf-with-page-boxes-set-multipart <file> Set page boxes via multipart"); |
83 | | - Console.Error.WriteLine(" pdf-with-redacted-text-preview <file> Preview redactions"); |
84 | | - Console.Error.WriteLine(" pdf-with-redacted-text-preview-multipart <file> Preview redactions via multipart"); |
85 | | - Console.Error.WriteLine(" pdf-with-redacted-text-applied <file> Apply redactions"); |
86 | | - Console.Error.WriteLine(" pdf-with-redacted-text-applied-multipart <file> Apply redactions via multipart"); |
87 | | - Console.Error.WriteLine(" watermarked-pdf <file> Add text watermark"); |
88 | | - Console.Error.WriteLine(" watermarked-pdf-multipart <file> Add text watermark via multipart"); |
89 | | - Console.Error.WriteLine(" pdf-info-multipart <file> Query PDF info via multipart"); |
90 | | - Console.Error.WriteLine(" extracted-text-multipart <file> Extract text via multipart"); |
91 | | - Console.Error.WriteLine(" extracted-images-multipart <file> Extract images via multipart"); |
92 | | - Console.Error.WriteLine(" markdown-multipart <file> Convert to Markdown via multipart"); |
93 | | - Console.Error.WriteLine(" pdfa-multipart <file> Convert to PDF/A via multipart"); |
94 | | - Console.Error.WriteLine(" pdfx-multipart <file> Convert to PDF/X via multipart"); |
95 | | - Console.Error.WriteLine(" rasterized-pdf-multipart <file> Rasterize via multipart"); |
96 | | - Console.Error.WriteLine(" split-pdf-multipart <file> Split via multipart"); |
97 | | - Console.Error.WriteLine(" exported-form-data-multipart <file> Export form data via multipart"); |
98 | | - Console.Error.WriteLine(" request-status-multipart <file> Poll request status via multipart"); |
99 | | - Console.Error.WriteLine(" up-toolkit-multipart Query toolkit status (multipart section)"); |
100 | | - Console.Error.WriteLine(" signed-pdf-multipart <pdf> <pfx> <pass> <logo> Sign via PFX (multipart)"); |
101 | | - Console.Error.WriteLine(" signed-pdf-non-pfx-multipart <pdf> <cert> <key> Sign via PEM (multipart)"); |
102 | | - Console.Error.WriteLine(" zip <file1> <file2> Zip two resources"); |
103 | | - Console.Error.WriteLine(" zip-multipart <f1> <f2> Zip two files via multipart"); |
104 | | - Console.Error.WriteLine(" unzip <zipFile> Unzip resource"); |
105 | | - Console.Error.WriteLine(" unzip-multipart <zipFile> Unzip via multipart"); |
106 | | - Console.Error.WriteLine(" up-toolkit Query toolkit status"); |
107 | | - Console.Error.WriteLine(" signed-pdf <pdf> <pfx> <pass> <logo> Sign PDF with PFX"); |
108 | | - Console.Error.WriteLine(" signed-pdf-non-pfx <pdf> <cert> <key> Sign PDF with cert/key"); |
109 | | - Console.Error.WriteLine(""); |
| 11 | + |
| 12 | + Console.Error.WriteLine("JSON Payload (upload + JSON):"); |
| 13 | + Console.Error.WriteLine(" Conversions:"); |
| 14 | + Console.Error.WriteLine(" markdown-json <pdf> Convert PDF to Markdown"); |
| 15 | + Console.Error.WriteLine(" rasterized-pdf <pdf> Rasterize PDF pages"); |
| 16 | + Console.Error.WriteLine(" pdf <file> Convert file to PDF"); |
| 17 | + Console.Error.WriteLine(" pdfa <file> Convert to PDF/A"); |
| 18 | + Console.Error.WriteLine(" pdfx <file> Convert to PDF/X"); |
| 19 | + Console.Error.WriteLine(" png|jpg|gif|bmp <file> Convert to image format"); |
| 20 | + Console.Error.WriteLine(" word|excel|powerpoint|tif <file> Convert to Office/TIFF"); |
| 21 | + Console.Error.WriteLine(" Info / Extract:"); |
| 22 | + Console.Error.WriteLine(" pdf-info <pdf> Document properties and stats"); |
| 23 | + Console.Error.WriteLine(" extracted-text <pdf> Extract text to JSON"); |
| 24 | + Console.Error.WriteLine(" extracted-images <pdf> Extract embedded images"); |
| 25 | + Console.Error.WriteLine(" exported-form-data <pdf> Export form data (XML)"); |
| 26 | + Console.Error.WriteLine(" PDF Transforms:"); |
| 27 | + Console.Error.WriteLine(" compressed-pdf <pdf> Compress PDF"); |
| 28 | + Console.Error.WriteLine(" linearized-pdf <pdf> Optimize for fast web view"); |
| 29 | + Console.Error.WriteLine(" Security:"); |
| 30 | + Console.Error.WriteLine(" encrypted-pdf <pdf> Set open password"); |
| 31 | + Console.Error.WriteLine(" decrypted-pdf <pdf> Remove open password"); |
| 32 | + Console.Error.WriteLine(" restricted-pdf <pdf> Apply permissions restrictions"); |
| 33 | + Console.Error.WriteLine(" unrestricted-pdf <pdf> Remove permissions restrictions"); |
| 34 | + Console.Error.WriteLine(" Edit / Add:"); |
| 35 | + Console.Error.WriteLine(" pdf-with-ocr-text <pdf> Add OCR text layer"); |
| 36 | + Console.Error.WriteLine(" pdf-with-imported-form-data <pdf> <xml/fdf> Import form data"); |
| 37 | + Console.Error.WriteLine(" pdf-with-added-image <pdf> <image> Add image"); |
| 38 | + Console.Error.WriteLine(" pdf-with-added-attachment <pdf> <file> Attach file"); |
| 39 | + Console.Error.WriteLine(" pdf-with-converted-colors <pdf> Convert colors to profile"); |
| 40 | + Console.Error.WriteLine(" pdf-with-added-text <pdf> Add text objects"); |
| 41 | + Console.Error.WriteLine(" pdf-with-acroforms <pdf> Add acroforms"); |
| 42 | + Console.Error.WriteLine(" pdf-with-page-boxes-set <pdf> Set page boxes"); |
| 43 | + Console.Error.WriteLine(" Redaction:"); |
| 44 | + Console.Error.WriteLine(" pdf-with-redacted-text-preview <pdf> Preview redactions"); |
| 45 | + Console.Error.WriteLine(" pdf-with-redacted-text-applied <pdf> Apply redactions"); |
| 46 | + Console.Error.WriteLine(" Page / Files:"); |
| 47 | + Console.Error.WriteLine(" split-pdf <pdf> Split by page ranges"); |
| 48 | + Console.Error.WriteLine(" merged-pdf <pdf1> <pdf2> Merge two PDFs by id"); |
| 49 | + Console.Error.WriteLine(" Resources / Packaging / Signing:"); |
| 50 | + Console.Error.WriteLine(" upload <file> Upload file (resource id)"); |
| 51 | + Console.Error.WriteLine(" get-resource <id> [out] Download resource"); |
| 52 | + Console.Error.WriteLine(" delete-resource <id> Delete resource"); |
| 53 | + Console.Error.WriteLine(" batch-delete <id1> [id2] [...] Delete multiple resources"); |
| 54 | + Console.Error.WriteLine(" zip <file1> <file2> Zip two resources"); |
| 55 | + Console.Error.WriteLine(" unzip <zipFile> Unzip resource"); |
| 56 | + Console.Error.WriteLine(" signed-pdf <pdf> <pfx> <pass> <logo> Sign PDF with PFX"); |
| 57 | + Console.Error.WriteLine(" signed-pdf-non-pfx <pdf> <cert> <key> Sign PDF with cert/key"); |
| 58 | + Console.Error.WriteLine(" up-toolkit Query toolkit status\n"); |
| 59 | + |
| 60 | + Console.Error.WriteLine("Multipart Payload (multipart/form-data):"); |
| 61 | + Console.Error.WriteLine(" Conversions:"); |
| 62 | + Console.Error.WriteLine(" pdf-multipart <file> Convert to PDF"); |
| 63 | + Console.Error.WriteLine(" markdown-multipart <file> Convert to Markdown"); |
| 64 | + Console.Error.WriteLine(" rasterized-pdf-multipart <pdf> Rasterize PDF"); |
| 65 | + Console.Error.WriteLine(" pdfa-multipart <file> Convert to PDF/A"); |
| 66 | + Console.Error.WriteLine(" pdfx-multipart <file> Convert to PDF/X"); |
| 67 | + Console.Error.WriteLine(" png-multipart|jpg-multipart|gif-multipart|bmp-multipart|tif-multipart <file> Convert to image"); |
| 68 | + Console.Error.WriteLine(" word-multipart|excel-multipart|powerpoint-multipart <file> Convert Office"); |
| 69 | + Console.Error.WriteLine(" Info / Extract:"); |
| 70 | + Console.Error.WriteLine(" pdf-info-multipart <pdf> Document properties and stats"); |
| 71 | + Console.Error.WriteLine(" extracted-text-multipart <pdf> Extract text to JSON"); |
| 72 | + Console.Error.WriteLine(" extracted-images-multipart <pdf> Extract images"); |
| 73 | + Console.Error.WriteLine(" PDF Transforms:"); |
| 74 | + Console.Error.WriteLine(" compressed-pdf-multipart <pdf> Compress PDF"); |
| 75 | + Console.Error.WriteLine(" linearized-pdf-multipart <pdf> Optimize for fast web view"); |
| 76 | + Console.Error.WriteLine(" Security:"); |
| 77 | + Console.Error.WriteLine(" encrypted-pdf-multipart <pdf> <pass> Set open password"); |
| 78 | + Console.Error.WriteLine(" decrypted-pdf-multipart <pdf> <pass> Remove open password"); |
| 79 | + Console.Error.WriteLine(" restricted-pdf-multipart <pdf> <permPass> Apply permissions restrictions"); |
| 80 | + Console.Error.WriteLine(" unrestricted-pdf-multipart <pdf> <permPass> Remove permissions restrictions"); |
| 81 | + Console.Error.WriteLine(" Edit / Add:"); |
| 82 | + Console.Error.WriteLine(" pdf-with-ocr-text-multipart <pdf> Add OCR text layer"); |
| 83 | + Console.Error.WriteLine(" pdf-with-imported-form-data-multipart <pdf> <data> Import form data"); |
| 84 | + Console.Error.WriteLine(" pdf-with-added-image-multipart <pdf> <image> Add image"); |
| 85 | + Console.Error.WriteLine(" pdf-with-added-attachment-multipart <pdf> <file> Attach file"); |
| 86 | + Console.Error.WriteLine(" pdf-with-converted-colors-multipart <pdf> Convert colors to profile"); |
| 87 | + Console.Error.WriteLine(" pdf-with-added-text-multipart <pdf> Add text objects"); |
| 88 | + Console.Error.WriteLine(" pdf-with-acroforms-multipart <pdf> Add acroforms"); |
| 89 | + Console.Error.WriteLine(" pdf-with-page-boxes-set-multipart <pdf> Set page boxes"); |
| 90 | + Console.Error.WriteLine(" Redaction:"); |
| 91 | + Console.Error.WriteLine(" pdf-with-redacted-text-preview-multipart <pdf> Preview redactions"); |
| 92 | + Console.Error.WriteLine(" pdf-with-redacted-text-applied-multipart <pdf> Apply redactions"); |
| 93 | + Console.Error.WriteLine(" Page / Files:"); |
| 94 | + Console.Error.WriteLine(" split-pdf-multipart <pdf> Split by page ranges"); |
| 95 | + Console.Error.WriteLine(" merged-pdf-multipart <f1> <f2> Merge two files"); |
| 96 | + Console.Error.WriteLine(" Resources / Packaging / Signing:"); |
| 97 | + Console.Error.WriteLine(" upload-multipart <file> Upload file (resource id)"); |
| 98 | + Console.Error.WriteLine(" get-resource-multipart <id> [out] Download resource"); |
| 99 | + Console.Error.WriteLine(" delete-resource-multipart <id> Delete resource"); |
| 100 | + Console.Error.WriteLine(" batch-delete-multipart <id1> [id2] [...] Delete multiple resources"); |
| 101 | + Console.Error.WriteLine(" zip-multipart <f1> <f2> Zip two files"); |
| 102 | + Console.Error.WriteLine(" unzip-multipart <zipFile> Unzip resource"); |
| 103 | + Console.Error.WriteLine(" signed-pdf-multipart <pdf> <pfx> <pass> <logo> Sign PDF with PFX"); |
| 104 | + Console.Error.WriteLine(" signed-pdf-non-pfx-multipart <pdf> <cert> <key> Sign PDF with cert/key"); |
| 105 | + Console.Error.WriteLine(" request-status-multipart <pdf> Poll processing status"); |
| 106 | + Console.Error.WriteLine(" up-toolkit-multipart Query toolkit status\n"); |
| 107 | + |
| 108 | + Console.Error.WriteLine("Complex Flows:"); |
| 109 | + Console.Error.WriteLine(" merge-different-file-types <image> <ppt> Convert then merge"); |
| 110 | + Console.Error.WriteLine(" decrypt-add-reencrypt <pdf> <image> [pass] Decrypt, add image, re-encrypt"); |
| 111 | + Console.Error.WriteLine(" ocr-with-extract-text <pdf> OCR then extract text"); |
| 112 | + Console.Error.WriteLine(" pdfa-3b-with-attachment <pdf> <xml> Attach XML then PDF/A-3b"); |
| 113 | + Console.Error.WriteLine(" preserve-word-document <office> Office → PDF → PDF/A-3b"); |
| 114 | + Console.Error.WriteLine(" protected-watermark <pdf> Watermark then restrict"); |
| 115 | + Console.Error.WriteLine(" redact-preview-and-finalize <pdf> Preview then apply redactions\n"); |
| 116 | + |
110 | 117 | Console.Error.WriteLine("Environment (.env supported):"); |
111 | | - Console.Error.WriteLine(" PDFREST_API_KEY=... Required API key"); |
112 | | - Console.Error.WriteLine(" PDFREST_URL=... Optional base URL (e.g., https://eu-api.pdfrest.com for EU/GDPR)"); |
| 118 | + Console.Error.WriteLine(" PDFREST_API_KEY=... Required API key"); |
| 119 | + Console.Error.WriteLine(" PDFREST_URL=... Optional base URL (e.g., https://eu-api.pdfrest.com for EU/GDPR)"); |
113 | 120 | } |
114 | 121 |
|
115 | 122 | // Entry point |
|
0 commit comments