|
16 | 16 |
|
17 | 17 | public class DecryptAddReencrypt { |
18 | 18 |
|
| 19 | + // By default, we use the US-based API service. This is the primary endpoint for global use. |
| 20 | + private static final String API_URL = "https://api.pdfrest.com"; |
| 21 | + |
| 22 | + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based |
| 23 | + // service by commenting out the URL above and uncommenting the URL below. |
| 24 | + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work |
| 25 | + // private static final String API_URL = "https://eu-api.pdfrest.com"; |
| 26 | + |
19 | 27 | // Specify the path to your PDF file here, or as the first argument when running the program. |
20 | 28 | private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; |
21 | 29 |
|
@@ -51,7 +59,7 @@ public static void main(String[] args) { |
51 | 59 | Request decryptRequest = |
52 | 60 | new Request.Builder() |
53 | 61 | .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) |
54 | | - .url("https://api.pdfrest.com/decrypted-pdf") |
| 62 | + .url(API_URL + "/decrypted-pdf") |
55 | 63 | .post(decryptRequestBody) |
56 | 64 | .build(); |
57 | 65 | try { |
@@ -87,7 +95,7 @@ public static void main(String[] args) { |
87 | 95 | Request addImageRequest = |
88 | 96 | new Request.Builder() |
89 | 97 | .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) |
90 | | - .url("https://api.pdfrest.com/pdf-with-added-image") |
| 98 | + .url(API_URL + "/pdf-with-added-image") |
91 | 99 | .post(addImageRequestBody) |
92 | 100 | .build(); |
93 | 101 | try { |
@@ -119,7 +127,7 @@ public static void main(String[] args) { |
119 | 127 | Request encryptRequest = |
120 | 128 | new Request.Builder() |
121 | 129 | .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) |
122 | | - .url("https://api.pdfrest.com/encrypted-pdf") |
| 130 | + .url(API_URL + "/encrypted-pdf") |
123 | 131 | .post(encryptRequestBody) |
124 | 132 | .build(); |
125 | 133 | try { |
|
0 commit comments