API Reference
Helpers
Provides helper methods for stream and file operations.
Inheritance
- Object
- Helpers
Methods
ConvertCentimetersToEmus(System.Double value) #Converts centimeters to EMUs and returns int value
Parameters
- value System.Double
ConvertCentimetersToEmusInt64(System.Double value) #Converts centimeters to EMUs and returns int64 value
Parameters
- value System.Double
ConvertCentimetersToPoints(System.Double cm) #Converts centimeters to points
Parameters
- cm System.Double
ConvertCentimetersToTwentiethsOfPoint(System.Double cm) #Converts centimeters to twentieths of a point
Parameters
- cm System.Double
ConvertCentimetersToTwips(System.Double cmValue) #Converts centimeters to twips
Parameters
- cmValue System.Double
ConvertCentimetersToTwipsUInt32(System.Double cmValue) #Converts centimeters to twips
Parameters
- cmValue System.Double
ConvertEmusToPoints(System.Int64 emusValue) #Converts EMUs to points
Parameters
- emusValue System.Int64
- EMUs value.
Returns
Points value.
ConvertPointsToCentimeters(System.Double points) #Converts the points to centimeters.
Parameters
- points System.Double
- The points.
ConvertPointsToEmusInt64(System.Double points) #Converts points to EMUs
Parameters
- points System.Double
- Points value.
Returns
EMUs value.
ConvertPointsToTwips(System.Double points) #Converts points to twips (twentieths of a point)
Parameters
- points System.Double
- The points value.
Returns
Twips value.
ConvertPointsToTwipsUInt32(System.Double points) #Converts points to twips (twentieths of a point)
Parameters
- points System.Double
- The points value.
Returns
Twips value.
ConvertTwipsToPoints(System.Int32 twipsValue) #Converts twips (twentieths of a point) to points
Parameters
- twipsValue System.Int32
- The value in twips.
Returns
Points value.
ConvertTwipsToPoints(System.UInt32 twipsValue) #Converts twips (twentieths of a point) to points
Parameters
- twipsValue System.UInt32
- The value in twips.
Returns
Points value.
public static FileStream CopyFileAndOpenFileStream(String sourcePath, String destPath) #FileStreamCopies a file and opens a file stream for the copied file.
Parameters
- sourcePath System.String
- The path of the source file.
- destPath System.String
- The path of the destination file.
Returns
A FileStream for the copied file.
public static FileStream CopyFileStreamToFileStream(String sourcePath, String destPath) #FileStreamCopies the contents of one file stream to another file stream.
Parameters
- sourcePath System.String
- The path of the source file.
- destPath System.String
- The path of the destination file.
Returns
A FileStream for the destination file.
public static MemoryStream CopyFileStreamToMemoryStream(String path) #MemoryStreamCopies the contents of a file stream to a MemoryStream.
Parameters
- path System.String
- The path of the file to read.
Returns
A MemoryStream containing the file's contents.
public static Void CopyStream(Stream source, Stream target) #VoidCopies the contents of one stream to another stream.
Parameters
- source System.IO.Stream
- The source stream.
- target System.IO.Stream
- The target stream.
FixPartIfExists(System.IO.Packaging.Package package, System.Uri partUri, System.Boolean removeWordPrefix) #Updates relationships for the specified part if it exists in the package.
Parameters
- package System.IO.Packaging.Package
- Package to modify.
- partUri System.Uri
- URI of the relationships part.
- removeWordPrefix System.Boolean
- Whether to remove the /word prefix from targets.
FixRelationships(System.IO.Packaging.PackagePart relsPart, System.Boolean removeWordPrefix) #Fixes relationship targets in the specified relationships part.
Parameters
- relsPart System.IO.Packaging.PackagePart
- Relationship part to process.
- removeWordPrefix System.Boolean
- Whether to remove the /word prefix from targets.
public static Void MakeOpenOfficeCompatible(Stream fileStream) #VoidAdjusts relationship targets so that the document can be opened by OpenOffice.
Parameters
- filePath System.String
- Path to the document package.
MakeOpenOfficeCompatible(System.IO.Stream fileStream) #Adjusts relationship targets for a document provided as a stream.
Parameters
- fileStream System.IO.Stream
- Stream containing the document package.
NormalizeColor(System.String arg1) #Normalizes color input which may be a hex value or a named color. Hex values may be specified as three or six digits, with or without '#'. Returns a lowercase six-digit hex string without '#'. Throws ArgumentException if the value cannot be parsed as a valid color.
Parameters
- arg1 System.String
public static Void Open(String filePath, Boolean open) #VoidOpens up any file using assigned Application
Parameters
- filePath System.String
- open System.Boolean
ParseColor(System.String hex) #Parses a color string that may or may not start with '#'.
Parameters
- hex System.String
- Color value in hex without alpha or with '#'.
public static MemoryStream ReadAllBytesToMemoryStream(String path) #MemoryStreamReads all bytes from a file and writes them to a MemoryStream.
Parameters
- path System.String
- The path of the file to read.
Returns
A MemoryStream containing the file's bytes.
public static MemoryStream ReadFileToMemoryStream(String path) #MemoryStreamReads the contents of a file into a MemoryStream.
Parameters
- path System.String
- The path of the file to read.
Returns
A MemoryStream containing the file's contents.
public static String ToHexColor(Color c) #StringConverts Color to Hex Color
Parameters
- c SixLabors.ImageSharp.Color
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object