Convert to TIFF
Tagged Image File Format. The API converts 96 formats to TIFF. These are the options, by input format.
curl https://api.switchfile.io/v1/convert \
-H "Authorization: Bearer $SWITCHFILE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/input.3fr","to":"tiff","options":{"width":1280}}'const res = await fetch("https://api.switchfile.io/v1/convert", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SWITCHFILE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"url":"https://example.com/input.3fr","to":"tiff","options":{"width":1280}}),
});
console.log(await res.json());From 43 formats
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
From 31 formats
passwordstringdefault: not setPassword to open the file.
pagesstringdefault: not setPages to convert, for example 1-3,5 or all. Each page becomes its own image.
pixel_densityintegerdefault: 150Resolution in pixels per inch the pages are rendered at (36 to 600).
36 to 600 dpi · default in /v2: 300
widthintegerdefault: not setWidth of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
heightintegerdefault: not setHeight of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
From 7 formats
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
pagesstringdefault: not setPages, frames or layers to convert, for example 1-3,5 or all. Without it, only the first page, frame or layer is converted.
From 6 formats
passwordstringdefault: not setPassword to open the file.
pixel_densityintegerdefault: 150Resolution in pixels per inch the pages are rendered at (36 to 600).
36 to 600 dpi · default in /v2: 300
widthintegerdefault: not setWidth of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
heightintegerdefault: not setHeight of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
From 2 formats
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
pagesstringdefault: not setPages, frames or layers to convert, for example 1-3,5 or all. Without it, the largest icon in the file is converted.
From 2 formats
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
pagesstringdefault: not setPages, frames or layers to convert, for example 1-3,5 or all. Without it, all pages or frames are converted.
From CSV
delimiterstringdefault: ,Field separator of the input file: one character or comma, semicolon, tab, pipe, space.
encodingstringdefault: utf-8Text encoding of the input file, for example utf-8, windows-1252, iso-8859-1 or utf-16.
passwordstringdefault: not setPassword to open the file.
pagesstringdefault: not setPages to convert, for example 1-3,5 or all. Each page becomes its own image.
pixel_densityintegerdefault: 150Resolution in pixels per inch the pages are rendered at (36 to 600).
36 to 600 dpi · default in /v2: 300
widthintegerdefault: not setWidth of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
heightintegerdefault: not setHeight of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
From PDF
pagesstringdefault: not setPages to convert, for example 1-3,5 or all. Each page becomes its own image.
pixel_densityintegerdefault: 150Resolution in pixels per inch the pages are rendered at (36 to 600).
36 to 600 dpi · default in /v2: 300
widthintegerdefault: not setWidth of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
heightintegerdefault: not setHeight of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
passwordstringdefault: not setPassword to open the PDF.
From SVG
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
pixel_densityintegerdefault: 72Resolution in pixels per inch the drawing is rendered at.
From TSV
delimiterstringdefault: tabField separator of the input file: one character or comma, semicolon, tab, pipe, space.
encodingstringdefault: utf-8Text encoding of the input file, for example utf-8, windows-1252, iso-8859-1 or utf-16.
passwordstringdefault: not setPassword to open the file.
pagesstringdefault: not setPages to convert, for example 1-3,5 or all. Each page becomes its own image.
pixel_densityintegerdefault: 150Resolution in pixels per inch the pages are rendered at (36 to 600).
36 to 600 dpi · default in /v2: 300
widthintegerdefault: not setWidth of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
heightintegerdefault: not setHeight of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
From TXT
encodingstringdefault: utf-8Text encoding of the input file, for example utf-8, windows-1252, iso-8859-1 or utf-16.
passwordstringdefault: not setPassword to open the file.
pagesstringdefault: not setPages to convert, for example 1-3,5 or all. Each page becomes its own image.
pixel_densityintegerdefault: 150Resolution in pixels per inch the pages are rendered at (36 to 600).
36 to 600 dpi · default in /v2: 300
widthintegerdefault: not setWidth of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px
heightintegerdefault: not setHeight of each page in pixels; the page keeps its shape. Overrides pixel_density.
1 to 20000 px