Hi Support,
When the include file has a space in the file name, and ecode the space into %20, this will cause the Document.updateFields can not work correctly for the field INCLUDETXT. Is it a defect?
In addition, Document.updateFields for INCLUDETXT field do not support TXT file format, is there any document that has a detailed list about which file formats can be supported, and which file formats can not be supported?
Thanks & regards.
Vincent
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
File f = new File("c:\test\include 1.doc");
builder.writeln("The first correct:");
// file:/c:/test/inlcude 1.doc, this can work well.
String fieldCode = "INCLUDETEXT "
" + f.toURL().toString() + "
" \* MERGEFORMAT";
builder.insertField(fieldCode, "");
builder.writeln();
builder.writeln("The second wrong:");
// file:/c:/test/inlcude%201.doc, this can not work well.
fieldCode = "INCLUDETEXT "
" + f.toURI().toString() + "
" \* MERGEFORMAT";
builder.insertField(fieldCode, "");
builder.writeln();
builder.writeln("The third wrong:");
f = new File("c:\test\include.txt");
// file:/c:/test/inlcude.txt, this format can not be supported
fieldCode = "INCLUDETEXT "
" + f.toURI().toString() + "
" \* MERGEFORMAT";
builder.insertField(fieldCode, "");
builder.writeln();
doc.updateFields();
doc.save("c:\test-out.pdf");
doc.save("c:\test-out.doc");