Disable Files Compression when Adding as Embedded Resources
To allow developers to control file compression the setEncoding(..) method has been added to the FileSpecification class. This property determines which encoding will be used for file compression. The method accepts a value from the FileEncoding enumerator. The possible values are FileEncoding.None and FileEncoding.Zip.
The following code snippet shows how to add an attachment to a PDF document.