ControlChar

Hi, I am using aspose for java, can I somehow instert control char into document (ControlChar.FIELD_START_CHAR for example)?

Thanks.

Hi
Thanks for your inquiry. You can try using this code.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write(String.valueOf(ControlChar.LINE_BREAK));
doc.save("out.doc");

but this line

builder.write(String.valueOf(ControlChar.LINE_BREAK));

equals

builder.insertBreak(BreakType.LINE_BREAK);

If you would like to insert field then you can use this code for example.

builder.insertField("MERGEFIELD test", "«test»");

Best regards.

No, I want to insert FieldStart ControlChar. If I do this:

builder.write(String.valueOf(ControlChar.FIELD_START_CHAR));

in output file there is visual representation of that char but I need to mark field start in a document.

Thanks.

No, you can’t insert field start. You can insert only whole field.
Best regards.

Ok, thanks.