Compress a PDF
Upload a PDF and download a rewritten PDF of the same pages.
Compress PDF
API संदर्भ
REST से सबमिट करें
अपने टूल से इस वर्कलोड के लिए जॉब बनाने हेतु अपनी व्यक्तिगत API कुंजी (msk_…) का उपयोग करें। इस तरह शुरू किए गए जॉब उन्हीं डिवाइस पर चलते हैं जिन्हें आपने आपके डिवाइस पर कनेक्ट किया है — कम से कम एक का ऑनलाइन होना ज़रूरी है।
https://cp.meshlabs.cloud/v1/organizations/jobsX-Organization-Api-Key: msk_your_personal_api_key से प्रमाणित करें। हेडर का नाम ऑर्ग कुंजियों जैसा ही है; व्यक्तिगत कुंजियाँ उसी एंडपॉइंट का उपयोग करती हैं।
POST https://cp.meshlabs.cloud/v1/organizations/job-inputs/presign को कॉल करें, लौटाए गए upload_url पर अपनी फ़ाइल अपलोड करें, फिर download_url को job_spec में पास करें (उदाहरण के लिए input_image_url के रूप में)।अनुरोध बॉडी
{
"workload_type": "compress-pdf",
"job_spec": {
"input_pdf_url": "https://…/your-input.png"
}
}job_spec फ़ील्ड
| फ़ील्ड | आवश्यक | डिफ़ॉल्ट | विवरण |
|---|---|---|---|
input_pdf_url | हाँ | — | One PDF, up to 20 MB and 30 pages. Encrypted files are refused. |
cURL
curl -X POST https://cp.meshlabs.cloud/v1/organizations/jobs \
-H "X-Organization-Api-Key: msk_your_personal_api_key" \
-H "Content-Type: application/json" \
-d '{
"workload_type": "compress-pdf",
"job_spec": {
"input_pdf_url": "https://…/your-input.png"
}
}'https://cp.meshlabs.cloud/v1/organizations/jobs/{job_id}उसी API कुंजी से तब तक पोल करें जब तक status अंतिम स्थिति (COMPLETED, FAILED, CANCELED या MODERATION_BLOCKED) में न पहुँच जाए। जब सामग्री मॉडरेशन सक्षम होता है, तो कंप्यूट कतार में जाने से पहले जॉब MODERATION_PENDING में शुरू हो सकते हैं। पूरे हुए जॉब में हर आउटपुट पर presigned download_url मान होते हैं।
Create प्रतिक्रिया
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workload_type": "compress-pdf",
"status": "PENDING",
"job_spec_json": {
"input_pdf_url": "https://…/your-input.png"
},
"work_units": [],
"outputs": [],
"created_at": "2026-06-08T12:00:00Z",
"updated_at": "2026-06-08T12:00:00Z"
}Completed प्रतिक्रिया
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workload_type": "compress-pdf",
"status": "COMPLETED",
"job_spec_json": {
"input_pdf_url": "https://…/your-input.png"
},
"work_units": [
{
"id": "…",
"index": 0,
"status": "COMPLETED"
}
],
"outputs": [
{
"id": "…",
"output_type": "<output type>",
"filename": "<output filename>",
"size_bytes": 524288,
"download_url": "<presigned output download URL>"
}
],
"created_at": "2026-06-08T12:00:00Z",
"updated_at": "<completion timestamp>"
}Upload a PDF and download a rewritten PDF. Compress PDF packs the file's objects into compressed streams and leaves the pages as they are, on a device you connect. It does not recompress the pictures inside the file, so a PDF that is already packed may come back about the same size. One PDF per job, up to 20 MB and 30 pages.