ConvertTransform
public class ConvertTransform : Transform
Converts the image to a different format.
Matrix of supported conversions can be found here: https://cdn.filestackcontent.com/UPqbkTIETnGaQJa1nqnG?dl=true
-
Initializes a
ConvertTransform
object.Declaration
Swift
public init()
-
Adds the
format
option.Declaration
Swift
@discardableResult func format(_ value: TransformFiletype) -> Self
Parameters
value
The format to which you would like to convert the file.
-
Adds the
background
option.Declaration
Swift
@discardableResult func background(_ value: UIColor) -> Self
Parameters
value
Set a background color when converting transparent .png files into other file types.
-
Adds the
page
option.Declaration
Swift
@discardableResult func page(_ value: Int) -> Self
Parameters
value
If you are converting a file that contains multiple pages such as a PDF or PowerPoint file, you can extract a specific page using the page parameter. Valid range:
1...99999
-
Adds the
density
option.Declaration
Swift
@discardableResult func density(_ value: Int) -> Self
Parameters
value
You can adjust the density when converting documents like PowerPoint, PDF, AI and EPS files to image formats like JPG or PNG. Valid range:
1...500
-
Adds the
compress
option. Takes advantage of Filestack’s image compression which utilizes JPEGtran and OptiPNG.Declaration
Swift
@discardableResult func compress() -> Self
-
Adds the
quality
option.Declaration
Swift
@discardableResult func quality(_ value: Int) -> Self
Parameters
value
You can change the quality (and reduce the file size) of JPEG images by using the quality parameter. Valid range:
1...100
-
Adds the
quality
option with value set to “input”. Used for JPG images if we want output file to have same quality as original one.Declaration
Swift
@discardableResult func preserveInputQuality() -> Self
-
Adds the
strip
option. Remove embedded file metadata.Declaration
Swift
@discardableResult func strip() -> Self
-
Adds the
colorspace
option.Declaration
Swift
@discardableResult func colorSpace(_ value: TransformColorSpace) -> Self
Parameters
value
An
TransformColorSpace
value. -
Adds the
secure
option. Applies to conversions of HTML and SVG sources only. When the secure parameter is set to true, the HTML or SVG file will be stripped of any insecure tags.Declaration
Swift
@discardableResult func secure() -> Self
-
Adds the
docinfo
option. Gives information about a document, such as the number of pages and the dimensions of the file. This information is delivered as a JSON object.Declaration
Swift
@discardableResult func docInfo() -> Self
-
Adds the
pageFormat
option.Declaration
Swift
@discardableResult func pageFormat(_ value: TransformPageFormat) -> Self
Parameters
value
An
TransformPageFormat
value. -
Adds the
pageOrientation
option.Declaration
Swift
@discardableResult func pageOrientation(_ value: TransformPageOrientation) -> Self
Parameters
value
An
TransformPageOrientation
value.