public abstract class SaveOptions
extends java.lang.Object
To learn more, visit the Specify Save Options documentation article.
An instance of the SaveOptions class or any derived class is passed to the stream M:Aspose.Words.Document.Save(System.IO.Stream,Aspose.Words.Saving.SaveOptions) or stringDocument.save(java.lang.String, com.aspose.words.SaveOptions) overloads for the user to define custom options when saving a document.| Modifier | Constructor and Description |
|---|---|
protected |
SaveOptions()
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
static SaveOptions |
createSaveOptions(int saveFormat) |
static SaveOptions |
createSaveOptions(java.lang.String fileName)
Creates a save options object of a class suitable for the file extension specified in the given file name.
|
boolean |
getAllowEmbeddingPostScriptFonts()
Gets a boolean value indicating whether to allow embedding fonts with PostScript outlines when embedding TrueType fonts in a document upon it is saved.
|
java.lang.String |
getDefaultTemplate()
Gets path to default template (including filename).
|
int |
getDml3DEffectsRenderingMode()
Gets a value determining how 3D effects are rendered.
|
int |
getDmlEffectsRenderingMode()
Gets a value determining how DrawingML effects are rendered.
|
int |
getDmlRenderingMode()
Gets a value determining how DrawingML shapes are rendered.
|
boolean |
getExportGeneratorName()
When true, causes the name and version of Aspose.Words to be embedded into produced files.
|
int |
getImlRenderingMode()
Gets a value determining how ink (InkML) objects are rendered.
|
boolean |
getMemoryOptimization()
Gets value determining if memory optimization should be performed before saving the document.
|
boolean |
getPrettyFormat()
When
true, pretty formats output where applicable. |
IDocumentSavingCallback |
getProgressCallback()
Called during saving a document and accepts data about saving progress.
|
abstract int |
getSaveFormat()
Specifies the format in which the document will be saved if this save options object is used.
|
java.lang.String |
getTempFolder()
Specifies the folder for temporary files used when saving to a DOC or DOCX file.
|
boolean |
getUpdateCreatedTimeProperty()
Gets a value determining whether the
BuiltInDocumentProperties.getCreatedTime() / BuiltInDocumentProperties.setCreatedTime(java.util.Date) property is updated before saving. |
boolean |
getUpdateFields()
Gets a value determining if fields of certain types should be updated before saving the document to a fixed page format.
|
boolean |
getUpdateLastPrintedProperty()
Gets a value determining whether the
BuiltInDocumentProperties.getLastPrinted() / BuiltInDocumentProperties.setLastPrinted(java.util.Date) property is updated before saving. |
boolean |
getUpdateLastSavedTimeProperty()
Gets a value determining whether the
BuiltInDocumentProperties.getLastSavedTime() / BuiltInDocumentProperties.setLastSavedTime(java.util.Date) property is updated before saving. |
boolean |
getUpdateSdtContent()
Gets value determining whether content of
StructuredDocumentTag is updated before saving. |
boolean |
getUseAntiAliasing()
Gets a value determining whether or not to use anti-aliasing for rendering.
|
boolean |
getUseHighQualityRendering()
Gets a value determining whether or not to use high quality (i.e.
|
void |
setAllowEmbeddingPostScriptFonts(boolean value)
Sets a boolean value indicating whether to allow embedding fonts with PostScript outlines when embedding TrueType fonts in a document upon it is saved.
|
void |
setDefaultTemplate(java.lang.String value)
Sets path to default template (including filename).
|
void |
setDml3DEffectsRenderingMode(int value)
Sets a value determining how 3D effects are rendered.
|
void |
setDmlEffectsRenderingMode(int value)
Sets a value determining how DrawingML effects are rendered.
|
void |
setDmlRenderingMode(int value)
Sets a value determining how DrawingML shapes are rendered.
|
void |
setExportGeneratorName(boolean value)
When true, causes the name and version of Aspose.Words to be embedded into produced files.
|
void |
setImlRenderingMode(int value)
Sets a value determining how ink (InkML) objects are rendered.
|
void |
setMemoryOptimization(boolean value)
Sets value determining if memory optimization should be performed before saving the document.
|
void |
setPrettyFormat(boolean value)
When
true, pretty formats output where applicable. |
void |
setProgressCallback(IDocumentSavingCallback value)
Called during saving a document and accepts data about saving progress.
|
abstract void |
setSaveFormat(int value)
Specifies the format in which the document will be saved if this save options object is used.
|
void |
setTempFolder(java.lang.String value)
Specifies the folder for temporary files used when saving to a DOC or DOCX file.
|
void |
setUpdateCreatedTimeProperty(boolean value)
Sets a value determining whether the
BuiltInDocumentProperties.getCreatedTime() / BuiltInDocumentProperties.setCreatedTime(java.util.Date) property is updated before saving. |
void |
setUpdateFields(boolean value)
Sets a value determining if fields of certain types should be updated before saving the document to a fixed page format.
|
void |
setUpdateLastPrintedProperty(boolean value)
Sets a value determining whether the
BuiltInDocumentProperties.getLastPrinted() / BuiltInDocumentProperties.setLastPrinted(java.util.Date) property is updated before saving. |
void |
setUpdateLastSavedTimeProperty(boolean value)
Sets a value determining whether the
BuiltInDocumentProperties.getLastSavedTime() / BuiltInDocumentProperties.setLastSavedTime(java.util.Date) property is updated before saving. |
void |
setUpdateSdtContent(boolean value)
Sets value determining whether content of
StructuredDocumentTag is updated before saving. |
void |
setUseAntiAliasing(boolean value)
Sets a value determining whether or not to use anti-aliasing for rendering.
|
void |
setUseHighQualityRendering(boolean value)
Sets a value determining whether or not to use high quality (i.e.
|
public abstract int getSaveFormat()
int value. The returned value is one of SaveFormat constants.public abstract void setSaveFormat(int value)
value - The corresponding int value. The value must be one of SaveFormat constants.public boolean getExportGeneratorName()
boolean value.public void setExportGeneratorName(boolean value)
value - The corresponding boolean value.public java.lang.String getTempFolder()
null and no temporary files are used.
When Aspose.Words saves a document, it needs to create temporary internal structures. By default, these internal structures are created in memory and the memory usage spikes for a short period while the document is being saved. When saving is complete, the memory is freed and reclaimed by the garbage collector.
If you are saving a very large document (thousands of pages) and/or processing many documents at the same time, then the memory spike during saving can be significant enough to cause the system to throw IndexOutOfBoundsException. Specifying a temporary folder using getTempFolder() / setTempFolder(java.lang.String) will cause Aspose.Words to keep the internal structures in temporary files instead of memory. It reduces the memory usage during saving, but will decrease the save performance.
The folder must exist and be writable, otherwise an exception will be thrown.
Aspose.Words automatically deletes all temporary files when saving is complete.
String value.public void setTempFolder(java.lang.String value)
null and no temporary files are used.
When Aspose.Words saves a document, it needs to create temporary internal structures. By default, these internal structures are created in memory and the memory usage spikes for a short period while the document is being saved. When saving is complete, the memory is freed and reclaimed by the garbage collector.
If you are saving a very large document (thousands of pages) and/or processing many documents at the same time, then the memory spike during saving can be significant enough to cause the system to throw IndexOutOfBoundsException. Specifying a temporary folder using getTempFolder() / setTempFolder(java.lang.String) will cause Aspose.Words to keep the internal structures in temporary files instead of memory. It reduces the memory usage during saving, but will decrease the save performance.
The folder must exist and be writable, otherwise an exception will be thrown.
Aspose.Words automatically deletes all temporary files when saving is complete.
value - The corresponding String value.public boolean getPrettyFormat()
true, pretty formats output where applicable. Default value is false.
Set to true to make HTML, MHTML, EPUB, WordML, RTF, DOCX and ODT output human readable. Useful for testing or debugging.
boolean value.public void setPrettyFormat(boolean value)
true, pretty formats output where applicable. Default value is false.
Set to true to make HTML, MHTML, EPUB, WordML, RTF, DOCX and ODT output human readable. Useful for testing or debugging.
value - The corresponding boolean value.public boolean getUseAntiAliasing()
The default value is false. When this value is set to true anti-aliasing is used for rendering.
This property is used when the document is exported to the following formats: SaveFormat.TIFF, SaveFormat.PNG, SaveFormat.BMP, SaveFormat.JPEG, SaveFormat.EMF. When the document is exported to the SaveFormat.HTML, SaveFormat.MHTML, SaveFormat.EPUB and SaveFormat.AZW_3 formats this option is used for raster images.
public void setUseAntiAliasing(boolean value)
The default value is false. When this value is set to true anti-aliasing is used for rendering.
This property is used when the document is exported to the following formats: SaveFormat.TIFF, SaveFormat.PNG, SaveFormat.BMP, SaveFormat.JPEG, SaveFormat.EMF. When the document is exported to the SaveFormat.HTML, SaveFormat.MHTML, SaveFormat.EPUB and SaveFormat.AZW_3 formats this option is used for raster images.
value - A value determining whether or not to use anti-aliasing for rendering.public boolean getUseHighQualityRendering()
false.
This property is used when the document is exported to image formats: SaveFormat.TIFF, SaveFormat.PNG, SaveFormat.BMP, SaveFormat.JPEG, SaveFormat.EMF.
public void setUseHighQualityRendering(boolean value)
false.
This property is used when the document is exported to image formats: SaveFormat.TIFF, SaveFormat.PNG, SaveFormat.BMP, SaveFormat.JPEG, SaveFormat.EMF.
value - A value determining whether or not to use high quality (i.e.public boolean getUpdateSdtContent()
StructuredDocumentTag is updated before saving.
The default value is false.StructuredDocumentTag is updated before saving.public void setUpdateSdtContent(boolean value)
StructuredDocumentTag is updated before saving.
The default value is false.value - Value determining whether content of StructuredDocumentTag is updated before saving.public int getDmlRenderingMode()
DmlRenderingMode.FALLBACK.
This property is used when the document is exported to fixed page formats.
DmlRenderingMode constants.public void setDmlRenderingMode(int value)
DmlRenderingMode.FALLBACK.
This property is used when the document is exported to fixed page formats.
value - A value determining how DrawingML shapes are rendered. The value must be one of DmlRenderingMode constants.public int getDmlEffectsRenderingMode()
DmlEffectsRenderingMode.SIMPLIFIED.
This property is used when the document is exported to fixed page formats.
DmlEffectsRenderingMode constants.public void setDmlEffectsRenderingMode(int value)
DmlEffectsRenderingMode.SIMPLIFIED.
This property is used when the document is exported to fixed page formats.
value - A value determining how DrawingML effects are rendered. The value must be one of DmlEffectsRenderingMode constants.public int getImlRenderingMode()
ImlRenderingMode.INK_ML.
This property is used when the document is exported to fixed page formats.
ImlRenderingMode constants.public void setImlRenderingMode(int value)
ImlRenderingMode.INK_ML.
This property is used when the document is exported to fixed page formats.
value - A value determining how ink (InkML) objects are rendered. The value must be one of ImlRenderingMode constants.public java.lang.String getDefaultTemplate()
Document.getAutomaticallyUpdateStyles() / Document.setAutomaticallyUpdateStyles(boolean) is true, but Document.getAttachedTemplate() / Document.setAttachedTemplate(java.lang.String) is empty.public void setDefaultTemplate(java.lang.String value)
Document.getAutomaticallyUpdateStyles() / Document.setAutomaticallyUpdateStyles(boolean) is true, but Document.getAttachedTemplate() / Document.setAttachedTemplate(java.lang.String) is empty.value - Path to default template (including filename).public boolean getUpdateFields()
public void setUpdateFields(boolean value)
value - A value determining if fields of certain types should be updated before saving the document to a fixed page format.public boolean getUpdateLastSavedTimeProperty()
BuiltInDocumentProperties.getLastSavedTime() / BuiltInDocumentProperties.setLastSavedTime(java.util.Date) property is updated before saving.BuiltInDocumentProperties.getLastSavedTime() / BuiltInDocumentProperties.setLastSavedTime(java.util.Date) property is updated before saving.public void setUpdateLastSavedTimeProperty(boolean value)
BuiltInDocumentProperties.getLastSavedTime() / BuiltInDocumentProperties.setLastSavedTime(java.util.Date) property is updated before saving.value - A value determining whether the BuiltInDocumentProperties.getLastSavedTime() / BuiltInDocumentProperties.setLastSavedTime(java.util.Date) property is updated before saving.public boolean getUpdateLastPrintedProperty()
BuiltInDocumentProperties.getLastPrinted() / BuiltInDocumentProperties.setLastPrinted(java.util.Date) property is updated before saving.BuiltInDocumentProperties.getLastPrinted() / BuiltInDocumentProperties.setLastPrinted(java.util.Date) property is updated before saving.public void setUpdateLastPrintedProperty(boolean value)
BuiltInDocumentProperties.getLastPrinted() / BuiltInDocumentProperties.setLastPrinted(java.util.Date) property is updated before saving.value - A value determining whether the BuiltInDocumentProperties.getLastPrinted() / BuiltInDocumentProperties.setLastPrinted(java.util.Date) property is updated before saving.public boolean getUpdateCreatedTimeProperty()
BuiltInDocumentProperties.getCreatedTime() / BuiltInDocumentProperties.setCreatedTime(java.util.Date) property is updated before saving. Default value is false;BuiltInDocumentProperties.getCreatedTime() / BuiltInDocumentProperties.setCreatedTime(java.util.Date) property is updated before saving.public void setUpdateCreatedTimeProperty(boolean value)
BuiltInDocumentProperties.getCreatedTime() / BuiltInDocumentProperties.setCreatedTime(java.util.Date) property is updated before saving. Default value is false;value - A value determining whether the BuiltInDocumentProperties.getCreatedTime() / BuiltInDocumentProperties.setCreatedTime(java.util.Date) property is updated before saving.public boolean getMemoryOptimization()
public void setMemoryOptimization(boolean value)
value - Value determining if memory optimization should be performed before saving the document.public static SaveOptions createSaveOptions(int saveFormat)
public static SaveOptions createSaveOptions(java.lang.String fileName) throws java.lang.Exception
fileName - The extension of this file name determines the class of the save options object to create.SaveOptions.java.lang.Exceptionpublic int getDml3DEffectsRenderingMode()
Dml3DEffectsRenderingMode.BASIC.Dml3DEffectsRenderingMode constants.public void setDml3DEffectsRenderingMode(int value)
Dml3DEffectsRenderingMode.BASIC.value - A value determining how 3D effects are rendered. The value must be one of Dml3DEffectsRenderingMode constants.public IDocumentSavingCallback getProgressCallback()
Progress is reported when saving to SaveFormat.DOCX, SaveFormat.FLAT_OPC, SaveFormat.DOCM, SaveFormat.DOTM, SaveFormat.DOTX, SaveFormat.HTML, SaveFormat.MHTML, SaveFormat.EPUB, SaveFormat.XAML_FLOW, or SaveFormat.XAML_FLOW_PACK.
IDocumentSavingCallback value.public void setProgressCallback(IDocumentSavingCallback value)
Progress is reported when saving to SaveFormat.DOCX, SaveFormat.FLAT_OPC, SaveFormat.DOCM, SaveFormat.DOTM, SaveFormat.DOTX, SaveFormat.HTML, SaveFormat.MHTML, SaveFormat.EPUB, SaveFormat.XAML_FLOW, or SaveFormat.XAML_FLOW_PACK.
value - The corresponding IDocumentSavingCallback value.public boolean getAllowEmbeddingPostScriptFonts()
Note, Word does not embed PostScript fonts, but can open documents with embedded fonts of this type.
This option only works when FontInfoCollection.getEmbedTrueTypeFonts() / FontInfoCollection.setEmbedTrueTypeFonts(boolean) of the DocumentBase.getFontInfos() property is set to true.
public void setAllowEmbeddingPostScriptFonts(boolean value)
Note, Word does not embed PostScript fonts, but can open documents with embedded fonts of this type.
This option only works when FontInfoCollection.getEmbedTrueTypeFonts() / FontInfoCollection.setEmbedTrueTypeFonts(boolean) of the DocumentBase.getFontInfos() property is set to true.
value - A boolean value indicating whether to allow embedding fonts with PostScript outlines when embedding TrueType fonts in a document upon it is saved.