Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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
You can’t perform that action at this time.