Hi,
If a document has the last line justified it spreads across the entire line. This happens during mail merge only and on all pages, except for the last.
See attachment for input docx with 2 justified lines and the saved pdf for the single and the mail merged pdf outputs.
See below code (using Java aspose-words 18.4.) to reproduce the bug:
package aspose.bug;
import com.aspose.words.Document;
import com.aspose.words.IMailMergeDataSource;
import com.aspose.words.License;
import com.aspose.words.ref.Ref;
import java.io.FileInputStream;
public class JustifyBug {
public static void main(String... args) {
try {
String dir = "C:\\temp\\aspose\\";
new License().setLicense(new FileInputStream(dir + "Aspose.Words.lic"));
Document doc = new Document(dir + "doc-with-justify.docx");
doc.save(dir + "doc-with-justify.pdf");
doc.getMailMerge().execute(new IMailMergeDataSource() {
int i=0;
public String getTableName() throws Exception {
return "mock";
}
public boolean moveNext() throws Exception {
return i++ < 3;
}
public boolean getValue(String s, Ref<Object> ref) throws Exception {
return false;
}
public IMailMergeDataSource getChildDataSource(String s) throws Exception {
return null;
}
});
doc.save(dir + "doc-with-justify-mail-merge.pdf");
} catch (Exception e) {
e.printStackTrace();
}
}
}
last-line-justify-mailmerge-bug.zip (36.7 KB)