From 1040bc3ac6ca41901980ce6f768e0f2f3ba02398 Mon Sep 17 00:00:00 2001 From: yevgen-nykytenko Date: Mon, 4 Mar 2024 08:24:05 -0600 Subject: [PATCH] Update content 2024-03-04 08:24:05 --- .../cadoptions/_index.md | 25 ++++ .../emailoptions/_index.md | 29 ++++ .../htmlviewoptions/_index.md | 60 +++++++- .../loadoptions/_index.md | 133 ++++++++++++++++-- .../pdfviewoptions/_index.md | 67 +++++++++ .../spreadsheetoptions/_index.md | 100 +++++++++++++ .../watermark/_index.md | 29 ++++ .../com.groupdocs.viewer/filetype/_index.md | 69 +++++++++ 8 files changed, 498 insertions(+), 14 deletions(-) diff --git a/english/java/com.groupdocs.viewer.options/cadoptions/_index.md b/english/java/com.groupdocs.viewer.options/cadoptions/_index.md index 83efae998..52138b4f6 100644 --- a/english/java/com.groupdocs.viewer.options/cadoptions/_index.md +++ b/english/java/com.groupdocs.viewer.options/cadoptions/_index.md @@ -56,7 +56,9 @@ Example usage: | [getWidth()](#getWidth--) | Gets the width of the output result in pixels. | | [getHeight()](#getHeight--) | Gets the height of the output result in pixels. | | [getBackgroundColor()](#getBackgroundColor--) | Gets the background color of the image. | +| [getBackgroundColorAsHex()](#getBackgroundColorAsHex--) | Gets the background color of the image. | | [setBackgroundColor(Color backgroundColor)](#setBackgroundColor-java.awt.Color-) | Sets the background color of the image. | +| [setBackgroundColor(String colorName)](#setBackgroundColor-java.lang.String-) | Sets the background color of the image. | | [getTiles()](#getTiles--) | Gets the drawing regions to render. | | [setTiles(List value)](#setTiles-java.util.List-com.groupdocs.viewer.options.Tile--) | Sets the drawing regions to render. | | [isRenderLayouts()](#isRenderLayouts--) | Indicates whether layouts from the CAD document should be rendered. | @@ -205,6 +207,16 @@ Gets the background color of the image. **Returns:** java.awt.Color - the background color of the image. +### getBackgroundColorAsHex() {#getBackgroundColorAsHex--} +``` +public String getBackgroundColorAsHex() +``` + + +Gets the background color of the image. + +**Returns:** +java.lang.String - the background color of the image in 0xFFFFFF format. ### setBackgroundColor(Color backgroundColor) {#setBackgroundColor-java.awt.Color-} ``` public void setBackgroundColor(Color backgroundColor) @@ -218,6 +230,19 @@ Sets the background color of the image. | --- | --- | --- | | backgroundColor | java.awt.Color | The background color of the image. | +### setBackgroundColor(String colorName) {#setBackgroundColor-java.lang.String-} +``` +public void setBackgroundColor(String colorName) +``` + + +Sets the background color of the image. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| colorName | java.lang.String | The background color name of the image. | + ### getTiles() {#getTiles--} ``` public final List getTiles() diff --git a/english/java/com.groupdocs.viewer.options/emailoptions/_index.md b/english/java/com.groupdocs.viewer.options/emailoptions/_index.md index a7081fe7b..0387810b5 100644 --- a/english/java/com.groupdocs.viewer.options/emailoptions/_index.md +++ b/english/java/com.groupdocs.viewer.options/emailoptions/_index.md @@ -45,7 +45,9 @@ Example usage: | [getDateTimeFormat()](#getDateTimeFormat--) | Gets the time format for the date and time values. | | [setDateTimeFormat(String dateTimeFormat)](#setDateTimeFormat-java.lang.String-) | Gets the time format for the date and time values. | | [getTimeZoneOffset()](#getTimeZoneOffset--) | Gets the time zone offset for the message. | +| [getTimeZoneOffsetMinutes()](#getTimeZoneOffsetMinutes--) | Gets the time zone minutes offset minutes for the message. | | [setTimeZoneOffset(TimeZone timeZoneOffset)](#setTimeZoneOffset-java.util.TimeZone-) | Gets the time zone offset for the message. | +| [setTimeZoneOffset(int offsetMinutes)](#setTimeZoneOffset-int-) | Gets the time zone offset minutes offset for the message. | | [getPageSize()](#getPageSize--) | Gets the size of the output page. | | [setPageSize(PageSize value)](#setPageSize-com.groupdocs.viewer.options.PageSize-) | Gets the size of the output page. | | [getFieldTextMap()](#getFieldTextMap--) | Retrieves the mapping between email message fields and their text representations. | @@ -101,6 +103,18 @@ Gets the time zone offset for the message. **Returns:** java.util.TimeZone - the time zone offset. +### getTimeZoneOffsetMinutes() {#getTimeZoneOffsetMinutes--} +``` +public int getTimeZoneOffsetMinutes() +``` + + +Gets the time zone minutes offset minutes for the message. + +**Note:** The time zone offset minutes represents the minutes difference between the message's time and Coordinated Universal Time (UTC). + +**Returns:** +int - the time zone offset. ### setTimeZoneOffset(TimeZone timeZoneOffset) {#setTimeZoneOffset-java.util.TimeZone-} ``` public void setTimeZoneOffset(TimeZone timeZoneOffset) @@ -116,6 +130,21 @@ Gets the time zone offset for the message. | --- | --- | --- | | timeZoneOffset | java.util.TimeZone | The time zone offset. | +### setTimeZoneOffset(int offsetMinutes) {#setTimeZoneOffset-int-} +``` +public void setTimeZoneOffset(int offsetMinutes) +``` + + +Gets the time zone offset minutes offset for the message. + +**Note:** The time zone minutes offset represents the time difference between the message's time and Coordinated Universal Time (UTC). + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| offsetMinutes | int | The time zone offset. | + ### getPageSize() {#getPageSize--} ``` public final PageSize getPageSize() diff --git a/english/java/com.groupdocs.viewer.options/htmlviewoptions/_index.md b/english/java/com.groupdocs.viewer.options/htmlviewoptions/_index.md index aa7b94872..409fcdaf6 100644 --- a/english/java/com.groupdocs.viewer.options/htmlviewoptions/_index.md +++ b/english/java/com.groupdocs.viewer.options/htmlviewoptions/_index.md @@ -63,8 +63,8 @@ Example usage: | [setRenderResponsive(boolean value)](#setRenderResponsive-boolean-) | Sets whether responsive rendering is enabled. | | [isMinify()](#isMinify--) | Checks if HTML content and HTML resources minification is enabled. | | [setMinify(boolean value)](#setMinify-boolean-) | Sets whether HTML content and HTML resources minification is enabled. | -| [setRenderToSinglePage(boolean renderSinglePage)](#setRenderToSinglePage-boolean-) | Sets whether HTML content will be rendered to a single page. | -| [isRenderToSinglePage()](#isRenderToSinglePage--) | Determines whether HTML content will be rendered to a single page. | +| [setRenderToSinglePage(boolean renderSinglePage)](#setRenderToSinglePage-boolean-) | Enables rendering an entire document to one HTML file. | +| [isRenderToSinglePage()](#isRenderToSinglePage--) | Enables rendering an entire document to one HTML file. | | [isExcludeFonts()](#isExcludeFonts--) | Determines whether to exclude fonts from the HTML document. | | [setExcludeFonts(boolean value)](#setExcludeFonts-boolean-) | Sets whether to exclude fonts from the HTML document. | | [getFontsToExclude()](#getFontsToExclude--) | Retrieves the list of font names to exclude from the HTML document. | @@ -416,12 +416,36 @@ public void setRenderToSinglePage(boolean renderSinglePage) ``` -Sets whether HTML content will be rendered to a single page. +Enables rendering an entire document to one HTML file. + +**See the following topics for more information:** + + * [Render archives as HTML, PDF, and image files][Render archives as HTML_ PDF_ and image files] + * [Render text documents as HTML, PDF, and image files][Render text documents as HTML_ PDF_ and image files] + * [Render Excel and Apple Numbers spreadsheets as HTML, PDF, and image files][Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files] + * [Render web documents as PDF, PNG, and JPEG files][Render web documents as PDF_ PNG_ and JPEG files] + +**Example:** + +``` +try (final Viewer viewer = new Viewer("invoice.docx")) { + HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(); + viewOptions.setRenderToSinglePage(true); + + viewer.view(viewOptions); + } +``` + + +[Render archives as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-archive-files/#create-a-single-html-page +[Render text documents as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-text-files/#create-a-single-html-page +[Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/#convert-all-excel-worksheets-to-one-html-file +[Render web documents as PDF_ PNG_ and JPEG files]: https://docs.groupdocs.com/viewer/java/render-web-documents/#create-an-html-file-with-embedded-resources **Parameters:** | Parameter | Type | Description | | --- | --- | --- | -| renderSinglePage | boolean | true if HTML content should be rendered to a single page, false otherwise. | +| renderSinglePage | boolean | | ### isRenderToSinglePage() {#isRenderToSinglePage--} ``` @@ -429,10 +453,34 @@ public boolean isRenderToSinglePage() ``` -Determines whether HTML content will be rendered to a single page. +Enables rendering an entire document to one HTML file. + +**See the following topics for more information:** + + * [Render archives as HTML, PDF, and image files][Render archives as HTML_ PDF_ and image files] + * [Render text documents as HTML, PDF, and image files][Render text documents as HTML_ PDF_ and image files] + * [Render Excel and Apple Numbers spreadsheets as HTML, PDF, and image files][Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files] + * [Render web documents as PDF, PNG, and JPEG files][Render web documents as PDF_ PNG_ and JPEG files] + +**Example:** + +``` +try (final Viewer viewer = new Viewer("invoice.docx")) { + HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(); + viewOptions.setRenderToSinglePage(true); + + viewer.view(viewOptions); + } +``` + + +[Render archives as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-archive-files/#create-a-single-html-page +[Render text documents as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-text-files/#create-a-single-html-page +[Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/#convert-all-excel-worksheets-to-one-html-file +[Render web documents as PDF_ PNG_ and JPEG files]: https://docs.groupdocs.com/viewer/java/render-web-documents/#create-an-html-file-with-embedded-resources **Returns:** -boolean - true if HTML content will be rendered to a single page, false otherwise. +boolean ### isExcludeFonts() {#isExcludeFonts--} ``` public final boolean isExcludeFonts() diff --git a/english/java/com.groupdocs.viewer.options/loadoptions/_index.md b/english/java/com.groupdocs.viewer.options/loadoptions/_index.md index 64ba9cd63..49259973f 100644 --- a/english/java/com.groupdocs.viewer.options/loadoptions/_index.md +++ b/english/java/com.groupdocs.viewer.options/loadoptions/_index.md @@ -50,8 +50,10 @@ Example usage: | [setFileType(FileType value)](#setFileType-com.groupdocs.viewer.FileType-) | Sets the type of the file to open. | | [getPassword()](#getPassword--) | Gets the password for opening an encrypted file. | | [setPassword(String value)](#setPassword-java.lang.String-) | Sets the password for opening an encrypted file. | -| [getCharset()](#getCharset--) | Gets the charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). | -| [setCharset(Charset value)](#setCharset-java.nio.charset.Charset-) | Sets the charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). | +| [getCharset()](#getCharset--) | The charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). | +| [setCharset(Charset value)](#setCharset-java.nio.charset.Charset-) | The charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). | +| [isDetectCharset()](#isDetectCharset--) | This option enables [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), [FileType.TSV](../../com.groupdocs.viewer/filetype\#TSV), and [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV) files charset detection. | +| [setDetectCharset(boolean detectCharset)](#setDetectCharset-boolean-) | This option enables [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), [FileType.TSV](../../com.groupdocs.viewer/filetype\#TSV), and [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV) files charset detection. | | [getResourceLoadingTimeout()](#getResourceLoadingTimeout--) | Gets the timeout for loading external resources, such as graphics. | | [setResourceLoadingTimeout(int resourceLoadingTimeout)](#setResourceLoadingTimeout-int-) | Sets the timeout for loading external resources, such as graphics. | | [getUrlConnectTimeout()](#getUrlConnectTimeout--) | Gets the connection timeout for creating a [Viewer](../../com.groupdocs.viewer/viewer) using java.net.URL to load a document. | @@ -145,26 +147,141 @@ public final Charset getCharset() ``` -Gets the charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). +The charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). -***Note:** The default value is Charset\#defaultCharset().defaultCharset().* +Default value is java.nio.charset.StandardCharsets\#UTF\_8.UTF\_8. + +**Learn more** + + * [Render Excel and Apple Numbers spreadsheets as HTML, PDF, and image files][Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files] + * [Render text documents as HTML, PDF, and image files][Render text documents as HTML_ PDF_ and image files] + * [Render email messages as HTML, PDF, PNG, and JPEG files][Render email messages as HTML_ PDF_ PNG_ and JPEG files] + +**Example:** + +``` +LoadOptions loadOptions = new LoadOptions(); + loadOptions.setCharset(StandardCharsets.US_ASCII); // Set the charset + + try (Viewer viewer = new Viewer("message.txt", loadOptions)) { + HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(); + + viewer.view(viewOptions); + } +``` + + +[Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/ +[Render text documents as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-text-files +[Render email messages as HTML_ PDF_ PNG_ and JPEG files]: https://docs.groupdocs.com/viewer/java/render-email-messages/ **Returns:** -java.nio.charset.Charset - the charset used for opening text-based files or email messages. +java.nio.charset.Charset ### setCharset(Charset value) {#setCharset-java.nio.charset.Charset-} ``` public final void setCharset(Charset value) ``` -Sets the charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). +The charset used when opening text-based files or email messages such as [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV), [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), and [FileType.MSG](../../com.groupdocs.viewer/filetype\#MSG). + +Default value is java.nio.charset.StandardCharsets\#UTF\_8.UTF\_8. + +**Learn more** + + * [Render Excel and Apple Numbers spreadsheets as HTML, PDF, and image files][Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files] + * [Render text documents as HTML, PDF, and image files][Render text documents as HTML_ PDF_ and image files] + * [Render email messages as HTML, PDF, PNG, and JPEG files][Render email messages as HTML_ PDF_ PNG_ and JPEG files] + +**Example:** + +``` +LoadOptions loadOptions = new LoadOptions(); + loadOptions.setCharset(StandardCharsets.US_ASCII); // Set the charset + + try (Viewer viewer = new Viewer("message.txt", loadOptions)) { + HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(); + + viewer.view(viewOptions); + } +``` + + +[Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/ +[Render text documents as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-text-files +[Render email messages as HTML_ PDF_ PNG_ and JPEG files]: https://docs.groupdocs.com/viewer/java/render-email-messages/ + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| value | java.nio.charset.Charset | | + +### isDetectCharset() {#isDetectCharset--} +``` +public boolean isDetectCharset() +``` + + +This option enables [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), [FileType.TSV](../../com.groupdocs.viewer/filetype\#TSV), and [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV) files charset detection. In case the charset can't be detected the default [getCharset()](../../com.groupdocs.viewer.options/loadoptions\#getCharset--) is used. + +**Learn more about rendering text and tab/comma delimited files** + + * [Render text documents as HTML, PDF, and image files][Render text documents as HTML_ PDF_ and image files] + * [Render Excel and Apple Numbers spreadsheets as HTML, PDF, and image files][Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files] + +**Example:** + +``` +LoadOptions loadOptions = new LoadOptions(); + loadOptions.setDetectCharset(true); // Enable encoding detection + + try (Viewer viewer = new Viewer("employees.csv", loadOptions)) { + HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(); + + viewer.view(viewOptions); + } +``` + + +[Render text documents as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-text-files/ +[Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/ + +**Returns:** +boolean +### setDetectCharset(boolean detectCharset) {#setDetectCharset-boolean-} +``` +public void setDetectCharset(boolean detectCharset) +``` + + +This option enables [FileType.TXT](../../com.groupdocs.viewer/filetype\#TXT), [FileType.TSV](../../com.groupdocs.viewer/filetype\#TSV), and [FileType.CSV](../../com.groupdocs.viewer/filetype\#CSV) files charset detection. In case the charset can't be detected the default [getCharset()](../../com.groupdocs.viewer.options/loadoptions\#getCharset--) is used. + +**Learn more about rendering text and tab/comma delimited files** + + * [Render text documents as HTML, PDF, and image files][Render text documents as HTML_ PDF_ and image files] + * [Render Excel and Apple Numbers spreadsheets as HTML, PDF, and image files][Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files] + +**Example:** + +``` +LoadOptions loadOptions = new LoadOptions(); + loadOptions.setDetectCharset(true); // Enable encoding detection + + try (Viewer viewer = new Viewer("employees.csv", loadOptions)) { + HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(); + + viewer.view(viewOptions); + } +``` + -***Note:** The default value is Charset\#defaultCharset().defaultCharset().* +[Render text documents as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-text-files/ +[Render Excel and Apple Numbers spreadsheets as HTML_ PDF_ and image files]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/ **Parameters:** | Parameter | Type | Description | | --- | --- | --- | -| value | java.nio.charset.Charset | The charset used for opening text-based files or email messages. | +| detectCharset | boolean | | ### getResourceLoadingTimeout() {#getResourceLoadingTimeout--} ``` diff --git a/english/java/com.groupdocs.viewer.options/pdfviewoptions/_index.md b/english/java/com.groupdocs.viewer.options/pdfviewoptions/_index.md index 1a273faab..74ebb5ee7 100644 --- a/english/java/com.groupdocs.viewer.options/pdfviewoptions/_index.md +++ b/english/java/com.groupdocs.viewer.options/pdfviewoptions/_index.md @@ -57,6 +57,8 @@ Example usage: | [setImageHeight(int imageHeight)](#setImageHeight-int-) | Sets the height of the output image in pixels. | | [getSecurity()](#getSecurity--) | Retrieves the security options for the output PDF document. | | [setSecurity(Security value)](#setSecurity-com.groupdocs.viewer.options.Security-) | Sets the security options for the output PDF document. | +| [isOptimize()](#isOptimize--) | Reduce output file size by excluding common fonts like Times New Roman and Arial, and applying other optimization techniques. | +| [setOptimize(boolean optimize)](#setOptimize-boolean-) | Reduce output file size by excluding common fonts like Times New Roman and Arial, and applying other optimization techniques. | | [getDocumentSavingCallback()](#getDocumentSavingCallback--) | Retrieves the callback used to estimate the progress of saving a Words or Email document. | | [setDocumentSavingCallback(IDocumentSavingCallback documentSavingCallback)](#setDocumentSavingCallback-com.groupdocs.viewer.domain.documents.converting.tohtml.utils.IDocumentSavingCallback-) | Sets the callback used to estimate the progress of saving a Words or Email document. | ### PdfViewOptions(CreateFileStream createFileStream) {#PdfViewOptions-com.groupdocs.viewer.interfaces.CreateFileStream-} @@ -279,6 +281,71 @@ Sets the security options for the output PDF document. | --- | --- | --- | | value | [Security](../../com.groupdocs.viewer.options/security) | The security options for the output PDF document. | +### isOptimize() {#isOptimize--} +``` +public boolean isOptimize() +``` + + +Reduce output file size by excluding common fonts like Times New Roman and Arial, and applying other optimization techniques. + +In version 24.2 this option is supported for [Spreadsheet file formats][] only. + +Learn more how to export Excel and Apple Numbers spreadsheets to PDF + + * [Render spreadsheets as PDF][] + +**Example:** + +``` +try (Viewer viewer = new Viewer("employees.xlsx")) { + PdfViewOptions viewOptions = new PdfViewOptions(); + viewOptions.setOptimize(true); + + viewer.view(viewOptions); + } +``` + + +[Spreadsheet file formats]: https://docs.groupdocs.com/viewer/java/supported-document-formats/#spreadsheet-file-formats +[Render spreadsheets as PDF]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/#render-spreadsheets-as-pdf + +**Returns:** +boolean +### setOptimize(boolean optimize) {#setOptimize-boolean-} +``` +public void setOptimize(boolean optimize) +``` + + +Reduce output file size by excluding common fonts like Times New Roman and Arial, and applying other optimization techniques. + +In version 24.2 this option is supported for [Spreadsheet file formats][] only. + +Learn more how to export Excel and Apple Numbers spreadsheets to PDF + + * [Render spreadsheets as PDF][] + +**Example:** + +``` +try (Viewer viewer = new Viewer("employees.xlsx")) { + PdfViewOptions viewOptions = new PdfViewOptions(); + viewOptions.setOptimize(true); + + viewer.view(viewOptions); + } +``` + + +[Spreadsheet file formats]: https://docs.groupdocs.com/viewer/java/supported-document-formats/#spreadsheet-file-formats +[Render spreadsheets as PDF]: https://docs.groupdocs.com/viewer/java/render-excel-and-apple-numbers-spreadsheets/#render-spreadsheets-as-pdf + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| optimize | boolean | | + ### getDocumentSavingCallback() {#getDocumentSavingCallback--} ``` public IDocumentSavingCallback getDocumentSavingCallback() diff --git a/english/java/com.groupdocs.viewer.options/spreadsheetoptions/_index.md b/english/java/com.groupdocs.viewer.options/spreadsheetoptions/_index.md index 727b1b4b3..1b96f7fdb 100644 --- a/english/java/com.groupdocs.viewer.options/spreadsheetoptions/_index.md +++ b/english/java/com.groupdocs.viewer.options/spreadsheetoptions/_index.md @@ -62,6 +62,14 @@ Example usage: | [setRenderHiddenColumns(boolean value)](#setRenderHiddenColumns-boolean-) | Enables hidden columns rendering. | | [getTextOverflowMode()](#getTextOverflowMode--) | Returns the text overflow mode for rendering spreadsheet documents into HTML. | | [setTextOverflowMode(TextOverflowMode value)](#setTextOverflowMode-com.groupdocs.viewer.options.TextOverflowMode-) | Sets the text overflow mode for rendering spreadsheet documents into HTML. | +| [getLeftMargin()](#getLeftMargin--) | To set left margin of the worksheet when converting to pdf if less than 0 then default convert value is used | +| [setLeftMargin(double leftMargin)](#setLeftMargin-double-) | To set left margin of the worksheet when converting to pdf if less than 0 then default convert value is used | +| [getRightMargin()](#getRightMargin--) | To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used | +| [setRightMargin(double rightMargin)](#setRightMargin-double-) | To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used | +| [getTopMargin()](#getTopMargin--) | To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used | +| [setTopMargin(double topMargin)](#setTopMargin-double-) | To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used | +| [getBottomMargin()](#getBottomMargin--) | To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used | +| [setBottomMargin(double bottomMargin)](#setBottomMargin-double-) | To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used | | [forRenderingByPageBreaks()](#forRenderingByPageBreaks--) | Initializes a new instance of the SpreadsheetOptions class for rendering print areas only. | ### isRenderByPageBreaks() {#isRenderByPageBreaks--} ``` @@ -378,6 +386,98 @@ Sets the text overflow mode for rendering spreadsheet documents into HTML. | --- | --- | --- | | value | [TextOverflowMode](../../com.groupdocs.viewer.options/textoverflowmode) | The text overflow mode to be set. | +### getLeftMargin() {#getLeftMargin--} +``` +public double getLeftMargin() +``` + + +To set left margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Returns:** +double +### setLeftMargin(double leftMargin) {#setLeftMargin-double-} +``` +public void setLeftMargin(double leftMargin) +``` + + +To set left margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| leftMargin | double | | + +### getRightMargin() {#getRightMargin--} +``` +public double getRightMargin() +``` + + +To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Returns:** +double +### setRightMargin(double rightMargin) {#setRightMargin-double-} +``` +public void setRightMargin(double rightMargin) +``` + + +To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| rightMargin | double | | + +### getTopMargin() {#getTopMargin--} +``` +public double getTopMargin() +``` + + +To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Returns:** +double +### setTopMargin(double topMargin) {#setTopMargin-double-} +``` +public void setTopMargin(double topMargin) +``` + + +To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| topMargin | double | | + +### getBottomMargin() {#getBottomMargin--} +``` +public double getBottomMargin() +``` + + +To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Returns:** +double +### setBottomMargin(double bottomMargin) {#setBottomMargin-double-} +``` +public void setBottomMargin(double bottomMargin) +``` + + +To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| bottomMargin | double | | + ### forRenderingByPageBreaks() {#forRenderingByPageBreaks--} ``` public static SpreadsheetOptions forRenderingByPageBreaks() diff --git a/english/java/com.groupdocs.viewer.options/watermark/_index.md b/english/java/com.groupdocs.viewer.options/watermark/_index.md index 2f8e3640d..8feb2b3ff 100644 --- a/english/java/com.groupdocs.viewer.options/watermark/_index.md +++ b/english/java/com.groupdocs.viewer.options/watermark/_index.md @@ -45,7 +45,9 @@ Example usage: | --- | --- | | [getText()](#getText--) | Returns the watermark text. | | [getColor()](#getColor--) | Returns the watermark color. | +| [getColorAsHex()](#getColorAsHex--) | Returns the watermark color in hex format. | | [setColor(Color value)](#setColor-java.awt.Color-) | Sets the watermark color. | +| [setColor(String colorName)](#setColor-java.lang.String-) | Sets the watermark color. | | [getPosition()](#getPosition--) | Returns the watermark position. | | [setPosition(Position value)](#setPosition-com.groupdocs.viewer.options.Position-) | Sets the watermark position. | | [getSize()](#getSize--) | Returns the watermark size. | @@ -87,6 +89,18 @@ Returns the watermark color. This method retrieves the color of the watermark ap **Returns:** java.awt.Color - the watermark color. +### getColorAsHex() {#getColorAsHex--} +``` +public final String getColorAsHex() +``` + + +Returns the watermark color in hex format. This method retrieves the color of the watermark applied to the document. + +***Note:** The default value is the red color obtained from Color\#getRed().getRed().* + +**Returns:** +java.lang.String - the watermark color in hex format. ### setColor(Color value) {#setColor-java.awt.Color-} ``` public final void setColor(Color value) @@ -102,6 +116,21 @@ Sets the watermark color. This method sets the color of the watermark applied to | --- | --- | --- | | value | java.awt.Color | The watermark color to set. | +### setColor(String colorName) {#setColor-java.lang.String-} +``` +public final void setColor(String colorName) +``` + + +Sets the watermark color. This method sets the color of the watermark applied to the document. + +***Note:** The default value is obtained from Color\#getRed().getRed().* + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| colorName | java.lang.String | The watermark color to set. | + ### getPosition() {#getPosition--} ``` public final Position getPosition() diff --git a/english/java/com.groupdocs.viewer/filetype/_index.md b/english/java/com.groupdocs.viewer/filetype/_index.md index 5ca71d2f0..49d2e0ceb 100644 --- a/english/java/com.groupdocs.viewer/filetype/_index.md +++ b/english/java/com.groupdocs.viewer/filetype/_index.md @@ -52,6 +52,7 @@ Example usage: | [GZ](#GZ) | Represents a Gnu Zipped File (.gz) compressed file created with the gzip compression application. | | [GZIP](#GZIP) | Represents a Gnu Zipped File (.gzip) compressed file introduced as a free utility for replacing the Compress program used in Unix systems. | | [SEVEN_ZIP](#SEVEN-ZIP) | Represents a 7Zip (.7z, .7zip) file, which is a free open-source archiver with LZMA and LZMA2 compression. | +| [CPIO](#CPIO) | Cpio is a general file archiver utility and its associated file format. | | [DXF](#DXF) | Represents a Drawing Exchange Format File (.dxf), which is a tagged data representation of an AutoCAD drawing file. | | [DWG](#DWG) | Represents an AutoCAD Drawing Database File (.dwg), which represents proprietary binary files used for containing 2D and 3D design data. | | [DWT](#DWT) | Represents an AutoCAD Drawing Template (.dwt), which is an AutoCAD drawing template file used as a starter for creating drawings that can be saved as DWG files. | @@ -81,6 +82,7 @@ Example usage: | [VDX](#VDX) | Represents a Visio Drawing XML File (.vdx), which represents any drawing or chart created in Microsoft Visio but saved in XML format with the .VDX extension. | | [EPUB](#EPUB) | Represents an Open eBook File (.epub), which is an e-book file format that provides a standard digital publication format for publishers and consumers. | | [MOBI](#MOBI) | Represents a Mobipocket eBook (.mobi), which is one of the most widely used ebook file formats. | +| [AZW_3](#AZW-3) | Amazon Kindle Format 8 (KF8) ebook is the digital file format developed for Amazon Kindle devices. | | [MSG](#MSG) | Represents an Outlook Mail Message (.msg), which is a file format used by Microsoft Outlook and Exchange to store email messages, contacts, appointments, or other tasks. | | [EML](#EML) | Represents an E-Mail Message (.eml), which represents email messages saved using Outlook and other relevant applications. | | [EMLX](#EMLX) | Represents an Apple Mail Message (.emlx), which is implemented and developed by Apple. | @@ -242,6 +244,8 @@ Example usage: | [fromStream(InputStream stream, ILogger logger)](#fromStream-java.io.InputStream-com.groupdocs.foundation.logging.ILogger-) | Detects the file type by reading the file signature. | | [fromStream(InputStream stream, String password, ILogger logger)](#fromStream-java.io.InputStream-java.lang.String-com.groupdocs.foundation.logging.ILogger-) | Detects the file type by reading the file signature. | | [getSupportedFileTypes()](#getSupportedFileTypes--) | Retrieves the supported file types. | +| [detectCharset(String filePath)](#detectCharset-java.lang.String-) | Attempts to detect text [TXT](../../com.groupdocs.viewer/filetype\#TXT), [TSV](../../com.groupdocs.viewer/filetype\#TSV), and [CSV](../../com.groupdocs.viewer/filetype\#CSV) files charset by path. | +| [detectCharset(InputStream stream)](#detectCharset-java.io.InputStream-) | Attempts to detect text [TXT](../../com.groupdocs.viewer/filetype\#TXT), [TSV](../../com.groupdocs.viewer/filetype\#TSV), and [CSV](../../com.groupdocs.viewer/filetype\#CSV) file charset by stream. | | [getFileFormat()](#getFileFormat--) | Gets the name of the file format, e.g., "Microsoft Word Document". | | [getExtension()](#getExtension--) | Gets the file extension suffix (including the period "."), e.g., ".doc". | | [toString()](#toString--) | Returns a string representation of the current object. | @@ -385,6 +389,17 @@ Represents a 7Zip (.7z, .7zip) file, which is a free open-source archiver with L [here]: https://docs.fileformat.com/compression/7z/ +### CPIO {#CPIO} +``` +public static final FileType CPIO +``` + + +Cpio is a general file archiver utility and its associated file format. It is primarily installed on Unix-like computer operating systems. Learn more about this file format [here][]. + + +[here]: https://wiki.fileformat.com/compression/cpio + ### DXF {#DXF} ``` public static final FileType DXF @@ -701,6 +716,17 @@ Represents a Mobipocket eBook (.mobi), which is one of the most widely used eboo [here]: https://wiki.fileformat.com/ebook/mobi +### AZW_3 {#AZW-3} +``` +public static final FileType AZW_3 +``` + + +Amazon Kindle Format 8 (KF8) ebook is the digital file format developed for Amazon Kindle devices. The format is an enhancement to older AZW files and is used on Kindle Fire devices only with backward compatibility for the ancestor file format i.e. MOBI and AZW. Learn more about this file format [here][]. + + +[here]: https://wiki.fileformat.com/ebook/azw3 + ### MSG {#MSG} ``` public static final FileType MSG @@ -2493,6 +2519,49 @@ This method returns a sequence of all the supported file types by the system. Th **Returns:** java.util.List - a sequence of supported file types. +### detectCharset(String filePath) {#detectCharset-java.lang.String-} +``` +public static Charset detectCharset(String filePath) +``` + + +Attempts to detect text [TXT](../../com.groupdocs.viewer/filetype\#TXT), [TSV](../../com.groupdocs.viewer/filetype\#TSV), and [CSV](../../com.groupdocs.viewer/filetype\#CSV) files charset by path. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| filePath | java.lang.String | The file name or file path. | + +**Returns:** +java.nio.charset.Charset - Charset or null when fails to detect a file charset. + +**Example:** + +``` +Charset charset = FileType.detectCharset("message.txt"); +``` +### detectCharset(InputStream stream) {#detectCharset-java.io.InputStream-} +``` +public static Charset detectCharset(InputStream stream) +``` + + +Attempts to detect text [TXT](../../com.groupdocs.viewer/filetype\#TXT), [TSV](../../com.groupdocs.viewer/filetype\#TSV), and [CSV](../../com.groupdocs.viewer/filetype\#CSV) file charset by stream. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| stream | java.io.InputStream | The file stream. | + +**Returns:** +java.nio.charset.Charset - Charset or null when fails to detect a file charset. + +**Example:** + +``` +InputStream stream = new FileInputStream("message.txt"); + Charset charset = FileType.detectCharset(stream); +``` ### getFileFormat() {#getFileFormat--} ``` public final String getFileFormat()