Package com.ironsoftware.ironpdf.render
Enum LinearizationMode
- java.lang.Object
-
- java.lang.Enum<LinearizationMode>
-
- com.ironsoftware.ironpdf.render.LinearizationMode
-
- All Implemented Interfaces:
Serializable,Comparable<LinearizationMode>
public enum LinearizationMode extends Enum<LinearizationMode>
Specifies the linearization strategy to use when producing a linearized (web-optimized) PDF.Different linearization modes balance disk I/O requirements and system resource constraints. Choose the mode that best fits your use case and system environment.
Mirrors
IronPdf.LinearizationModeon the C# side.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AutomaticAutomatically selects the optimal linearization method based on system capabilities.FileBasedPerforms linearization using temporary file operations on disk.InMemoryPerforms linearization entirely in memory without any disk I/O operations.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LinearizationModevalueOf(String name)Returns the enum constant of this type with the specified name.static LinearizationMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Automatic
public static final LinearizationMode Automatic
Automatically selects the optimal linearization method based on system capabilities. This is the default and recommended option for most scenarios.Behavior:
- First attempts
FileBasedlinearization. - If disk access is restricted (e.g., limited permissions, sandboxed environment),
automatically falls back to
InMemory.
When to Use: Recommended for most applications where you want optimal linearization but need to handle varying system environments gracefully.
- First attempts
-
InMemory
public static final LinearizationMode InMemory
Performs linearization entirely in memory without any disk I/O operations.Characteristics:
- Speed: Fastest linearization method
- Security: No temporary files written to disk
- Disk I/O: Zero disk access required
When to Use:
- Compliance requirements mandate zero disk I/O (e.g., HIPAA, PCI-DSS)
- Processing sensitive documents that must not touch the filesystem
- Sandboxed or restricted environments without disk write permissions
- Cloud-based environments where disk I/O introduces latency
-
FileBased
public static final LinearizationMode FileBased
Performs linearization using temporary file operations on disk.Characteristics:
- Disk I/O: Requires writing temporary files to the system temp directory
System Requirements: Requires write permissions to the system temporary directory.
-
-
Method Detail
-
values
public static LinearizationMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LinearizationMode c : LinearizationMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LinearizationMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-