POST https://sync.api.cloudconvert.com/v2/jobs
{
"tasks": {
"import-file": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
"add-watermark": {
"operation": "watermark",
"input": [
"import-file"
],
"input_format": "pdf",
"layer": "above",
"text": "Top Secret",
"font_width_percent": 90,
"font_color": "#ff0400",
"font_name": "Helvetica Bold",
"position_vertical": "center",
"position_horizontal": "center",
"opacity": 50,
"rotation": -45
},
"export-watermarked-file": {
"operation": "export/url",
"input": [
"add-watermark"
]
}
},
"redirect": true
}
<?php
$job = (new Job())
->addTask(
(new Task('import/url', 'import-file'))
->set('url', 'https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf')
)
->addTask(
(new Task('watermark', 'add-watermark'))
->set('input', 'import-file')
->set('input_format', 'pdf')
->set('layer', 'above')
->set('text', 'Top Secret')
->set('font_width_percent', 90)
->set('font_color', '#ff0400')
->set('font_name', 'Helvetica Bold')
->set('position_vertical', 'center')
->set('position_horizontal', 'center')
->set('opacity', 50)
->set('rotation', -4)
)
->addTask(
(new Task('export/url', 'export-watermarked-file'))
->set('input', 'add-watermark')
);
$cloudconvert->jobs()->create($job);
let exampleJob = await cloudConvert.jobs.create({
"tasks": {
"import-file": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
"add-watermark": {
"operation": "watermark",
"input": [
"import-file"
],
"input_format": "pdf",
"layer": "above",
"text": "Top Secret",
"font_width_percent": 90,
"font_color": "#ff0400",
"font_name": "Helvetica Bold",
"position_vertical": "center",
"position_horizontal": "center",
"opacity": 50,
"rotation": -45
},
"export-watermarked-file": {
"operation": "export/url",
"input": [
"add-watermark"
]
}
}
});
job = await cloudConvert.jobs.wait(job.id);
job = cloudconvert.jobs.create({
tasks: [
{
name: "imprt-file",
operation: "import/url",
url: "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
{
name: "add-watermark",
operation: "watermark",
input: [
"import-file"
],
input_format: "pdf",
layer: "above",
text: "Top Secret",
font_width_percent: 90,
font_color: "#ff0400",
font_name: "Helvetica Bold",
position_vertical: "center",
position_horizontal: "center",
opacity: 50,
rotation: -45
},
{
name: "export-watermarked-file",
operation: "export/url",
input: [
"add-watermark"
]
}
]
})
job = cloudconvert.Job.create(payload={
"tasks": {
"import-file": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
"add-watermark": {
"operation": "watermark",
"input": [
"import-file"
],
"input_format": "pdf",
"layer": "above",
"text": "Top Secret",
"font_width_percent": 90,
"font_color": "#ff0400",
"font_name": "Helvetica Bold",
"position_vertical": "center",
"position_horizontal": "center",
"opacity": 50,
"rotation": -45
},
"export-watermarked-file": {
"operation": "export/url",
"input": [
"add-watermark"
]
}
}
})
final JobResponse createJobResponse = cloudConvertClient.jobs().create(
ImmutableMap.of(
"import-file",
new UrlImportRequest()
.setUrl("https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"),
"add-watermark",
new AddWatermarkTaskRequest()
.setInput("import-file")
.setInputFormat("pdf"),
.set("layer", "above"),
.set( "text", "Top Secret")
.set("font_width_percent", 90)
.set("font_color", "#ff0400")
.set("font_name", "Helvetica Bold")
.set("position_vertical", "center")
.set("position_horizontal", "center")
.set("opacity", 50)
.set("rotation", -45)
"export-watermarked-file",
new UrlExportRequest()
.setInput("add-watermark")
)
).getBody();
var job = await CloudConvert.CreateJobAsync(new JobCreateRequest
{
Tasks = new
{
import-file = new ImportUrlCreateRequest
{
Url = "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
add-watermark = new WatermarkCreateRequest
{
Input = "import-file",
Input_Format = "pdf",
Options = new Dictionary<string, object> {
{ "layer": "above" },
{ "text": "Top Secret" },
{ "font_width_percent": 90 },
{ "font_color": "#ff0400" },
{ "font_name": "Helvetica Bold" },
{ "position_vertical": "center" },
{ "position_horizontal": "center" },
{ "opacity": 50 },
{ "rotation": -45 }
}
},
export-watermarked-file = new ExportUrlCreateRequest
{
Input = "add-watermark"
}
}
});
POST https://api.cloudconvert.com/v2/jobs
{
"tasks": {
"import-file": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
"import-logo": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/logo.png"
},
"add-watermark": {
"operation": "watermark",
"input": [
"import-file"
],
"input_format": "pdf",
"layer": "above",
"image": [
"import-logo"
],
"image_width_percent": 10,
"position_vertical": "bottom",
"position_horizontal": "right",
"margin_vertical": 25,
"margin_horizontal": 25,
"opacity": 75
},
"export-watermarked-file": {
"operation": "export/url",
"input": [
"add-watermark"
]
}
},
"redirect": true
}
<?php
$job = (new Job())
->addTask(
(new Task('import/url', 'import-file'))
->set('url', 'https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf')
)
->addTask(
(new Task('import/url', 'import-logo'))
->set('url', 'https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/logo.png')
)
->addTask(
(new Task('watermark', 'add-watermark'))
->set('input', 'import-file')
->set('input_format', 'pdf')
->set('layer', 'above')
->set('image', 'import-logo')
->set('image_width_percent', 10)
->set('position_vertical', 'center')
->set('position_horizontal', 'center')
->set('margin_vertical', 25)
->set('margin_horizontal', 25)
->set('opacity', 75)
)
->addTask(
(new Task('export/url', 'export-watermarked-file'))
->set('input', 'add-watermark')
);
$cloudconvert->jobs()->create($job);
let exampleJob = await cloudConvert.jobs.create({
"tasks": {
"import-file": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
"import-logo": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/logo.png"
},
"add-watermark": {
"operation": "watermark",
"input": [
"import-file"
],
"input_format": "pdf",
"layer": "above",
"image": [
"import-logo"
],
"image_width_percent": 10,
"position_vertical": "bottom",
"position_horizontal": "right",
"margin_vertical": 25,
"margin_horizontal": 25,
"opacity": 75
},
"export-watermarked-file": {
"operation": "export/url",
"input": [
"add-watermark"
]
}
}
});
job = await cloudConvert.jobs.wait(job.id);
job = cloudconvert.jobs.create({
tasks: [
{
name: "imprt-file",
operation: "import/url",
url: "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
{
name: "imprt-logo",
operation: "import/url",
url: "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/logo.png"
},
{
name: "add-watermark",
operation: "watermark",
input: [
"import-file"
],
input_format: "pdf",
layer: "above",
image: [
"import-logo"
],
image_width_percent: 10,
position_vertical: "center",
position_horizontal: "center",
margin_vertical: 25,
margin_horizontal: 25,
opacity: 75,
},
{
name: "export-watermarked-file",
operation: "export/url",
input: [
"add-watermark"
]
}
]
})
job = cloudconvert.Job.create(payload={
"tasks": {
"import-file": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
"import-logo": {
"operation": "import/url",
"url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/logo.png"
},
"add-watermark": {
"operation": "watermark",
"input": [
"import-file"
],
"input_format": "pdf",
"layer": "above",
"image": [
"import-logo"
],
"image_width_percent": 10,
"position_vertical": "bottom",
"position_horizontal": "right",
"margin_vertical": 25,
"margin_horizontal": 25,
"opacity": 75
},
"export-watermarked-file": {
"operation": "export/url",
"input": [
"add-watermark"
]
}
}
})
final JobResponse createJobResponse = cloudConvertClient.jobs().create(
ImmutableMap.of(
"import-file",
new UrlImportRequest()
.setUrl("https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"),
"import-logo",
new UrlImportRequest()
.setUrl("https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/logo.png"),
"add-watermark",
new AddWatermarkTaskRequest()
.setInput("import-file")
.setInputFormat("pdf"),
.set("layer", "above"),
.set("image", "import-logo")
.set("image_width_percent", 10)
.set("position_vertical", "center")
.set("position_horizontal", "center")
.set("margin_vertical", 25)
.set("margin_horizontal", 25)
.set("opacity", 50)
"export-watermarked-file",
new UrlExportRequest()
.setInput("add-watermark")
)
).getBody();
var job = await CloudConvert.CreateJobAsync(new JobCreateRequest
{
Tasks = new
{
import-file = new ImportUrlCreateRequest
{
Url = "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
},
import-logo = new ImportUrlCreateRequest
{
Url = "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/logo.png"
},
add-watermark = new WatermarkCreateRequest
{
Input = "import-file",
Input_Format = "pdf",
Options = new Dictionary<string, object> {
{ "layer": "above" },
{ "image_width_percent": 10 },
{ "image": "import-logo" },
{ "position_vertical": "bottom" },
{ "position_horizontal": "right" },
{ "margin_vertical": 25 },
{ "margin_horizontal": 25 },
{ "opacity": 50 },
}
},
export-watermarked-file = new ExportUrlCreateRequest
{
Input = "add-watermark"
}
}
});
Use our Job Builder to generate ready-to-use requests and code snippet for the
CloudConvert API.
Job Builder
API Documentation