Package com.independentsoft.office.pdf
Class PdfSaveOptions
java.lang.Object
com.independentsoft.office.pdf.PdfSaveOptions
Options that control PDF export.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA registered font source. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFontDirectory(String directory)Adds a directory searched for TrueType fonts to embed.Gets the author written to the PDF Info dictionary, overriding the document property.Gets the creator written to the PDF Info dictionary.Gets additional directories searched for TrueType fonts to embed.Gets the keywords written to the PDF Info dictionary, overriding the document property.Gets the registered fonts.Gets the subject written to the PDF Info dictionary, overriding the document property.getTitle()Gets the document title written to the PDF Info dictionary, overriding the document property.booleanGets whether page content streams are compressed with Flate.booleanGets whether hyperlinks are exported as clickable link annotations.booleanGets whether a document outline (bookmarks) is created from headings.booleanGets whether TrueType fonts are embedded.booleanGets whether the operating system font directories are searched for fonts to embed.voidregisterFont(String fontFamily, boolean bold, boolean italic, byte[] fontData)Registers TrueType font data used when embedding fonts.voidregisterFont(String fontFamily, boolean bold, boolean italic, String filePath)Registers a TrueType font file used when embedding fonts.voidSets the author written to the PDF Info dictionary.voidsetCompressContent(boolean compressContent)Sets whether page content streams are compressed with Flate.voidsetCreateHyperlinks(boolean createHyperlinks)Sets whether hyperlinks are exported as clickable link annotations.voidsetCreateOutlines(boolean createOutlines)Sets whether a document outline (bookmarks) is created from headings.voidsetCreator(String creator)Sets the creator written to the PDF Info dictionary.voidsetEmbedFonts(boolean embedFonts)Sets whether TrueType fonts are embedded.voidsetKeywords(String keywords)Sets the keywords written to the PDF Info dictionary.voidsetSubject(String subject)Sets the subject written to the PDF Info dictionary.voidSets the document title written to the PDF Info dictionary.voidsetUseSystemFonts(boolean useSystemFonts)Sets whether the operating system font directories are searched for fonts to embed.
-
Constructor Details
-
PdfSaveOptions
public PdfSaveOptions()
-
-
Method Details
-
isCompressContent
public boolean isCompressContent()Gets whether page content streams are compressed with Flate. Default is true.- Returns:
- true if compression is enabled
-
setCompressContent
public void setCompressContent(boolean compressContent)Sets whether page content streams are compressed with Flate.- Parameters:
compressContent- true to compress page content streams
-
isCreateHyperlinks
public boolean isCreateHyperlinks()Gets whether hyperlinks are exported as clickable link annotations. Default is true.- Returns:
- true if link annotations are created
-
setCreateHyperlinks
public void setCreateHyperlinks(boolean createHyperlinks)Sets whether hyperlinks are exported as clickable link annotations.- Parameters:
createHyperlinks- true to create link annotations
-
isCreateOutlines
public boolean isCreateOutlines()Gets whether a document outline (bookmarks) is created from headings. Default is true.- Returns:
- true if an outline is created
-
setCreateOutlines
public void setCreateOutlines(boolean createOutlines)Sets whether a document outline (bookmarks) is created from headings.- Parameters:
createOutlines- true to create an outline
-
isEmbedFonts
public boolean isEmbedFonts()Gets whether TrueType fonts are embedded. When enabled, text is written with embedded Unicode fonts so characters outside the Latin-1 range are preserved. Default is false.- Returns:
- true if fonts are embedded
-
setEmbedFonts
public void setEmbedFonts(boolean embedFonts)Sets whether TrueType fonts are embedded.- Parameters:
embedFonts- true to embed fonts
-
isUseSystemFonts
public boolean isUseSystemFonts()Gets whether the operating system font directories are searched for fonts to embed. Default is true.- Returns:
- true if system font directories are searched
-
setUseSystemFonts
public void setUseSystemFonts(boolean useSystemFonts)Sets whether the operating system font directories are searched for fonts to embed.- Parameters:
useSystemFonts- true to search system font directories
-
getFontDirectories
Gets additional directories searched for TrueType fonts to embed.- Returns:
- the font directories
-
addFontDirectory
Adds a directory searched for TrueType fonts to embed.- Parameters:
directory- the directory path
-
registerFont
Registers a TrueType font file used when embedding fonts.- Parameters:
fontFamily- the font family name as used in the documentbold- true if the file contains the bold variantitalic- true if the file contains the italic variantfilePath- path of the .ttf/.ttc file
-
registerFont
Registers TrueType font data used when embedding fonts.- Parameters:
fontFamily- the font family name as used in the documentbold- true if the data contains the bold variantitalic- true if the data contains the italic variantfontData- the raw bytes of a .ttf/.ttc file
-
getRegisteredFonts
Gets the registered fonts.- Returns:
- the registered fonts
-
getTitle
Gets the document title written to the PDF Info dictionary, overriding the document property.- Returns:
- the title or null
-
setTitle
Sets the document title written to the PDF Info dictionary.- Parameters:
title- the title
-
getAuthor
Gets the author written to the PDF Info dictionary, overriding the document property.- Returns:
- the author or null
-
setAuthor
Sets the author written to the PDF Info dictionary.- Parameters:
author- the author
-
getSubject
Gets the subject written to the PDF Info dictionary, overriding the document property.- Returns:
- the subject or null
-
setSubject
Sets the subject written to the PDF Info dictionary.- Parameters:
subject- the subject
-
getKeywords
Gets the keywords written to the PDF Info dictionary, overriding the document property.- Returns:
- the keywords or null
-
setKeywords
Sets the keywords written to the PDF Info dictionary.- Parameters:
keywords- the keywords
-
getCreator
Gets the creator written to the PDF Info dictionary.- Returns:
- the creator or null
-
setCreator
Sets the creator written to the PDF Info dictionary.- Parameters:
creator- the creator
-