Skip to content
Docs menu

Convert to PDF

Portable Document Format. The API converts 112 formats to PDF. 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":"pdf","options":{"quality":80}}'

From 29 formats

3fr, arw, cr2, cr3, crw, dcr, dng, erf, iiq, j2k, jfif, jp2, jpeg, jpg, jxl, kdc, mef, mos, mrw, nef, nrw, orf, pef, raf, rw2, rwl, sr2, srf, srw

  • qualityintegerdefault: 90

    Compression quality from 1 (smallest file) to 100 (best quality).

    1 to 100

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

From 16 formats

dif, dxf, emf, fodg, fods, odg, ods, otg, ots, wmf, xls, xlsm, xlsx, xlt, xltm, xltx

  • pagesstringdefault: not set

    Page range, for example 1-3 or 1,3,5.

  • pdf_abooleandefault: false

    Create PDF/A-1b for long-term archiving.

  • optimize_printbooleandefault: true

    Keep images at full resolution for printing. Set to false for smaller files for the screen (images at 150 dpi).

  • bookmarksbooleandefault: not set

    Add bookmarks for headings. Without a value bookmarks are added.

  • passwordstringdefault: not set

    Password to open the file.

From 14 formats

bmp, dds, exr, hdr, icns, pam, pbm, pcx, pgm, png, pnm, ppm, qoi, tga

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

From 11 formats

azw, azw3, chm, epub, fb2, lrf, mobi, pdb, prc, rb, tcr

  • page_formatenumdefault: a4

    Paper size of the PDF.

    one of a4, letter, a5, a3, legal

From 11 formats

fodp, odp, otp, pot, potm, potx, pps, ppsx, ppt, pptm, pptx

  • pagesstringdefault: not set

    Page range, for example 1-3 or 1,3,5.

  • pdf_abooleandefault: false

    Create PDF/A-1b for long-term archiving.

  • optimize_printbooleandefault: true

    Keep images at full resolution for printing. Set to false for smaller files for the screen (images at 150 dpi).

  • bookmarksbooleandefault: not set

    Add bookmarks for headings. Without a value bookmarks are added.

  • hidden_slidesbooleandefault: false

    Include hidden slides.

  • passwordstringdefault: not set

    Password to open the file.

From 10 formats

doc, docm, docx, dot, dotm, dotx, fodt, odt, ott, rtf

  • pagesstringdefault: not set

    Page range, for example 1-3 or 1,3,5.

  • pdf_abooleandefault: false

    Create PDF/A-1b for long-term archiving.

  • optimize_printbooleandefault: true

    Keep images at full resolution for printing. Set to false for smaller files for the screen (images at 150 dpi).

  • bookmarksbooleandefault: not set

    Add bookmarks for headings. Without a value bookmarks are added.

  • include_markupbooleandefault: false

    Include comments in the page margin.

  • passwordstringdefault: not set

    Password to open the file.

From 4 formats

gif, psb, psd, webp

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pagesstringdefault: not set

    Pages, frames or layers to convert, for example 1-3,5 or all. Without it, only the first page, frame or layer is converted.

From 3 formats

avif, heic, heif

  • qualityintegerdefault: 90

    Compression quality from 1 (smallest file) to 100 (best quality).

    1 to 100

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pagesstringdefault: not set

    Pages, frames or layers to convert, for example 1-3,5 or all. Without it, only the first page, frame or layer is converted.

From 2 formats

cur, ico

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pagesstringdefault: not set

    Pages, 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

html, md

  • page_formatenumdefault: not set

    Paper size. Without a value A4 is used unless the page sets its own size.

    one of a4, letter, a3, a5, legal, tabloid

  • landscapebooleandefault: false

    Landscape orientation.

  • marginstringdefault: not set

    Page margin, for example 15mm, 1in or 20px.

  • print_backgroundbooleandefault: true

    Print background colors and images.

From 2 formats

tif, tiff

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pagesstringdefault: not set

    Pages, 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-8

    Text encoding of the input file, for example utf-8, windows-1252, iso-8859-1 or utf-16.

  • pagesstringdefault: not set

    Page range, for example 1-3 or 1,3,5.

  • pdf_abooleandefault: false

    Create PDF/A-1b for long-term archiving.

  • optimize_printbooleandefault: true

    Keep images at full resolution for printing. Set to false for smaller files for the screen (images at 150 dpi).

  • bookmarksbooleandefault: not set

    Add bookmarks for headings. Without a value bookmarks are added.

  • passwordstringdefault: not set

    Password to open the file.

From SVG

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pixel_densityintegerdefault: 72

    Resolution in pixels per inch the drawing is rendered at.

From TSV

  • delimiterstringdefault: tab

    Field separator of the input file: one character or comma, semicolon, tab, pipe, space.

  • encodingstringdefault: utf-8

    Text encoding of the input file, for example utf-8, windows-1252, iso-8859-1 or utf-16.

  • pagesstringdefault: not set

    Page range, for example 1-3 or 1,3,5.

  • pdf_abooleandefault: false

    Create PDF/A-1b for long-term archiving.

  • optimize_printbooleandefault: true

    Keep images at full resolution for printing. Set to false for smaller files for the screen (images at 150 dpi).

  • bookmarksbooleandefault: not set

    Add bookmarks for headings. Without a value bookmarks are added.

  • passwordstringdefault: not set

    Password to open the file.

From TXT

  • encodingstringdefault: utf-8

    Text encoding of the input file, for example utf-8, windows-1252, iso-8859-1 or utf-16.

  • pagesstringdefault: not set

    Page range, for example 1-3 or 1,3,5.

  • pdf_abooleandefault: false

    Create PDF/A-1b for long-term archiving.

  • optimize_printbooleandefault: true

    Keep images at full resolution for printing. Set to false for smaller files for the screen (images at 150 dpi).

  • bookmarksbooleandefault: not set

    Add bookmarks for headings. Without a value bookmarks are added.

  • include_markupbooleandefault: false

    Include comments in the page margin.

  • passwordstringdefault: not set

    Password to open the file.

From 4 formats

cb7, cbr, cbt, cbz

No options. The file is converted with the usual settings for PDF.