Skip to content

Commit 3f00fb3

Browse files
committed
docs: rewrite SKILL.md with direct URL construction and multi-language examples
1 parent df200e0 commit 3f00fb3

1 file changed

Lines changed: 55 additions & 6 deletions

File tree

agent-pdf/SKILL.md

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,69 @@ description: Edit and fill PDF documents. Use when the user wants to fill a PDF
1010

1111
Edit and fill PDF documents directly in the browser. Add text, signatures, checkboxes, images, and more.
1212

13+
## How it works
14+
15+
The SimplePDF editor opens any PDF via a URL in this format:
16+
17+
```
18+
https://<host>.simplepdf.com/editor?open=<url-encoded-pdf-url>
19+
```
20+
21+
Where `<host>` is either `embed` (default) or a company-specific portal identifier.
22+
23+
For PDFs already hosted at a URL, you can construct this link directly without any API call. The API at `agent.simplepdf.com` is a convenience layer that builds these links for you and handles file uploads for PDFs that are not hosted anywhere.
24+
1325
## From a URL
1426

15-
Pass the PDF URL as a query parameter:
27+
If the PDF is already accessible at a URL, you have two options:
28+
29+
### Option 1: Construct the editor URL directly (no API call needed)
30+
31+
URL-encode the PDF URL and append it to the editor base:
32+
33+
```
34+
https://embed.simplepdf.com/editor?open=https%3A%2F%2Fexample.com%2Fform.pdf
35+
```
36+
37+
### Option 2: Use the API
1638

1739
```
18-
GET https://agent.simplepdf.com?url=https://example.com/document.pdf
40+
GET https://agent.simplepdf.com?url=https://example.com/form.pdf
1941
```
2042

21-
Returns JSON with editor links. No POST needed.
43+
Returns JSON with the editor URL and embed snippets.
2244

2345
## From a file
2446

25-
Upload a PDF file as multipart:
47+
If the PDF is a local file (not hosted anywhere), upload it to the API. The file is stored temporarily (1 hour) to make it accessible to the browser-based editor.
48+
49+
### Shell
2650

2751
```bash
2852
curl -X POST https://agent.simplepdf.com -F file=@document.pdf
2953
```
3054

55+
### TypeScript
56+
57+
```typescript
58+
const form = new FormData();
59+
form.append("file", new Blob([pdfBytes], { type: "application/pdf" }), "document.pdf");
60+
61+
const response = await fetch("https://agent.simplepdf.com", { method: "POST", body: form });
62+
const { url } = await response.json();
63+
```
64+
65+
### Python
66+
67+
```python
68+
import requests
69+
70+
with open("document.pdf", "rb") as f:
71+
response = requests.post("https://agent.simplepdf.com", files={"file": f})
72+
73+
url = response.json()["url"]
74+
```
75+
3176
## Presenting the result to the user
3277

3378
Always present the `url` field as a clickable link. This is the primary way users will open the editor.
@@ -41,10 +86,14 @@ The `iframe` and `react` fields are for developers embedding the editor in a web
4186
Add `companyIdentifier` to route to a custom SimplePDF portal:
4287

4388
```
44-
GET https://agent.simplepdf.com?url=https://example.com/form.pdf&companyIdentifier=acme
89+
https://agent.simplepdf.com?url=https://example.com/form.pdf&companyIdentifier=acme
4590
```
4691

47-
This routes to `acme.simplepdf.com` instead of the default editor.
92+
Or construct it directly:
93+
94+
```
95+
https://acme.simplepdf.com/editor?open=https%3A%2F%2Fexample.com%2Fform.pdf
96+
```
4897

4998
### Portal features
5099

0 commit comments

Comments
 (0)