java.lang.Objectcom.aspose.words.SaveOptions
public class SaveOptions
The Example:
Document doc = new Document(getMyDir() + "Document.doc");
// Set an option to export form fields as plain text, not as HTML input elements.
doc.getSaveOptions().setHtmlExportTextInputFormFieldAsText(true);
doc.save(getMyDir() + "Document.SaveWithOptions Out.html");
Property Getters/Setters Summary | ||
---|---|---|
java.lang.String | getExportImagesFolder() | |
void | setExportImagesFolder(java.lang.String value) | |
Specifies the physical folder where images are saved when saving a document to a stream in the HTML or Aspose.Pdf XML format. | ||
boolean | getHtmlExportAllowNegativeLeftIndent() | |
void | setHtmlExportAllowNegativeLeftIndent(boolean value) | |
Specifies whether negative left indent of paragraphs is normalized when exporting to HTML. Default value is false. | ||
java.lang.String | getHtmlExportCssStyleSheetFileName() | |
void | setHtmlExportCssStyleSheetFileName(java.lang.String value) | |
Specifies the name of the Cascading Style Sheet (CSS) file written with the exported document. Default is an empty string. | ||
int | getHtmlExportCssStyleSheetType() | |
void | setHtmlExportCssStyleSheetType(int value) | |
Specifies how CSS (Cascading Style Sheet) styles are exported to HTML. The value of the property is CssStyleSheetType integer constant. | ||
boolean | getHtmlExportDocumentProperties() | |
void | setHtmlExportDocumentProperties(boolean value) | |
Specifies whether to export built-in and custom document properties to HTML. Default value is false. | ||
java.nio.charset.Charset | getHtmlExportEncoding() | |
void | setHtmlExportEncoding(java.nio.charset.Charset value) | |
Specifies the encoding to use when exporting to HTML format. Default value is 'UTF-8' Charset. | ||
boolean | getHtmlExportHeadersFooters() | |
void | setHtmlExportHeadersFooters(boolean value) | |
Specifies whether to output headers and footers to HTML. Default value is true. | ||
int | getHtmlExportImageResolution() | |
void | setHtmlExportImageResolution(int value) | |
Specifies the output resolution for images when exporting to HTML. Default is 96 dpi. | ||
java.lang.String | getHtmlExportImagesFolder() | |
void | setHtmlExportImagesFolder(java.lang.String value) | |
Specifies the physical folder where images are saved when exporting a document to HTML format. Default is an empty string. | ||
java.lang.String | getHtmlExportImagesFolderAlias() | |
void | setHtmlExportImagesFolderAlias(java.lang.String value) | |
Specifies the name of the folder used to construct image URIs written into an HTML document. Default is an empty string. | ||
boolean | getHtmlExportMetafileAsRaster() | |
void | setHtmlExportMetafileAsRaster(boolean value) | |
Specifies whether to convert metafiles into raster images when exporting to HTML. Default value is true. | ||
int | getHtmlExportMetafileResolution() | |
void | setHtmlExportMetafileResolution(int value) | |
Specifies the resolution at which metafiles are converted to raster images when exporting to HTML. Default is 96 dpi. | ||
boolean | getHtmlExportPageSetup() | |
void | setHtmlExportPageSetup(boolean value) | |
Specifies whether page setup is exported to HTML. Default is false. | ||
boolean | getHtmlExportScaleImageToShapeSize() | |
void | setHtmlExportScaleImageToShapeSize(boolean value) | |
Specifies whether images are scaled by Aspose.Words to the bounding shape size when exporting to HTML. Default value is true. | ||
boolean | getHtmlExportTextInputFormFieldAsText() | |
void | setHtmlExportTextInputFormFieldAsText(boolean value) | |
Specifies how to export Word text input form fields to HTML. Default value is false. | ||
boolean | getHtmlExportXhtmlTransitional() | |
void | setHtmlExportXhtmlTransitional(boolean value) | |
When true, writes a DOCTYPE declaration in the document prior to the root element. Default value is false. | ||
boolean | getRtfExportCompactSize() | |
void | setRtfExportCompactSize(boolean value) | |
Specifies whether to generate compact size RTF documents. When this property is true, some RTF features intended for old readers are omitted. Default value is false. | ||
java.nio.charset.Charset | getTxtExportEncoding() | |
void | setTxtExportEncoding(java.nio.charset.Charset value) | |
Specifies the encoding to use when exporting in plain text format. Default value is 'UTF-8' Charset. | ||
boolean | getTxtExportHeadersFooters() | |
void | setTxtExportHeadersFooters(boolean value) | |
Specifies whether to output headers and footers when exporting in plain text format. Default value is true. | ||
java.lang.String | getTxtExportParagraphBreak() | |
void | setTxtExportParagraphBreak(java.lang.String value) | |
Specifies the string to use as a paragraph break when exporting in plain text format. | ||
boolean | getTxtExportTableLayout() | |
void | setTxtExportTableLayout(boolean value) | |
Specifies whether tables should preserve layout when exporting in plain text format. The default value is false. |
Method Summary | ||
---|---|---|
void | addHtmlExportImageSavingEventHandler(ExportImageSavingEventHandler newListener) | |
Adds the |
||
boolean | getHtmlExportMetafileAsRaster() | |
Specifies whether to save metafiles as rasters or not to save. | ||
void | removeHtmlExportImageSavingEventHandler(ExportImageSavingEventHandler oldListener) | |
Removes the |
||
void | setHtmlExportMetafileAsRaster(boolean value) | |
Specifies whether to save metafiles as rasters or not to save. |
Property Getters/Setters Detail |
---|
getExportImagesFolder/setExportImagesFolder | |
public java.lang.String getExportImagesFolder() / public void setExportImagesFolder(java.lang.String value) |
getHtmlExportImagesFolder/setHtmlExportImagesFolder | |
public java.lang.String getHtmlExportImagesFolder() / public void setHtmlExportImagesFolder(java.lang.String value) |
When you save a
If you save a document into a file and provide a file name, Aspose.Words, by default, saves the
images in the same folder where the document file is saved. Use
If you save a document into a stream, Aspose.Words does not have a folder where to save the images,
but still needs to save the images somewhere. In this case, you need to specify an accessible folder
in the
getHtmlExportImagesFolderAlias/setHtmlExportImagesFolderAlias | |
public java.lang.String getHtmlExportImagesFolderAlias() / public void setHtmlExportImagesFolderAlias(java.lang.String value) |
When you save a
If
If
If
getHtmlExportCssStyleSheetFileName/setHtmlExportCssStyleSheetFileName | |
public java.lang.String getHtmlExportCssStyleSheetFileName() / public void setHtmlExportCssStyleSheetFileName(java.lang.String value) |
Note, this property has effect only when saving a
If you don't specify a value for this property, then the style sheet file will have the same name as the HTML document name, but with a ".css" extension.
getHtmlExportTextInputFormFieldAsText/setHtmlExportTextInputFormFieldAsText | |
public boolean getHtmlExportTextInputFormFieldAsText() / public void setHtmlExportTextInputFormFieldAsText(boolean value) |
When false, exports Word text input form fields as INPUT elements in HTML. When set to true, exports text input form fields as normal text.
Example:
Shows how to set save options before saving a document.Document doc = new Document(getMyDir() + "Document.doc"); // Set an option to export form fields as plain text, not as HTML input elements. doc.getSaveOptions().setHtmlExportTextInputFormFieldAsText(true); doc.save(getMyDir() + "Document.SaveWithOptions Out.html");
getHtmlExportHeadersFooters/setHtmlExportHeadersFooters | |
public boolean getHtmlExportHeadersFooters() / public void setHtmlExportHeadersFooters(boolean value) |
It is hard to meaningfully output headers and footers to HTML because HTML is not paginated. When this property is true, Aspose.Words exports only primary headers and footers at the beginning and end of each section. You can disable export of headers and footers altogether by setting this property to false.
getHtmlExportAllowNegativeLeftIndent/setHtmlExportAllowNegativeLeftIndent | |
public boolean getHtmlExportAllowNegativeLeftIndent() / public void setHtmlExportAllowNegativeLeftIndent(boolean value) |
When negative left indent is not allowed, it is exported as zero left margin to HTML. When negative left indent is allowed, a paragraph might appear partially outside of the browser window.
getHtmlExportXhtmlTransitional/setHtmlExportXhtmlTransitional | |
public boolean getHtmlExportXhtmlTransitional() / public void setHtmlExportXhtmlTransitional(boolean value) |
Aspose.Words always writes well formed HTML regardless of this setting.
When true, the beginning of the HTML output document will look like this:
<?xml version="1.0" encoding="utf-8" standalone="no" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Aspose.Words aims to output XHTML according to the XHTML 1.0 Transitional specification, but the output will not always validate against the DTD. Some structures inside a Microsoft Word document are hard or impossible to map to a document that will validate against the XHTML schema. For example, XHTML does not allow nested lists (UL cannot be nested inside another UL element), but in Microsoft Word document multilevel lists occur quite often.
getHtmlExportDocumentProperties/setHtmlExportDocumentProperties | |
public boolean getHtmlExportDocumentProperties() / public void setHtmlExportDocumentProperties(boolean value) |
getHtmlExportMetafileAsRaster/setHtmlExportMetafileAsRaster | |
public boolean getHtmlExportMetafileAsRaster() / public void setHtmlExportMetafileAsRaster(boolean value) |
Metafiles are not natively displayed by HTML browsers. By default, Aspose.Words converts WMF and EMF images into PNG files when exporting to HTML. Setting this property to false causes metafiles to be exported to HTML without conversion.
Some image transforms, in particular image cropping, will not be applied to metafile images if this property is false.
getHtmlExportScaleImageToShapeSize/setHtmlExportScaleImageToShapeSize | |
public boolean getHtmlExportScaleImageToShapeSize() / public void setHtmlExportScaleImageToShapeSize(boolean value) |
An image in a Microsoft Word document is a shape. The shape has a size and the image has its own size. The sizes are not directly linked. For example, the image can be 1024x786 pixels, but shape that displays this image can be 400x300 points.
In order to display an image in the browser, it must be scaled to the shape size.
The
When
In general, browsers do quick and poor quality scaling. As a result, you will normally get better
display quality in the browser and smaller file size when
getHtmlExportImageResolution/setHtmlExportImageResolution | |
public int getHtmlExportImageResolution() / public void setHtmlExportImageResolution(int value) |
This property has effect for raster images only when
getHtmlExportMetafileResolution/setHtmlExportMetafileResolution | |
public int getHtmlExportMetafileResolution() / public void setHtmlExportMetafileResolution(int value) |
Metafiles are not natively displayed by browsers and therefore Aspose.Words converts WMF and EMF images into PNG files when exporting to HTML. This setting specifies the resolution of the created PNG files. If the HTML file is intended to be viewed on the screen, the default setting will produce images of adequate quality and small size.
getHtmlExportCssStyleSheetType/setHtmlExportCssStyleSheetType | |
public int getHtmlExportCssStyleSheetType() / public void setHtmlExportCssStyleSheetType(int value) |
The default value is
getHtmlExportPageSetup/setHtmlExportPageSetup | |
public boolean getHtmlExportPageSetup() / public void setHtmlExportPageSetup(boolean value) |
Each
In most cases HTML is intended for viewing in browsers where pagination is not performed. So this feature is inactive by default.
getHtmlExportEncoding/setHtmlExportEncoding | |
public java.nio.charset.Charset getHtmlExportEncoding() / public void setHtmlExportEncoding(java.nio.charset.Charset value) |
getRtfExportCompactSize/setRtfExportCompactSize | |
public boolean getRtfExportCompactSize() / public void setRtfExportCompactSize(boolean value) |
getTxtExportHeadersFooters/setTxtExportHeadersFooters | |
public boolean getTxtExportHeadersFooters() / public void setTxtExportHeadersFooters(boolean value) |
It is hard to meaningfully output headers and footers to plain text because it is not paginated. When this property is true, Aspose.Words exports only primary headers and footers at the beginning and end of each section. You can disable export of headers and footers altogether by setting this property to false.
getTxtExportEncoding/setTxtExportEncoding | |
public java.nio.charset.Charset getTxtExportEncoding() / public void setTxtExportEncoding(java.nio.charset.Charset value) |
getTxtExportParagraphBreak/setTxtExportParagraphBreak | |
public java.lang.String getTxtExportParagraphBreak() / public void setTxtExportParagraphBreak(java.lang.String value) |
The default value is
getTxtExportTableLayout/setTxtExportTableLayout | |
public boolean getTxtExportTableLayout() / public void setTxtExportTableLayout(boolean value) |
Method Detail |
---|
getHtmlExportMetafileAsRaster | |
public boolean getHtmlExportMetafileAsRaster() |
By default aspose.words converts metafiles (.wmf and .emf images) into a raster format (.png). Setting this property and HtmlExportScaleImageToShapeSize to false leaves metafiles as is.
setHtmlExportMetafileAsRaster | |
public void setHtmlExportMetafileAsRaster(boolean value) |
By default aspose.words converts metafiles (.wmf and .emf images) into a raster format (.png). Setting this property and HtmlExportScaleImageToShapeSize to false leaves metafiles as is.
addHtmlExportImageSavingEventHandler | |
public void addHtmlExportImageSavingEventHandler(ExportImageSavingEventHandler newListener) |
removeHtmlExportImageSavingEventHandler | |
public void removeHtmlExportImageSavingEventHandler(ExportImageSavingEventHandler oldListener) |