Skip to content

Commit 9546e09

Browse files
author
efimovevgen
committed
Updated GroupDocs.Merger up to 22.7 version.
1 parent caeea4a commit 9546e09

50 files changed

Lines changed: 1787 additions & 14 deletions

Some content is hidden

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

Examples/pom.xml

Lines changed: 7 additions & 9 deletions
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>22.2</version>
10+
<version>22.7</version>
1111
</dependency>
1212
<dependency>
1313
<groupId>com.microsoft.azure</groupId>
@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>commons-io</groupId>
1919
<artifactId>commons-io</artifactId>
20-
<version>2.7</version>
20+
<version>2.5</version>
2121
</dependency>
2222
<dependency>
2323
<groupId>com.google.code.gson</groupId>
@@ -36,11 +36,9 @@
3636
</dependency>
3737
</dependencies>
3838
<repositories>
39-
<repository>
40-
<id>GroupDocs Artifact Repository</id>
41-
<name>GroupDocs Artifact Repository</name>
42-
<url>https://repository.groupdocs.com/repo/</url>
43-
</repository>
39+
<id>GroupDocs Artifact Repository</id>
40+
<name>GroupDocs Artifact Repository</name>
41+
<url>https://repository.groupdocs.com/repo/</url>
4442
</repositories>
4543
<build>
4644
<plugins>
@@ -49,8 +47,8 @@
4947
<version>2.0.2</version>
5048
<configuration>
5149
<compilerArgument>-XDignore.symbol.file</compilerArgument>
52-
<source>1.7</source>
53-
<target>1.7</target>
50+
<source>1.8</source>
51+
<target>1.8</target>
5452
</configuration>
5553
</plugin>
5654
</plugins>

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

Lines changed: 166 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ public class Constants {
7171
public static String SAMPLE_EMF =
7272
getSampleFilePath("Image/sample.emf");
7373
public static String SAMPLE_PNG =
74-
getSampleFilePath("Image/example1.png");
74+
getSampleFilePath("Image/sample1.png");
7575
public static String SAMPLE_BMP =
76-
getSampleFilePath("Image/example2.bmp");
76+
getSampleFilePath("Image/sample2.bmp");
7777
public static String SAMPLE_TIFF =
78-
getSampleFilePath("Image/example3.tiff");
78+
getSampleFilePath("Image/sample3.tiff");
7979

8080
private static String getSampleFilePath(String filePath) {
8181
String test = SamplesPath;
@@ -87,4 +87,167 @@ public static String getOutputDirectoryPath(String callerFilePath )
8787
String outputDirectory = new File(OutputPath, callerFilePath).getPath();
8888
return outputDirectory;
8989
}
90+
91+
// CSV
92+
public static String SAMPLE_CSV = getSampleFilePath("Spreadsheet/sample.csv");
93+
public static String SAMPLE_CSV_2 = getSampleFilePath("Spreadsheet/sample.csv");
94+
95+
// DOC
96+
public static String SAMPLE_DOC = getSampleFilePath("Wordprocessing/sample.doc");
97+
public static String SAMPLE_DOC_2 = getSampleFilePath("Wordprocessing/sample.doc");
98+
99+
// DOCM
100+
public static String SAMPLE_DOCM = getSampleFilePath("Wordprocessing/sample.docm");
101+
public static String SAMPLE_DOCM_2 = getSampleFilePath("Wordprocessing/sample.docm");
102+
103+
// DOT
104+
public static String SAMPLE_DOT = getSampleFilePath("Wordprocessing/sample.dot");
105+
public static String SAMPLE_DOT_2 = getSampleFilePath("Wordprocessing/sample.dot");
106+
107+
// DOTM
108+
public static String SAMPLE_DOTM = getSampleFilePath("Wordprocessing/sample.dotm");
109+
public static String SAMPLE_DOTM_2 = getSampleFilePath("Wordprocessing/sample.dotm");
110+
111+
// DOTX
112+
public static String SAMPLE_DOTX = getSampleFilePath("Wordprocessing/sample.dotx");
113+
public static String SAMPLE_DOTX_2 = getSampleFilePath("Wordprocessing/sample.dotx");
114+
115+
// EPUB
116+
public static String SAMPLE_EPUB = getSampleFilePath("Ebook/sample.epub");
117+
public static String SAMPLE_EPUB_2 = getSampleFilePath("Ebook/sample.epub");
118+
119+
// HTML
120+
public static String SAMPLE_HTML = getSampleFilePath("Web/sample.html");
121+
public static String SAMPLE_HTML_2 = getSampleFilePath("Web/sample.html");
122+
123+
// MHT
124+
public static String SAMPLE_MHT = getSampleFilePath("Web/sample.mht");
125+
public static String SAMPLE_MHT_2 = getSampleFilePath("Web/sample.mht");
126+
127+
// MHTML
128+
public static String SAMPLE_MHTML = getSampleFilePath("Web/sample.mhtml");
129+
public static String SAMPLE_MHTML_2 = getSampleFilePath("Web/sample.mhtml");
130+
131+
// ODP
132+
public static String SAMPLE_ODP = getSampleFilePath("Presentation/sample.odp");
133+
public static String SAMPLE_ODP_2 = getSampleFilePath("Presentation/sample.odp");
134+
135+
// ODS
136+
public static String SAMPLE_ODS = getSampleFilePath("Spreadsheet/sample.ods");
137+
public static String SAMPLE_ODS_2 = getSampleFilePath("Spreadsheet/sample.ods");
138+
139+
// ODT
140+
public static String SAMPLE_ODT = getSampleFilePath("Wordprocessing/sample.odt");
141+
public static String SAMPLE_ODT_2 = getSampleFilePath("Wordprocessing/sample.odt");
142+
143+
// ONE
144+
public static String SAMPLE_ONE_2 = getSampleFilePath("Note/sample.one");
145+
146+
// OTP
147+
public static String SAMPLE_OTP = getSampleFilePath("Presentation/sample.otp");
148+
public static String SAMPLE_OTP_2 = getSampleFilePath("Presentation/sample.otp");
149+
150+
// OTT
151+
public static String SAMPLE_OTT = getSampleFilePath("Wordprocessing/sample.ott");
152+
public static String SAMPLE_OTT_2 = getSampleFilePath("Wordprocessing/sample.ott");
153+
154+
// PPS
155+
public static String SAMPLE_PPS = getSampleFilePath("Presentation/sample.pps");
156+
public static String SAMPLE_PPS_2 = getSampleFilePath("Presentation/sample.pps");
157+
158+
// PPSX
159+
public static String SAMPLE_PPSX = getSampleFilePath("Presentation/sample.ppsx");
160+
public static String SAMPLE_PPSX_2 = getSampleFilePath("Presentation/sample.ppsx");
161+
162+
// PPT
163+
public static String SAMPLE_PPT = getSampleFilePath("Presentation/sample.ppt");
164+
public static String SAMPLE_PPT_2 = getSampleFilePath("Presentation/sample.ppt");
165+
166+
// PPTX
167+
public static String SAMPLE_PPTX_2 = getSampleFilePath("Presentation/sample.pptx");
168+
169+
// RTF
170+
public static String SAMPLE_RTF = getSampleFilePath("Wordprocessing/sample.rtf");
171+
public static String SAMPLE_RTF_2 = getSampleFilePath("Wordprocessing/sample.rtf");
172+
173+
// TEX
174+
public static String SAMPLE_TEX = getSampleFilePath("PageDescriptionLanguage/sample.tex");
175+
public static String SAMPLE_TEX_2 = getSampleFilePath("PageDescriptionLanguage/sample.tex");
176+
177+
// TSV
178+
public static String SAMPLE_TSV = getSampleFilePath("Spreadsheet/sample.tsv");
179+
public static String SAMPLE_TSV_2 = getSampleFilePath("Spreadsheet/sample.tsv");
180+
181+
// TXT
182+
public static String SAMPLE_TXT_2 = getSampleFilePath("Text/sample.txt");
183+
184+
// VDX
185+
public static String SAMPLE_VDX = getSampleFilePath("Diagram/sample.vdx");
186+
public static String SAMPLE_VDX_2 = getSampleFilePath("Diagram/sample.vdx");
187+
188+
// VSDM
189+
public static String SAMPLE_VSDM = getSampleFilePath("Diagram/sample.vsdm");
190+
public static String SAMPLE_VSDM_2 = getSampleFilePath("Diagram/sample.vsdm");
191+
192+
// VSDX
193+
public static String SAMPLE_VSDX_2 = getSampleFilePath("Diagram/sample.vsdx");
194+
195+
// VSSM
196+
public static String SAMPLE_VSSM = getSampleFilePath("Diagram/sample.vssm");
197+
public static String SAMPLE_VSSM_2 = getSampleFilePath("Diagram/sample.vssm");
198+
199+
// VSSX
200+
public static String SAMPLE_VSSX = getSampleFilePath("Diagram/sample.vssx");
201+
public static String SAMPLE_VSSX_2 = getSampleFilePath("Diagram/sample.vssx");
202+
203+
// VSTM
204+
public static String SAMPLE_VSTM = getSampleFilePath("Diagram/sample.vstm");
205+
public static String SAMPLE_VSTM_2 = getSampleFilePath("Diagram/sample.vstm");
206+
207+
// VSTX
208+
public static String SAMPLE_VSTX = getSampleFilePath("Diagram/sample.vstx");
209+
public static String SAMPLE_VSTX_2 = getSampleFilePath("Diagram/sample.vstx");
210+
211+
// VSX
212+
public static String SAMPLE_VSX = getSampleFilePath("Diagram/sample.vsx");
213+
public static String SAMPLE_VSX_2 = getSampleFilePath("Diagram/sample.vsx");
214+
215+
// VTX
216+
public static String SAMPLE_VTX = getSampleFilePath("Diagram/sample.vtx");
217+
public static String SAMPLE_VTX_2 = getSampleFilePath("Diagram/sample.vtx");
218+
219+
// XLAM
220+
public static String SAMPLE_XLAM = getSampleFilePath("Spreadsheet/sample.xlam");
221+
public static String SAMPLE_XLAM_2 = getSampleFilePath("Spreadsheet/sample.xlam");
222+
223+
// XLS
224+
public static String SAMPLE_XLS = getSampleFilePath("Spreadsheet/sample.xls");
225+
public static String SAMPLE_XLS_2 = getSampleFilePath("Spreadsheet/sample.xls");
226+
227+
// XLSB
228+
public static String SAMPLE_XLSB = getSampleFilePath("Spreadsheet/sample.xlsb");
229+
public static String SAMPLE_XLSB_2 = getSampleFilePath("Spreadsheet/sample.xlsb");
230+
231+
// XLSM
232+
public static String SAMPLE_XLSM = getSampleFilePath("Spreadsheet/sample.xlsm");
233+
public static String SAMPLE_XLSM_2 = getSampleFilePath("Spreadsheet/sample.xlsm");
234+
235+
// XLSX
236+
public static String SAMPLE_XLSX_2 = getSampleFilePath("Spreadsheet/sample.xlsx");
237+
238+
// XLT
239+
public static String SAMPLE_XLT = getSampleFilePath("Spreadsheet/sample.xlt");
240+
public static String SAMPLE_XLT_2 = getSampleFilePath("Spreadsheet/sample.xlt");
241+
242+
// XLTM
243+
public static String SAMPLE_XLTM = getSampleFilePath("Spreadsheet/sample.xltm");
244+
public static String SAMPLE_XLTM_2 = getSampleFilePath("Spreadsheet/sample.xltm");
245+
246+
// XLTX
247+
public static String SAMPLE_XLTX = getSampleFilePath("Spreadsheet/sample.xltx");
248+
public static String SAMPLE_XLTX_2 = getSampleFilePath("Spreadsheet/sample.xltx");
249+
250+
// XPS
251+
public static String SAMPLE_XPS = getSampleFilePath("PageDescriptionLanguage/sample.xps");
252+
public static String SAMPLE_XPS_2 = getSampleFilePath("PageDescriptionLanguage/sample.xps");
90253
}

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

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.CrossJoinPagesFromVariousDocuments;
1414
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.JoinMultipleDocuments;
1515
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.JoinPagesFromVariousDocuments;
16+
import com.groupdocs.merger.examples.basic_usage.multiple_document_operations.merge.*;
1617
import com.groupdocs.merger.examples.basic_usage.security_operations.AddDocumentPassword;
1718
import com.groupdocs.merger.examples.basic_usage.security_operations.CheckDocumentPasswordProtection;
1819
import com.groupdocs.merger.examples.basic_usage.security_operations.RemoveDocumentPassword;
@@ -77,6 +78,54 @@ public static void main(String[] args) throws Throwable
7778
//JoinMultipleDocuments.run();
7879
//JoinPagesFromVariousDocuments.run();
7980
//endregion
81+
82+
//region Merge files
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+
//MergeRtf.run();
107+
//MergeTex.run();
108+
//MergeTsv.run();
109+
//MergeTxt.run();
110+
//MergeVdx.run();
111+
//MergeVsdm.run();
112+
//MergeVsdx.run();
113+
//MergeVssm.run();
114+
//MergeVssx.run();
115+
//MergeVstm.run();
116+
//MergeVstx.run();
117+
//MergeVsx.run();
118+
//MergeVtx.run();
119+
//MergeXlam.run();
120+
//MergeXls.run();
121+
//MergeXlsb.run();
122+
//MergeXlsm.run();
123+
//MergeXlsx.run();
124+
//MergeXlt.run();
125+
//MergeXltm.run();
126+
//MergeXltx.run();
127+
//MergeXps.run();
128+
//endregion
80129

81130
//region Cross-Join files
82131
if (Constants.IsLicensed)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.groupdocs.merger.examples.basic_usage.multiple_document_operations;
22

33
import com.groupdocs.merger.Merger;
4+
import com.groupdocs.merger.domain.options.WordJoinMode;
5+
import com.groupdocs.merger.domain.options.WordJoinOptions;
46
import com.groupdocs.merger.examples.Constants;
57

68
import java.io.File;
@@ -16,7 +18,6 @@ public static void run() throws Exception
1618
String filePathOut = new File(Constants.OutputPath, "JoinMultipleDocuments-"+ Paths.get(filePath).getFileName().toString()).getPath();
1719

1820
Merger merger = new Merger(filePath);
19-
2021
merger.join(Constants.SAMPLE_DOCX_3);
2122
merger.join(Constants.SAMPLE_DOCX_4);
2223
merger.save(filePathOut);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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.examples.Constants;
6+
7+
import java.io.File;
8+
9+
/**
10+
* This example demonstrates how to merge multiple CSV files into single file.
11+
* For more details about merging Comma Separated Values File (.csv) files please check this documentation article
12+
* https://docs.groupdocs.com/merger/net/merge/csv
13+
*/
14+
public class MergeCsv
15+
{
16+
public static void run() throws Exception
17+
{
18+
19+
String outputFolder = Constants.OutputPath;
20+
String outputFile = new File(outputFolder, "merged.csv").getPath();
21+
// Load the source CSV file
22+
Merger merger = new Merger(Constants.SAMPLE_CSV);
23+
{
24+
// Add another CSV file to merge
25+
merger.join(Constants.SAMPLE_CSV_2);
26+
// Merge CSV files ans save result
27+
merger.save(outputFile);
28+
}
29+
30+
System.out.print("\nCSV files merge completed successfully. \nCheck output in "+ outputFolder);
31+
}
32+
}
33+
34+
35+
36+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.examples.Constants;
6+
7+
import java.io.File;
8+
/**
9+
* This example demonstrates how to merge multiple DOC files into single file.
10+
* For more details about merging Microsoft Word Document (.doc) files please check this documentation article
11+
* https://docs.groupdocs.com/merger/net/merge/doc
12+
*/
13+
14+
public class MergeDoc
15+
{
16+
public static void run() throws Exception
17+
{
18+
String outputFolder = Constants.OutputPath;
19+
String outputFile = new File(outputFolder, "merged.doc").getPath();
20+
// Load the source DOC file
21+
Merger merger = new Merger(Constants.SAMPLE_DOC);
22+
{
23+
// Add another DOC file to merge
24+
merger.join(Constants.SAMPLE_DOC_2);
25+
// Merge DOC files ans save result
26+
merger.save(outputFile);
27+
}
28+
29+
System.out.print("\nDOC files merge completed successfully. \nCheck output in "+ outputFolder);
30+
}
31+
}
32+
33+
34+
35+

0 commit comments

Comments
 (0)