public class HTMLConversionOptions extends ConversionOptions
ConversionOptions.Font, ConversionOptions.ScalingMode, ConversionOptions.TextMode
Constructor | Description |
---|---|
HTMLConversionOptions() |
|
HTMLConversionOptions(String optionsAsString) |
|
HTMLConversionOptions(Map<String,String> jvmOptions) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
getAddJavaScript() |
|
void |
setAddJavaScript(boolean value) |
Include all the JavaScript that is within the PDF file.
|
void |
setCompressImages(boolean value) |
When enabled, generated PNG images will be compressed to reduce file size.
|
void |
setCompressSVG(boolean b) |
Generates compressed .svgz files rather than .svg (you will need to configure your web server to correctly serve these).
|
void |
setConvertPDFExternalFileToOutputType(boolean value) |
Set whether to convert links pointing to file.pdf into file.html inside GoToR and Launch link annotations.
|
void |
setConvertSpacesToNbsp(boolean value) |
|
void |
setDisableComments(boolean value) |
Disable comments inserted into the HTML output for clarity.
|
void |
setEmbedImagesAsBase64Stream(boolean value) |
Embed images as Base64 stream.
|
void |
setFontsToRasterizeInTextMode(String value) |
In Text Modes, you can override real text on a font by font basis,
|
void |
setFormTag(String value) |
Replacing <form> with your version.
|
void |
setImageScale(float imageScale) |
Write out larger images to allow higher quality zooming.
|
void |
setIncludedFonts(ConversionOptions.Font[] includedFonts) |
Set fonts to convert to and include in HTML and CSS output.
|
void |
setInlineSVG(boolean value) |
Inline SVG within HTML (pure svg text modes only).
|
void |
setKeepGlyfsSeparate(boolean value) |
Position each glyph individually for more accurate positioning.
|
void |
setLogicalPageRange(PageRanges value) |
Set a page range using logical page numbering.
|
void |
setOmitNameDir(boolean b) |
Controls the folder structure of the output.
|
void |
setOverlay(boolean value) |
Deprecated.
we do not recommend that this option be used.
|
void |
setRealPageRange(PageRanges value) |
Set a page range using real page numbering.
|
void |
setScaling(float value) |
Sets the Scaling value of the converted content.
|
void |
setScalingFitHeight(int value) |
|
void |
setScalingFitWidth(int value) |
|
void |
setScalingFitWidthHeight(int width,
int height) |
|
void |
setSeparateToWords(boolean value) |
Divide text chunks into words based on spaces
This improves accuracy but not as much as keepGlyfsSeparate,
It produces a larger file but may suit some use cases.
|
void |
setTextMode(ConversionOptions.TextMode value) |
The text mode controls how text is rendered in the html output, for example
your text can be made selectable or as an image and made non selectable.
|
void |
setUseLegacyImageFileType(boolean value) |
If enabled, all images output will use the PNG file type.
|
getApplyBranding, getErrors, getLogicalPageRange, getOmitNameDir, getPassword, getRealPageRange, getUseLegacyImageFileType, notSet, setPreserveExtractionValues
public HTMLConversionOptions()
public HTMLConversionOptions(String optionsAsString)
public void setTextMode(ConversionOptions.TextMode value)
For an explanation of text modes, please click here.
Important : shapetext modes extract the font metrics from the embedded fonts and includes them as shapes. If there are no embedded fonts then the converter will use Arial to ensure that text is actually displayed, although this may not be an ideal match (and we recommend using embedded fonts).
In the case where there are no embedded fonts, it's best to use a realtext mode.
Possible values:
Default: svg_realtext
Also set in the JVM options with -Dorg.jpedal.pdf2html.textMode=
value
- The TextMode to use for conversion.public void setDisableComments(boolean value)
Sections within the generated output are marked up with <!-- HTML comment tags --> to aid understanding of generated output and help parsing if necessary. Enabling this setting will remove those comments.
Possible values:
Default: false
Also set with -Dorg.jpedal.pdf2html.disableComments=
value
- Boolean true/falsepublic void setAddJavaScript(boolean value)
Possible values:
Default: false
Also set with -Dorg.jpedal.pdf2html.addJavaScript=
value
- Boolean true/falsepublic void setInlineSVG(boolean value)
This inlines the SVG within HTML so that there is no separate .svg file.
Possible values:
Default: false
Also set with -Dorg.jpedal.pdf2html.inlineSVG=
value
- Boolean true/false@Deprecated public void setOverlay(boolean value)
Possible values:
Default: true
Also set with -Dorg.jpedal.pdf2html.overlay=
value
- Boolean true/falsepublic void setOmitNameDir(boolean b)
By default, pages are output within a directory with the same name as the PDF file within the output directory specified.
Setting omitNameDir to true will cause pages to be output directly within the output directory specified. Possible values:
Default: false
Also set with -Dorg.jpedal.pdf2html.omitNameDir=
setOmitNameDir
in class ConversionOptions
b
- Boolean true/falsepublic void setCompressSVG(boolean b)
It is recommended to enable this setting as svg file sizes can be reduced by as much as 80-90%!
SVGZ files are simply SVG files which have been gzip compressed. Gzip compressed svg files are supported by all modern browsers (IE9 onwards, Firefox, Chrome, etc) as long as the web server is configured correctly.
For more information, please click here.
Possible values:
Default: false
Also set with -Dorg.jpedal.pdf2html.compressSVG=
setCompressSVG
in class ConversionOptions
b
- Boolean true/falsepublic void setScaling(float value)
Possible values:
Default: 1
Also set with -Dorg.jpedal.pdf2html.scaling=
setScaling
in class ConversionOptions
value
- is of type float.public void setLogicalPageRange(PageRanges value)
For example, let's assume a 7 page document with a page range of "2,4,6".
When using this setting, you will get 1.html, 2.html and 3.html, and navigation bars would assume that only these 3 pages exist.
Possible values:
Default: null
Also set with -Dorg.jpedal.pdf2html.logicalPageRange=
setLogicalPageRange
in class ConversionOptions
value
- is of Object type PageRanges.public void setRealPageRange(PageRanges value)
For example, let's assume a 7 page document with a page range of "2,4,6".
When using this setting, you will get 2.html, 4.html and 6.html, and navigation bars would behave as if pages 1, 3, 5 and 7 exist.
Possible values:
Default value: all pages, e.g. "1-39"
Also set with -Dorg.jpedal.pdf2html.realPageRange=
setRealPageRange
in class ConversionOptions
value
- is of Object type PageRanges.public void setScalingFitWidth(int value)
setScalingFitWidth
in class ConversionOptions
public void setScalingFitWidthHeight(int width, int height)
setScalingFitWidthHeight
in class ConversionOptions
public void setScalingFitHeight(int value)
setScalingFitHeight
in class ConversionOptions
public void setEmbedImagesAsBase64Stream(boolean value)
Inserts the images directly into the file as a base64 stream instead of referencing an external file.
Possible values:
Default: false
Also set with -Dorg.jpedal.pdf2html.embedImagesAsBase64Stream=
setEmbedImagesAsBase64Stream
in class ConversionOptions
value
- is of type boolean.public void setConvertSpacesToNbsp(boolean value)
setConvertSpacesToNbsp
in class ConversionOptions
public void setConvertPDFExternalFileToOutputType(boolean value)
Possible values:
Default: true
Also set with -Dorg.jpedal.pdf2html.convertPDFExternalFileToOutputType=
setConvertPDFExternalFileToOutputType
in class ConversionOptions
value
- is of type boolean.public void setFormTag(String value)
Possible values:
Default: <form>
Also set with -Dorg.jpedal.pdf2html.formTag=
setFormTag
in class ConversionOptions
value
- is of type String.public void setIncludedFonts(ConversionOptions.Font[] includedFonts)
Possible values:
Any comma separated list containing:
Also set with -Dorg.jpedal.pdf2html.includedFonts=
setIncludedFonts
in class ConversionOptions
includedFonts
- is an array of Object type Font.public void setKeepGlyfsSeparate(boolean value)
Produces a larger file but may suit some use cases
Possible values:
Also set with -Dorg.jpedal.pdf2html.keepGlyfsSeparate=
setKeepGlyfsSeparate
in class ConversionOptions
value
- is of type boolean.public void setSeparateToWords(boolean value)
Possible values:
Default: false
Also set with -Dorg.jpedal.pdf2html.separateTextToWords=
setSeparateToWords
in class ConversionOptions
value
- is of type boolean.public void setFontsToRasterizeInTextMode(String value)
In svg_realtext text will appear as part of SVG as Vectors This setting has no effect in other modes,
Needs to start EXCLUDE= or INCLUDE= followed by a list of comma separated fonts Comparison is case-insensitive so Arial, ARIAL and arial are the same.
Possible values:
For example:
Default: no effect
Also set with -Dorg.jpedal.pdf2html.fontsToRasterizeInTextMode=
setFontsToRasterizeInTextMode
in class ConversionOptions
value
- is of type String.public void setCompressImages(boolean value)
This setting has an effect only when svg text modes are used, or when setUseLegacyImageFileType is set to true.
Rather than producing 24 bit RGB or 32 bit RGBA truecolor PNG images, instead the converter will produce 8 bit palette images that have undergone quantization and dithering. This is a lossy compression, but visual quality remains very high.
Enabling compression will make conversion slower. On average, expect conversion time to at least double. File size saving can be significant. On files with large images, it is not unusual to see savings of 70-80% on the image file size.
Possible value:
Default: false
Also set with -Dorg.jpedal.pdf2html.compressImages=
setCompressImages
in class ConversionOptions
value
- is of type booleanpublic void setUseLegacyImageFileType(boolean value)
Possible value:
Default: false
Also set with -Dorg.jpedal.pdf2html.useLegacyImageFileType=
setUseLegacyImageFileType
in class ConversionOptions
value
- is of type boolean.public void setImageScale(float imageScale)
Default value is 1, which produces images at the same size they are displayed when the zoom is 100%. A value of 1.5 will generate images at 1.5x the standard size. The maximum size of an image is capped at the size of the source image stored in the PDF file. For example if the source image is 150x150, then increasing the imageScale value will not generate an image larger than 150x150.
It is important to remember that file size grows exponentially with the scaling factor. For example, scaling an image by 2 actually multiplies the number of pixels by 4. We therefore recommend a value such as 1.5 or 2.
Possible values:
Default: 1
Also set with -Dorg.jpedal.pdf2html.imageScale=
setImageScale
in class ConversionOptions
imageScale
- is of type floatpublic boolean getAddJavaScript()
Copyright 2021 IDRsolutions ltd. All rights reserved.