Class
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
Relationships
Superclass
Transform
:nodoc:
Initializers
Methods
format(_:)
@discardableResult
func format(_ value: TransformFiletype) -> Self
Adds the format
option.
Parameters
Name | Type | Description |
---|---|---|
value | TransformFiletype |
The format to which you would like to convert the file. |
background(_:)
@discardableResult
func background(_ value: UIColor) -> Self
Adds the background
option.
Parameters
Name | Type | Description |
---|---|---|
value | UIColor |
Set a background color when converting transparent .png files into other file types. |
page(_:)
@discardableResult
func page(_ value: Int) -> Self
Adds the page
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
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: |
density(_:)
@discardableResult
func density(_ value: Int) -> Self
Adds the density
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
You can adjust the density when converting documents like PowerPoint, PDF, AI and EPS files to image formats like JPG or PNG. Valid range: |
compress()
@discardableResult
func compress() -> Self
Adds the compress
option.
Takes advantage of Filestack's image compression which utilizes JPEGtran and OptiPNG.
quality(_:)
@discardableResult
func quality(_ value: Int) -> Self
Adds the quality
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
You can change the quality (and reduce the file size) of JPEG images by using the quality parameter. Valid range: |
preserveInputQuality()
@discardableResult
func preserveInputQuality() -> Self
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.
strip()
@discardableResult
func strip() -> Self
Adds the strip
option.
Remove embedded file metadata.
colorSpace(_:)
@discardableResult
func colorSpace(_ value: TransformColorSpace) -> Self
Adds the colorspace
option.
Parameters
Name | Type | Description |
---|---|---|
value | TransformColorSpace |
An |
secure()
@discardableResult
func secure() -> Self
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.
docInfo()
@discardableResult
func docInfo() -> 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.
pageFormat(_:)
@discardableResult
func pageFormat(_ value: TransformPageFormat) -> Self
Adds the pageFormat
option.
Parameters
Name | Type | Description |
---|---|---|
value | TransformPageFormat |
An |
pageOrientation(_:)
@discardableResult
func pageOrientation(_ value: TransformPageOrientation) -> Self
Adds the pageOrientation
option.
Parameters
Name | Type | Description |
---|---|---|
value | TransformPageOrientation |
An |