Skip to content

Commit e56ae9c

Browse files
committed
MERGERJAVA-499:Updated GroupDocs.Merger for Java up to 24.6
1 parent 1865a34 commit e56ae9c

10 files changed

Lines changed: 264 additions & 82 deletions

File tree

488 KB
Binary file not shown.

Examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<dependency>
88
<groupId>com.groupdocs</groupId>
99
<artifactId>groupdocs-merger</artifactId>
10-
<version>24.2</version>
10+
<version>24.6</version>
1111
</dependency>
1212
<dependency>
1313
<groupId>com.microsoft.azure</groupId>

Examples/src/main/java/com/groupdocs/merger/examples/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public class Constants {
7070
// Images
7171
public static String SAMPLE_EMF =
7272
getSampleFilePath("Image/sample.emf");
73+
public static String SAMPLE_EMZ =
74+
getSampleFilePath("Image/sample.emz");
7375
public static String SAMPLE_PNG =
7476
getSampleFilePath("Image/sample1.png");
7577
public static String SAMPLE_BMP =

Examples/src/main/java/com/groupdocs/merger/examples/RunExamples.java

Lines changed: 87 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import com.groupdocs.merger.examples.basic_usage.GetSupportedFileTypes;
1212
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.*;
1313
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.merge.*;
14+
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.merge.word.MergeWordDocumentsWithPredefinedComplianceMode;
15+
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.merge.word.MergeWordDocumentsWithoutStartingFromNewPage;
1416
import com.groupdocs.merger.examples.basic_usage.security_operations.AddDocumentPassword;
1517
import com.groupdocs.merger.examples.basic_usage.security_operations.CheckDocumentPasswordProtection;
1618
import com.groupdocs.merger.examples.basic_usage.security_operations.RemoveDocumentPassword;
@@ -52,84 +54,89 @@ public static void main(String[] args) throws Throwable
5254
//region Basic Usage
5355

5456
//region Import Documents
55-
//ImportDocumentToPdf.run();
56-
//ImportDocumentToWordProcessing.run();
57-
//ImportDocumentToSpreadsheet.run();
58-
//ImportDocumentToPresentation.run();
59-
//ImportDocumentToDiagram.run();
57+
ImportDocumentToPdf.run();
58+
ImportDocumentToWordProcessing.run();
59+
ImportDocumentToSpreadsheet.run();
60+
ImportDocumentToPresentation.run();
61+
ImportDocumentToDiagram.run();
6062
//endregion
6163

6264
//region Get all supported file types
63-
//GetSupportedFileTypes.run();
65+
GetSupportedFileTypes.run();
6466
//endregion
6567

6668
//region Get info for the selected document
67-
//GetDocumentInformation.run();
69+
GetDocumentInformation.run();
6870
//endregion
6971

7072
//region Generate preview for the selected document
71-
//GenerateDocumentPagesPreview.run();
73+
GenerateDocumentPagesPreview.run();
7274
//endregion
7375

7476
//region Join files
75-
//JoinMultipleDocuments.run();
76-
//JoinPagesFromVariousDocuments.run();
77-
//JoinPagesUsingPageBuilder.run();
77+
JoinMultipleDocuments.run();
78+
JoinPagesFromVariousDocuments.run();
79+
JoinPagesUsingPageBuilder.run();
7880
//endregion
7981

8082
//region Merge files
81-
//MergeCsv.run();
82-
//MergeDoc.run();
83-
//MergeDocm.run();
84-
//MergeDocx.run();
85-
//MergeDot.run();
86-
//MergeDotm.run();
87-
//MergeDotx.run();
88-
//MergeEpub.run();
89-
//MergeHtml.run();
90-
//MergeMht.run();
91-
//MergeMhtml.run();
92-
//MergeOdp.run();
93-
//MergeOds.run();
94-
//MergeOdt.run();
95-
//MergeOne.run();
96-
//MergeOtp.run();
97-
//MergeOtt.run();
98-
//MergePdf.run();
99-
//MergePps.run();
100-
//MergePpsx.run();
101-
//MergePpt.run();
102-
//MergePptx.run();
103-
//MergePng.run();
104-
//MergeBmp.run();
105-
//MergeTif.run();
106-
//MergeTiff.run();
107-
//MergeSvg.run();
108-
//MergeSvgz.run();
109-
//MergeRtf.run();
110-
//MergeTsv.run();
111-
//MergeTxt.run();
112-
//MergeVdx.run();
113-
//MergeVsdm.run();
114-
//MergeVsdx.run();
115-
//MergeVssm.run();
116-
//MergeVssx.run();
117-
//MergeVstm.run();
118-
//MergeVstx.run();
119-
//MergeVsx.run();
120-
//MergeVtx.run();
121-
//MergeXlam.run();
122-
//MergeXls.run();
123-
//MergeXlsb.run();
124-
//MergeXlsm.run();
125-
//MergeXlsx.run();
126-
//MergeXlt.run();
127-
//MergeXltm.run();
128-
//MergeXltx.run();
129-
//MergeXps.run();
130-
//MergeZip.run();
131-
//MergeTar.run();
132-
//MergeWav.run();
83+
MergeCsv.run();
84+
MergeDoc.run();
85+
MergeDocm.run();
86+
MergeDocx.run();
87+
MergeDot.run();
88+
MergeDotm.run();
89+
MergeDotx.run();
90+
MergeEpub.run();
91+
MergeHtml.run();
92+
MergeMht.run();
93+
MergeMhtml.run();
94+
MergeOdp.run();
95+
MergeOds.run();
96+
MergeOdt.run();
97+
MergeOne.run();
98+
MergeOtp.run();
99+
MergeOtt.run();
100+
MergePdf.run();
101+
MergePps.run();
102+
MergePpsx.run();
103+
MergePpt.run();
104+
MergePptx.run();
105+
MergePng.run();
106+
MergeBmp.run();
107+
MergeTif.run();
108+
MergeTiff.run();
109+
MergeSvg.run();
110+
MergeSvgz.run();
111+
MergeEmf.run();
112+
MergeEmz.run();
113+
MergeRtf.run();
114+
MergeTsv.run();
115+
MergeTxt.run();
116+
MergeVdx.run();
117+
MergeVsdm.run();
118+
MergeVsdx.run();
119+
MergeVssm.run();
120+
MergeVssx.run();
121+
MergeVstm.run();
122+
MergeVstx.run();
123+
MergeVsx.run();
124+
MergeVtx.run();
125+
MergeXlam.run();
126+
MergeXls.run();
127+
MergeXlsb.run();
128+
MergeXlsm.run();
129+
MergeXlsx.run();
130+
MergeXlt.run();
131+
MergeXltm.run();
132+
MergeXltx.run();
133+
MergeXps.run();
134+
MergeZip.run();
135+
MergeTar.run();
136+
MergeWav.run();
137+
// Word
138+
MergeWordDocumentsWithoutStartingFromNewPage.run();
139+
MergeWordDocumentsWithPredefinedComplianceMode.run();
133140
//endregion
134141

135142
//region Cross-Join files
@@ -143,49 +150,49 @@ public static void main(String[] args) throws Throwable
143150
//endregion
144151

145152
//region Split document
146-
//SplitToMultiPageDocuments.run();
147-
//SplitToSinglePages.run();
148-
//SplitToSinglePagesByRange.run();
149-
//SplitToSinglePagesByRangeWithFilter.run();
153+
SplitToMultiPageDocuments.run();
154+
SplitToSinglePages.run();
155+
SplitToSinglePagesByRange.run();
156+
SplitToSinglePagesByRangeWithFilter.run();
150157
//endregion
151158

152159
//region Split text file
153-
//SplitToLineRanges.run();
154-
//SplitToSeparateLines.run();
160+
SplitToLineRanges.run();
161+
SplitToSeparateLines.run();
155162
//endregion
156163

157164
//region Extract document pages
158-
//ExtractPagesByNumbers.run();
159-
//ExtractPagesByRange.run();
165+
ExtractPagesByNumbers.run();
166+
ExtractPagesByRange.run();
160167
//endregion
161168

162169
//region Change orientation of the specific document pages
163-
//ChangePageOrientation.run();
170+
ChangePageOrientation.run();
164171
//endregion
165172

166173
//region Rotate document pages
167-
//RotatePages.run();
174+
RotatePages.run();
168175
//endregion
169176

170177
//region Swap document pages
171-
//SwapPages.run();
178+
SwapPages.run();
172179
//endregion
173180

174181
//region Remove document pages
175182
// TODO: Implement for some other format than One (which is not supported currently under NET Standard)
176-
//RemovePages.run();
183+
RemovePages.run();
177184
//endregion
178185

179186
//region Move page to a new position within document
180-
//MovePage.run();
187+
MovePage.run();
181188
//endregion
182189

183190
//region Security - check, add, update, remove document password
184191

185-
//AddDocumentPassword.run();
186-
//UpdateDocumentPassword.run();
187-
//CheckDocumentPasswordProtection.run();
188-
//RemoveDocumentPassword.run();
192+
AddDocumentPassword.run();
193+
UpdateDocumentPassword.run();
194+
CheckDocumentPasswordProtection.run();
195+
RemoveDocumentPassword.run();
189196

190197
//endregion // Security
191198

Examples/src/main/java/com/groupdocs/merger/examples/basic_usage/multiple_document_operations/CrossJoinMultipleImages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static void run() throws Exception
2020
String filePath = Constants.SAMPLE_PNG;
2121
String filePathOut = new File(Constants.OutputPath, "CrossJoinMultipleDocuments-" + Paths.get(filePath).getFileName().toString()).getPath();
2222

23-
IImageJoinOptions imageJoinOptions = new ImageJoinOptions(ImageJoinMode.Vertical);
23+
ImageJoinOptions imageJoinOptions = new ImageJoinOptions(ImageJoinMode.Vertical);
2424

2525
Merger merger = new Merger(filePath);
2626
{

Examples/src/main/java/com/groupdocs/merger/examples/basic_usage/multiple_document_operations/JoinMultipleDocuments.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.groupdocs.merger.examples.basic_usage.multiple_document_operations;
22

3+
34
import com.groupdocs.merger.Merger;
45
import com.groupdocs.merger.domain.options.WordJoinMode;
56
import com.groupdocs.merger.domain.options.WordJoinOptions;
@@ -14,6 +15,8 @@
1415
public class JoinMultipleDocuments {
1516
public static void run() throws Exception
1617
{
18+
19+
1720
String filePath = Constants.SAMPLE_DOCX_2;
1821
String filePathOut = new File(Constants.OutputPath, "JoinMultipleDocuments-"+ Paths.get(filePath).getFileName().toString()).getPath();
1922

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.groupdocs.merger.examples.basic_usage.multiple_document_operations.merge;
2+
3+
4+
import com.groupdocs.merger.Merger;
5+
import com.groupdocs.merger.domain.options.ImageJoinMode;
6+
import com.groupdocs.merger.domain.options.ImageJoinOptions;
7+
import com.groupdocs.merger.examples.Constants;
8+
9+
import java.io.File;
10+
11+
/**
12+
* This example demonstrates how to merge multiple EMF files into single file.
13+
* For more details about merging image (.emf) files please check this documentation article
14+
* https://docs.groupdocs.com/merger/net/merge/images/
15+
*/
16+
public class MergeEmf
17+
{
18+
public static void run() throws Exception
19+
{
20+
System.out.print("=======================================================================");
21+
System.out.print("");
22+
System.out.print("Example Basic Usage: MergeEmf");
23+
System.out.print("");
24+
25+
String outputFolder = Constants.OutputPath;
26+
String outputFile = new File(outputFolder, "merged.emf").getPath();
27+
28+
// Load the source EMF file
29+
Merger merger = new Merger(Constants.SAMPLE_EMF);
30+
{
31+
// Define image join options with vertical join mode
32+
ImageJoinOptions joinOptions = new ImageJoinOptions(ImageJoinMode.Vertical);
33+
// Add another EMF file to merge
34+
merger.join(Constants.SAMPLE_EMF, joinOptions);
35+
// Merge EMF files and save result
36+
merger.save(outputFile);
37+
}
38+
39+
System.out.print("\nEMF files merge completed successfully. \nCheck output in "+outputFolder );
40+
}
41+
}
42+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.groupdocs.merger.examples.basic_usage.multiple_document_operations.merge;
2+
3+
4+
import com.groupdocs.merger.Merger;
5+
import com.groupdocs.merger.domain.options.ImageJoinMode;
6+
import com.groupdocs.merger.domain.options.ImageJoinOptions;
7+
import com.groupdocs.merger.examples.Constants;
8+
9+
import java.io.File;
10+
11+
/**
12+
* This example demonstrates how to merge multiple EMZ files into single file.
13+
* For more details about merging image (.emz) files please check this documentation article
14+
* https://docs.groupdocs.com/merger/net/merge/images/
15+
*/
16+
public class MergeEmz
17+
{
18+
public static void run() throws Exception
19+
{
20+
System.out.print("=======================================================================");
21+
System.out.print("");
22+
System.out.print("Example Basic Usage: MergeEmz");
23+
System.out.print("");
24+
25+
String outputFolder = Constants.OutputPath;
26+
String outputFile = new File(outputFolder, "merged.emz").getPath();
27+
28+
// Load the source EMZ file
29+
Merger merger = new Merger(Constants.SAMPLE_EMZ);
30+
{
31+
// Define image join options with vertical join mode
32+
ImageJoinOptions joinOptions = new ImageJoinOptions(ImageJoinMode.Vertical);
33+
// Add another EMZ file to merge
34+
merger.join(Constants.SAMPLE_EMZ, joinOptions);
35+
// Merge EMZ files and save result
36+
merger.save(outputFile);
37+
}
38+
39+
System.out.print("\nEMZ files merge completed successfully. \nCheck output in "+outputFolder );
40+
}
41+
}
42+

0 commit comments

Comments
 (0)