Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created August 19, 2019 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/d03aba45762a74c410ee10e0e4fa1a05 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/d03aba45762a74c410ee10e0e4fa1a05 to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/GroupDocs-Merger/GroupDocs.Merger-for-Java
// Variables.
string sourcePath = "C:\testfiles\";
long[] sourceFormatArray = {FileFormat.Bmp, FileFormat.Png, FileFormat.Tiff};
int[] rowNumberForElement = {1,2,2};
int[] columnNumberForElement = { 22, 23, 23 };
InputStream[] inputStreams = {new FileInputStream(sourcePath + test.bmp),new FileInputStream(sourcePath + test.png),new FileInputStream(sourcePath + test.tiff)}
int order = Order.JoinByRowsFirst
// Preparing.
java.util.List<ImageJoinItem> imageItems = new ArrayList<ImageJoinItem>();
int i = 0;
for (Long sourceFileFormat : sourceFormatArray)
{
String title = String.format("%s:%s:%s-%s||", order, sourceFileFormat,rowNumberForElement[i],columnNumberForElement[i]);
InputStream imageStream = inputStreams[i];
ImageJoinItem imageJoinItem = new ImageJoinItem(imageStream, sourceFileFormat, rowNumberForElement[i], columnNumberForElement[i], 2);
imageJoinItem.setIdentifyRow(title);
imageItems.add(imageJoinItem);
i++;
}
ImageJoinOptions options = new ImageJoinOptions(outputFileFormat, order);
// Main method.
DocumentInfo resultInfo = new DocumentHandler().getDocumentInfo(documentExample);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment