public class HtmlSaveOptions extends UnifiedSaveOptions
Save options for export to Html format
Modifier and Type | Class and Description |
---|---|
static class |
HtmlSaveOptions.CssSavingInfo
This class represents set of data
that related to custom saving of CSS during conversion
of PDF to HTML format
|
static interface |
HtmlSaveOptions.CssSavingStrategy
You can assygn to this property custom strategy that implements processing
or/and saving of one CSS's part that was created during conversion of PDF to HTML .
|
static interface |
HtmlSaveOptions.CssUrlMakingStrategy
You can assygn to this property delegate created from custom method that implements creation of URL of CSS referenced
in generated HTML document.
|
static class |
HtmlSaveOptions.CssUrlRequestInfo
Represents set of data
that related to request from converter to
custom code aimed to get desirable URL (or URL template)of subject CSS
|
static class |
HtmlSaveOptions.FontSavingModes
Enumerates modes that can be used for saving of fonts
referenced in saved PDF
|
static class |
HtmlSaveOptions.HtmlImageSavingInfo
This class represents set of data
that related to external resource image file's saving
during PDF to HTML conversion.
|
static class |
HtmlSaveOptions.HtmlImageType
enumerates possible types of image files
that can be saved as external resources
during Pdf to Html conversion
|
static class |
HtmlSaveOptions.HtmlMarkupGenerationModes
Sometimes specific reqirments to created HTML are present.
|
static class |
HtmlSaveOptions.HtmlPageMarkupSavingInfo
If SplitToPages property of HtmlSaveOptions, then several HTML-files (one HTML file per converted page)
are created during conversion of PDF to HTML.
|
static interface |
HtmlSaveOptions.HtmlPageMarkupSavingStrategy
Result of conversion can contain one or several HTML-pages ( that also can reference external files like images or fonts)
You can assygn to this property delegate created from custom method that implements processing
of got HTML-page(HTML itself) that was created during conversion.
|
static class |
HtmlSaveOptions.ImageParentTypes
Enumerates possible types of image's parents
Image can pertain to HTML page or to SVG parent image
|
static class |
HtmlSaveOptions.RasterImagesSavingModes
Converted PDF can contain raster images(.png, *.jpeg etc.)
This enum defines methods of how raster images can be handled
during conversion of PDF to HTML
|
static interface |
HtmlSaveOptions.ResourceSavingStrategy
To this property You can assygn delegate created from custom method that implements processing
of external resource(Font or Image)
that was extracted from PDF and must be saved as external resource during conversion of PDF to HTML.
|
UnifiedSaveOptions.ConversionProgressEventHandler, UnifiedSaveOptions.ProgressEventHandlerInfo, UnifiedSaveOptions.ProgressEventType
SaveOptions.BorderInfo, SaveOptions.BorderPartStyle, SaveOptions.HtmlBorderLineType, SaveOptions.NodeLevelResourceType, SaveOptions.ResourceSavingInfo
Modifier and Type | Field and Description |
---|---|
String |
CssClassNamesPrefix
When PDFtoHTML converter generates result CSSs, CSS class names
(something like ".stl_01 {}" ...
|
HtmlSaveOptions.CssSavingStrategy |
CustomCssSavingStrategy
This field can contain saving strategy
that must be used (if present) during conversion
of Pdf to Html for handling of saving of CSSes related
to created HTML document as whole or to it's pages(if several HTMLpages are generated)
If You want handle CSS file in some specific way, that just please create relevant method and
assygn delegate created from it to this property.
|
HtmlSaveOptions.HtmlPageMarkupSavingStrategy |
CustomHtmlSavingStrategy
Result of conversion can contain one or several HTML-pages
You can assygn to this property delegate created from custom method that implements processing
of one HTML-page(to be accurately - markup-HTML, without exteranl linked files if any)
that was created during conversion.
|
UnifiedSaveOptions.ConversionProgressEventHandler |
CustomProgressHandler
This handler can be used to handle conversion progress events
f.e.
|
HtmlSaveOptions.ResourceSavingStrategy |
CustomResourceSavingStrategy
This field can contain saving strategy
that must be used (if present) during conversion
for customized handling of created referenced resource
files (like images and fonts) related to nodes of saved HTML.
|
HtmlSaveOptions.CssUrlMakingStrategy |
CustomStrategyOfCssUrlCreation
This field can contain custom method that returns
URL (Or URL template if multipage generation is on - see details below) of subject CSS as it should be put in generated result HTML.
|
int[] |
ExplicitListOfSavedPages
With this property You can explicitely define
what pages of document should be converted.
|
int |
FontSavingMode
Defines font saving mode that will be used during saving of PDF to desirable format
|
int |
HtmlMarkupGenerationMode
Sometimes specific reqirments to generation of HTML markup are present.
|
int |
LettersPositioningMethod
Sets mode of positioning of letters in words in result HTML
|
SaveOptions.BorderInfo |
PageBorderIfAny
This attribute represents set of settings used for drawing border (if any)
in result HTML document around area that represent source PDF page.
|
boolean |
PagesFlowTypeDependsOnViewersScreenSize
If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be
put into one big result HTML file.
|
int |
RasterImagesSavingMode
Converted PDF can contain raster images
This parameter defines how they should be handled
during conversion of PDF to HTML
|
boolean |
RemoveEmptyAreasOnTopAndBottom
Defines whether in created HTML will be removed top and bottom empty area without any content (if any).
|
String |
SpecialFolderForAllImages
Gets or sets path to directory to which must be saved any images if they
are encountered during saving of document as HTML.
|
String |
SpecialFolderForSvgImages
Gets or sets path to directory to which must be saved only SVG-images if they
are encountered during saving of document as HTML.
|
ProgressEventsRetranslator
Constructor and Description |
---|
HtmlSaveOptions()
Initializes a new instance of the
|
HtmlSaveOptions(boolean fixedLayout)
Initializes a new instance of the
HtmlSaveOptions class. |
HtmlSaveOptions(int documentType)
Initializes a new instance of the
HtmlSaveOptions class. |
HtmlSaveOptions(int documentType,
boolean fixedLayout)
Initializes a new instance of the
HtmlSaveOptions class. |
Modifier and Type | Method and Description |
---|---|
int |
getAdditionalMarginWidthInPoints()
If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages wont
be not split into different HTML pages, but will be put into one big result HTML file.
|
boolean |
getCompressSvgGraphicsIfAny()
Gets or sets the flag that indicates whether
found SVG graphics(if any) will be compressed(zipped)
into SVGZ format during saving
|
int |
getDocumentType()
Gets the
HtmlDocumentTypeInternal . |
boolean |
getFixedLayout()
Gets a value indicating whether that HTML is created as fixed layout.
|
boolean |
getSplitCssIntoPages()
When multipage-mode selected(i.e 'SplitIntoPages' is 'true'),
then this attribute defines whether should be created separate CSS-file
for each result HTML page.
|
boolean |
getSplitIntoPages()
Gets or sets the flag that indicates whether each page of source
document will be converted into it's own target HTML document,
i.e whether result HTML will be splitted into several HTML-pages.
|
void |
setAdditionalMarginWidthInPoints(int value) |
void |
setCompressSvgGraphicsIfAny(boolean value) |
void |
setDocumentType(int value)
Sets the
HtmlDocumentTypeInternal . |
void |
setFixedLayout(boolean value)
Sets a value indicating whether that HTML is created as fixed layout.
|
void |
setSplitCssIntoPages(boolean value) |
void |
setSplitIntoPages(boolean value) |
getCloseResponse, getSaveFormat, getWarningHandler, setCloseResponse, setWarningHandler
public UnifiedSaveOptions.ConversionProgressEventHandler CustomProgressHandler
This handler can be used to handle conversion progress events f.e. it can be used to show progress bar or messages about current amount of processed pages, example of handler's code that shows progress on console is :
public static void ConvertWithShowingProgress() { (new com.aspose.pdf.License()).setLicense("Aspose.Total.lic"); Document doc = new Document("Booklet.pdf"); HtmlSaveOptions saveOptions = new HtmlSaveOptions(); saveOptions.CustomProgressHandler = new com.aspose.pdf.UnifiedSaveOptions.ConversionProgressEventHandler() { public void invoke( UnifiedSaveOptions.ProgressEventHandlerInfo eventInfo) { showProgressOnConsole(eventInfo); } }; doc.save("Booklet.doc", saveOptions); } public static void showProgressOnConsole(HtmlSaveOptions.ProgressEventHandlerInfo eventInfo) { switch (eventInfo.EventType) { case HtmlSaveOptions.ProgressEventType.TotalProgress: System.out.println(String.format("%s - Conversion progress : %d % .", (new Date()).toString(), eventInfo.Value)); break; case HtmlSaveOptions.ProgressEventType.SourcePageAnalized: System.out.println(String.format("%s - Source page %d of %d analyzed.", (new Date()).toString(), eventInfo.Value, eventInfo.MaxValue)); break; case HtmlSaveOptions.ProgressEventType.ResultPageCreated: System.out.println(String.format("%s - Result page's %d of %d layout created.", (new Date()).toString(), eventInfo.Value, eventInfo.MaxValue)); break; case HtmlSaveOptions.ProgressEventType.ResultPageSaved: System.out.println(String.format("%s - Result page %d of %d exported.", (new Date()).toString(), eventInfo.Value, eventInfo.MaxValue)); break; default: break; } }
public int FontSavingMode
Defines font saving mode that will be used during saving of PDF to desirable format
public SaveOptions.BorderInfo PageBorderIfAny
This attribute represents set of settings used for drawing border (if any) in result HTML document around area that represent source PDF page. In essence it concerns of showing of page's paper edges, not page border referenced in PDF page itself.
public int LettersPositioningMethod
Sets mode of positioning of letters in words in result HTML
public int[] ExplicitListOfSavedPages
With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. If this list is null (as it is by default), all pages will be converted. If any page number of this list will go out of range of present pages(1-[amountOfPagesInDocument]) exception will be thrown.
public HtmlSaveOptions.ResourceSavingStrategy CustomResourceSavingStrategy
This field can contain saving strategy that must be used (if present) during conversion for customized handling of created referenced resource files (like images and fonts) related to nodes of saved HTML. That strategy must process resources and return string that represents desirable URL of saved resource in generated HTML.
public HtmlSaveOptions.CssSavingStrategy CustomCssSavingStrategy
This field can contain saving strategy that must be used (if present) during conversion of Pdf to Html for handling of saving of CSSes related to created HTML document as whole or to it's pages(if several HTMLpages are generated) If You want handle CSS file in some specific way, that just please create relevant method and assygn delegate created from it to this property.
public HtmlSaveOptions.HtmlPageMarkupSavingStrategy CustomHtmlSavingStrategy
Result of conversion can contain one or several HTML-pages You can assygn to this property delegate created from custom method that implements processing of one HTML-page(to be accurately - markup-HTML, without exteranl linked files if any) that was created during conversion. In such case processing (like saving of paage's HTML in stream or disk) can be done in that custom code . In such case all the necessary actions for saving of HTML page must be undertaken in code of supplied method, because saving of result in code of converter will be not in use . If processing for this or that case for some reason must be done by converter's code itself, not in custom code, please set in custom code flag 'CustomProcessingCancelled' of 'htmlSavingInfo' parameter's variable : it will signal to converter that all the necessary steps for processing of that resource must be done in converter itself in same way as if there was no any external custom code for procesing .
public HtmlSaveOptions.CssUrlMakingStrategy CustomStrategyOfCssUrlCreation
This field can contain custom method that returns URL (Or URL template if multipage generation is on - see details below) of subject CSS as it should be put in generated result HTML. F.e. if You want converter put some specific URL instead of standard CSS file name into generated CSS, then You should just create and put into this property method that generates desirable URL. If flag 'SplitCssIntoPages' set, then this custom strategy (if any) must return not exact URL of CSS but rather template string that (after substitution of placeholder with page number with String.Format() function inside converter) can be resolved into URL for this or that page's CSS' URL. Examples of expected return string in such case are: 'SomeTargetLocation-page_{0}.css','../PartHandlers/GetCss.aspx?DocumentId=45654&CssPage={0}')
public String SpecialFolderForSvgImages
Gets or sets path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file.
public String SpecialFolderForAllImages
Gets or sets path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file.
public String CssClassNamesPrefix
When PDFtoHTML converter generates result CSSs, CSS class names (something like ".stl_01 {}" ... ".stl_NN {}) are generated and used in result CSS. This property allows forcebly set class name prefix For example, if You want that all class names start with 'my_prefix_' (i.e. were something like 'my_prefix_1' ... 'my_prefix_NNN' ) , then just assygn 'my_prefix_' to this property before conversion. If this property will stay untouched(i.e. null will be leaved as value ), then converter will generate class names itself (it wil be something like ".stl_01 {}" ... ".stl_NN {}")
public int HtmlMarkupGenerationMode
Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments.
public int RasterImagesSavingMode
Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML
public boolean RemoveEmptyAreasOnTopAndBottom
Defines whether in created HTML will be removed top and bottom empty area without any content (if any).
public boolean PagesFlowTypeDependsOnViewersScreenSize
If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. Suppose width of screen on viewer side is big enough to put 2 or more pages one near other in horizontal direction. If this flag set to true, then this opportunity will be used (as many pages will be shown in horizontal direction one near another as it possible, then next horizontal group of pages will be shown under first one ). Otherwise pages will flow in such way: next page goes always under previous one.
public HtmlSaveOptions()
Initializes a new instance of the
public HtmlSaveOptions(int documentType)
Initializes a new instance of the HtmlSaveOptions
class.
documentType
- The HtmlDocumentTypeInternal
.public HtmlSaveOptions(boolean fixedLayout)
Initializes a new instance of the HtmlSaveOptions
class.
fixedLayout
- public HtmlSaveOptions(int documentType, boolean fixedLayout)
Initializes a new instance of the HtmlSaveOptions
class.
documentType
- The HtmlDocumentTypeInternal
.fixedLayout
- if set to true
HTML is created as fixed layout.public int getDocumentType()
Gets the HtmlDocumentTypeInternal
.
HtmlDocumentTypeInternal
.public void setDocumentType(int value)
HtmlDocumentTypeInternal
.The
- HtmlDocumentTypeInternal
.public boolean getCompressSvgGraphicsIfAny()
Gets or sets the flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving
Value: TheHtmlDocumentType
.public void setCompressSvgGraphicsIfAny(boolean value)
public boolean getSplitCssIntoPages()
When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. By default this attribute is false, so, will be created one big common CSS for all created pages. Summary size of all CSSes generated in this mode(one CSS per page) usually much more than size of one big CSS file, because in former case CSS classes are duplicates in such case in several CSS files for each page. So, this setting is worse to be used only when You are interested in future processing of each HTML page independently, and therefore size of CSS of each one page taken apart is the most critical issue.
public void setSplitCssIntoPages(boolean value)
public boolean getSplitIntoPages()
Gets or sets the flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages.
public void setSplitIntoPages(boolean value)
public boolean getFixedLayout()
Gets a value indicating whether that HTML is created as fixed layout.
Value:true
if [fixed layout]; otherwise, false
.public void setFixedLayout(boolean value)
Sets a value indicating whether that HTML is created as fixed layout.
Value:true
if [fixed layout]; otherwise, false
.public int getAdditionalMarginWidthInPoints()
If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages wont be not split into different HTML pages, but will be put into one big result HTML file. But each source PDF page will be represented with it's own rectangle area in HTML (if necessary that areas can be bordered to show page paper edges with special attribute 'PageBorderIfAny'. This parameter defines width of margin that will be forcebly left around that output HTML-areas that represent pages of source PDF document.In essence it defines guaranteed interval between HTML-representations of PDF "paper" pages such mode of conversion.
public void setAdditionalMarginWidthInPoints(int value)
Copyright © 2014 Aspose. All Rights Reserved.