Skip to content

Commit bbaf7ce

Browse files
committed
Merge branch 'main' into production
2 parents 724454a + 306552d commit bbaf7ce

File tree

442 files changed

+1355
-457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

442 files changed

+1355
-457
lines changed

english/java/com.aspose.words/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ The **MailMerge** object which provides access to the reporting functionality is
377377
| [GlossaryDocument](../com.aspose.words/glossarydocument/) | Represents the root element for a glossary document within a Word document. |
378378
| [GlowFormat](../com.aspose.words/glowformat/) | Represents the glow formatting for an object. |
379379
| [Glyph](../com.aspose.words/glyph/) | Represents a glyph |
380+
| [GlyphFlags](../com.aspose.words/glyphflags/) | |
380381
| [GoogleAiModel](../com.aspose.words/googleaimodel/) | An abstract class representing the integration with Google\\u2019s AI models within the Aspose.Words. |
381382
| [GradientStop](../com.aspose.words/gradientstop/) | Represents one gradient stop. |
382383
| [GradientStopCollection](../com.aspose.words/gradientstopcollection/) | Contains a collection of [GradientStop](../com.aspose.words/gradientstop/) objects. |
@@ -527,6 +528,7 @@ The **MailMerge** object which provides access to the reporting functionality is
527528
| [OutlineOptions](../com.aspose.words/outlineoptions/) | Allows to specify outline options. |
528529
| [PageBorderAppliesTo](../com.aspose.words/pageborderappliesto/) | Specifies which pages the page border is printed on. |
529530
| [PageBorderDistanceFrom](../com.aspose.words/pageborderdistancefrom/) | Specifies the positioning of the page border relative to the page margin. |
531+
| [PageExtractOptions](../com.aspose.words/pageextractoptions/) | Allows to specify options for document page extracting. |
530532
| [PageInfo](../com.aspose.words/pageinfo/) | Represents information about a particular document page. |
531533
| [PageLayoutCallbackArgs](../com.aspose.words/pagelayoutcallbackargs/) | An argument passed into [IPageLayoutCallback.\#notify(com.aspose.words.PageLayoutCallbackArgs)](../com.aspose.words/ipagelayoutcallback/\#notify-com.aspose.words.PageLayoutCallbackArgs) |
532534
| [PageLayoutEvent](../com.aspose.words/pagelayoutevent/) | A code of event raised during page layout model build and rendering. |
@@ -711,6 +713,7 @@ The **MailMerge** object which provides access to the reporting functionality is
711713
| [TxtTrailingSpacesOptions](../com.aspose.words/txttrailingspacesoptions/) | Specifies available options for trailing spaces handling during import from [LoadFormat.\#TEXT](../com.aspose.words/loadformat/\#TEXT) file. |
712714
| [Underline](../com.aspose.words/underline/) | Indicates type of the underline applied to a font. |
713715
| [UnicodeScript](../com.aspose.words/unicodescript/) | Unicode Character Database property: Script (sc). |
716+
| [UnsupportedEncryptionException](../com.aspose.words/unsupportedencryptionexception/) | Thrown during document load, when the document is encrypted with an unsupported method. |
714717
| [UnsupportedFileFormatException](../com.aspose.words/unsupportedfileformatexception/) | Thrown during document load, when the document format is not recognized or not supported by Aspose.Words. |
715718
| [UserInformation](../com.aspose.words/userinformation/) | Specifies information about the user. |
716719
| [VariableCollection](../com.aspose.words/variablecollection/) | A collection of document variables. |

english/java/com.aspose.words/absolutepositiontab/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ public boolean isComposite()
11261126
```
11271127

11281128

1129-
Returns true if this node can contain other nodes. (194242,6)
1129+
Returns true if this node can contain other nodes. (194825,6)
11301130

11311131
**Examples:**
11321132

english/java/com.aspose.words/asposewordsprintdocument/_index.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,57 @@ A single Aspose.Words document can consist of multiple sections that specify pag
2929

3030
On the other hand, if the document consists of a single section only, the developer can use [AsposeWordsPrintDocument](../../com.aspose.words/asposewordsprintdocument/) as **java.awt.print.Printable** to improve printing performance.
3131

32+
**Examples:**
33+
34+
Shows how to monitor printing progress.
35+
36+
```
37+
38+
Document doc = new Document(getMyDir() + "Rendering.docx");
39+
40+
// Create a special Aspose.Words implementation of the Java PrintDocument class
41+
AsposeWordsPrintDocument printDoc = new AsposeWordsPrintDocument(doc);
42+
43+
// In Java, printer settings are handled through PrinterJob.
44+
PrinterJob printerJob = PrinterJob.getPrinterJob();
45+
printerJob.setPrintable(printDoc);
46+
47+
// Initialize the custom printing tracker.
48+
PrintTracker printTracker = new PrintTracker(printDoc);
49+
50+
printerJob.print();
51+
52+
// Write the event log.
53+
for (String eventString : printTracker.getEventLog()) {
54+
System.out.println(eventString);
55+
}
56+
57+
```
58+
59+
Shows an example class for monitoring the progress of printing.
60+
61+
```
62+
{@code
63+
///
64+
/// Tracks printing progress of an Aspose.Words document and logs printing events.
65+
///
66+
/**
67+
Tracks printing progress of an Aspose.Words document and logs printing events.
68+
Note: Java version doesn't have the same event system as .NET, so this implementation
69+
wraps the AsposeWordsPrintDocument to provide similar functionality.
70+
/
71+
class PrintTracker implements Printable {
72+
private final AsposeWordsPrintDocument printDocument;
73+
private int printingPage = -1;
74+
private int totalPages = 0;
75+
private final List eventLog = new ArrayList<>();
76+
private boolean isPrinting = false;
77+
78+
/**
79+
Initializes a new instance of the PrintTracker class
80+
and wraps the specified Aspose.Words print document.
81+
```
82+
3283

3384
[Printing a Document Programmatically or Using Dialogs]: https://docs.aspose.com/words/java/print-a-document-programmatically-or-using-dialogs/
3485
## Constructors
@@ -44,6 +95,7 @@ On the other hand, if the document consists of a single section only, the develo
4495
| [getColorPagesPrinted()](#getColorPagesPrinted) | Gets the number of pages printed in color (i.e. |
4596
| [getNumberOfPages()](#getNumberOfPages) | |
4697
| [getPageFormat(int pageIndex)](#getPageFormat-int) | |
98+
| [getPagesRemaining()](#getPagesRemaining) | Gets the number of pages remaining in the currently active print job. |
4799
| [getPrintable(int pageIndex)](#getPrintable-int) | |
48100
| [print(Graphics graphics, PageFormat pageFormat, int pageIndex)](#print-java.awt.Graphics-java.awt.print.PageFormat-int) | |
49101
| [setColorMode(int value)](#setColorMode-int) | Sets how non-colored pages are printed if the device supports color printing. |
@@ -109,6 +161,71 @@ public PageFormat getPageFormat(int pageIndex)
109161

110162
**Returns:**
111163
java.awt.print.PageFormat
164+
### getPagesRemaining() {#getPagesRemaining}
165+
```
166+
public int getPagesRemaining()
167+
```
168+
169+
170+
Gets the number of pages remaining in the currently active print job.
171+
172+
**Remarks:**
173+
174+
This value is updated automatically as pages are printed, reflecting the current print job's progress. Outside of print time and in case of print job errors or interruptions, the value may not reflect the actual number of pages pending.
175+
176+
**Examples:**
177+
178+
Shows how to monitor printing progress.
179+
180+
```
181+
182+
Document doc = new Document(getMyDir() + "Rendering.docx");
183+
184+
// Create a special Aspose.Words implementation of the Java PrintDocument class
185+
AsposeWordsPrintDocument printDoc = new AsposeWordsPrintDocument(doc);
186+
187+
// In Java, printer settings are handled through PrinterJob.
188+
PrinterJob printerJob = PrinterJob.getPrinterJob();
189+
printerJob.setPrintable(printDoc);
190+
191+
// Initialize the custom printing tracker.
192+
PrintTracker printTracker = new PrintTracker(printDoc);
193+
194+
printerJob.print();
195+
196+
// Write the event log.
197+
for (String eventString : printTracker.getEventLog()) {
198+
System.out.println(eventString);
199+
}
200+
201+
```
202+
203+
Shows an example class for monitoring the progress of printing.
204+
205+
```
206+
{@code
207+
///
208+
/// Tracks printing progress of an Aspose.Words document and logs printing events.
209+
///
210+
/**
211+
Tracks printing progress of an Aspose.Words document and logs printing events.
212+
Note: Java version doesn't have the same event system as .NET, so this implementation
213+
wraps the AsposeWordsPrintDocument to provide similar functionality.
214+
/
215+
class PrintTracker implements Printable {
216+
private final AsposeWordsPrintDocument printDocument;
217+
private int printingPage = -1;
218+
private int totalPages = 0;
219+
private final List eventLog = new ArrayList<>();
220+
private boolean isPrinting = false;
221+
222+
/**
223+
Initializes a new instance of the PrintTracker class
224+
and wraps the specified Aspose.Words print document.
225+
```
226+
227+
**Returns:**
228+
int - The current page number being printed. / public int getPrintingPage() \{ return printingPage; \} /\*\* Gets the total number of pages to print. Returns 0 when no printing is in progress.
112229
### getPrintable(int pageIndex) {#getPrintable-int}
113230
```
114231
public Printable getPrintable(int pageIndex)

english/java/com.aspose.words/bookmarkend/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ public boolean isComposite()
10331033
```
10341034

10351035

1036-
Returns true if this node can contain other nodes. (194242,6)
1036+
Returns true if this node can contain other nodes. (194825,6)
10371037

10381038
**Examples:**
10391039

english/java/com.aspose.words/bookmarkstart/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ public boolean isComposite()
11251125
```
11261126

11271127

1128-
Returns true if this node can contain other nodes. (194242,6)
1128+
Returns true if this node can contain other nodes. (194825,6)
11291129

11301130
**Examples:**
11311131

english/java/com.aspose.words/commentrangeend/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ public boolean isComposite()
13371337
```
13381338

13391339

1340-
Returns true if this node can contain other nodes. (194242,6)
1340+
Returns true if this node can contain other nodes. (194825,6)
13411341

13421342
**Examples:**
13431343

english/java/com.aspose.words/commentrangestart/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ public boolean isComposite()
13371337
```
13381338

13391339

1340-
Returns true if this node can contain other nodes. (194242,6)
1340+
Returns true if this node can contain other nodes. (194825,6)
13411341

13421342
**Examples:**
13431343

english/java/com.aspose.words/document/_index.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Shows how to execute a mail merge with data from a DataTable.
120120
| [ensureMinimum()](#ensureMinimum) | If the document contains no sections, creates one section with one paragraph. |
121121
| [expandTableStylesToDirectFormatting()](#expandTableStylesToDirectFormatting) | Converts formatting specified in table styles into direct formatting on tables in the document. |
122122
| [extractPages(int index, int count)](#extractPages-int-int) | Returns the [Document](../../com.aspose.words/document/) object representing specified range of pages. |
123+
| [extractPages(int index, int count, PageExtractOptions options)](#extractPages-int-int-com.aspose.words.PageExtractOptions) | Returns the [Document](../../com.aspose.words/document/) object representing the specified range of pages and the given page extract options. |
123124
| [fetchInheritedSectionAttr(int key)](#fetchInheritedSectionAttr-int) | |
124125
| [fetchSectionAttr(int key)](#fetchSectionAttr-int) | |
125126
| [fetchSectionAttr(int key, int revisionsView)](#fetchSectionAttr-int-int) | |
@@ -1748,13 +1749,60 @@ Shows how to get specified range of pages from the document.
17481749
17491750
doc.save(getArtifactsDir() + "Document.ExtractPages.docx");
17501751
1752+
```
1753+
1754+
Show how to reset the initial page numbering and save the NUMPAGE field.
1755+
1756+
```
1757+
1758+
Document doc = new Document(getMyDir() + "Page fields.docx");
1759+
1760+
// Default behavior:
1761+
// The extracted page numbering is the same as in the original document, as if we had selected "Print 2 pages" in MS Word.
1762+
// The start page will be set to 2 and the field indicating the number of pages will be removed
1763+
// and replaced with a constant value equal to the number of pages.
1764+
Document extractedDoc1 = doc.extractPages(1, 1);
1765+
extractedDoc1.save(getArtifactsDir() + "Document.ExtractPagesWithOptions.Default.docx");
1766+
1767+
// Altered behavior:
1768+
// The extracted page numbering is reset and a new one begins,
1769+
// as if we had copied the contents of the second page and pasted it into a new document.
1770+
// The start page will be set to 1 and the field indicating the number of pages will be left unchanged
1771+
// and will show the current number of pages.
1772+
PageExtractOptions extractOptions = new PageExtractOptions();
1773+
extractOptions.setUpdatePageStartingNumber(false);
1774+
extractOptions.setUnlinkPagesNumberFields(false);
1775+
Document extractedDoc2 = doc.extractPages(1, 1, extractOptions);
1776+
extractedDoc2.save(getArtifactsDir() + "Document.ExtractPagesWithOptions.Options.docx");
1777+
1778+
```
1779+
1780+
**Parameters:**
1781+
| Parameter | Type | Description |
1782+
| --- | --- | --- |
1783+
| index | int | The zero-based index of the first page to extract. |
1784+
| count | int | Number of pages to be extracted. |
1785+
1786+
**Returns:**
1787+
[Document](../../com.aspose.words/document/)
1788+
### extractPages(int index, int count, PageExtractOptions options) {#extractPages-int-int-com.aspose.words.PageExtractOptions}
17511789
```
1790+
public Document extractPages(int index, int count, PageExtractOptions options)
1791+
```
1792+
1793+
1794+
Returns the [Document](../../com.aspose.words/document/) object representing the specified range of pages and the given page extract options.
1795+
1796+
**Remarks:**
1797+
1798+
The resulting document should look like the one in MS Word, as if we had performed 'Print specific pages' \\u2013 the numbering, headers/footers and cross tables layout will be preserved. But due to a large number of nuances, appearing while reducing the number of pages, full match of the layout is a quiet complicated task requiring a lot of effort. Depending on the document complexity there might be slight differences in the resulting document contents layout comparing to the source document. Any feedback would be greatly appreciated.
17521799

17531800
**Parameters:**
17541801
| Parameter | Type | Description |
17551802
| --- | --- | --- |
17561803
| index | int | The zero-based index of the first page to extract. |
17571804
| count | int | Number of pages to be extracted. |
1805+
| options | [PageExtractOptions](../../com.aspose.words/pageextractoptions/) | Provides options for managing the page extracting process. |
17581806

17591807
**Returns:**
17601808
[Document](../../com.aspose.words/document/)

english/java/com.aspose.words/editablerangeend/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ public boolean isComposite()
10361036
```
10371037

10381038

1039-
Returns true if this node can contain other nodes. (194242,6)
1039+
Returns true if this node can contain other nodes. (194825,6)
10401040

10411041
**Examples:**
10421042

english/java/com.aspose.words/editablerangestart/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ public boolean isComposite()
10361036
```
10371037

10381038

1039-
Returns true if this node can contain other nodes. (194242,6)
1039+
Returns true if this node can contain other nodes. (194825,6)
10401040

10411041
**Examples:**
10421042

0 commit comments

Comments
 (0)