Custom Tabstop setting - Regarding

Dear Team,

I’m using aspose words for Java.

I want to generate 2 paragraphs. First one should have tab space of 4 inch and second paragraph should contain tab space of 5.5 inch. I tried like this but its not working.

builder.getDocument().setDefaultTabStop(288); //4 inch.

builder.writeln("Source : xxxxxxxxxx"+ControlChar.TAB\_CHAR+"Name: xxxxxxxxxx");

builder.getDocument().setDefaultTabStop(396); //5.5

builder.writeln("Source : xxxxxxxxxx"+ControlChar.TAB\_CHAR+"Name: xxxxxxxxxx");

Kindly help me regarding.

Thanks in advance.

With Regards,

Siva.

Hi Siva,

Thanks for your inquiry. Please try using the following code snippet:

Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);
ParagraphFormat paragraphFormat = builder.getParagraphFormat();
paragraphFormat.getTabStops().add(288, TabAlignment.LEFT, TabLeader.NONE);
builder.writeln("Source:" + ControlChar.TAB + "Name");
builder.insertParagraph();
paragraphFormat = builder.getParagraphFormat();
paragraphFormat.clearFormatting();
paragraphFormat.getTabStops().add(396, TabAlignment.LEFT, TabLeader.DOTS);
builder.writeln("Source:" + ControlChar.TAB + "Name");
document.save("C:\\test\\ParasWithTabStops.docx");

I hope, this will help.

Best Regards,

Hello Awais,

Thank you soo much for your help and quick response.

Regards,

Siva.

Dear Team,

I’m using aspose.word for generating an document. But here spell check is not enabled.

Initially I set the locale specification for the code as follows.

Run run = new Run(doc, "Hello");
run.getFont().setLocaleId(1033); //English united states.

But spell check is not working. Kindly let me know how can I enable this option.

Thanks in advance.

Regards,
Siva.

Hi Siva,

Thanks for your inquiry. Could you please attach here simple document and code i.e. used to generate that document, which will allow me to reproduce the problem on my side? I will check the issue and provide you more information. Moreover, please try changing the LocaleId of entire document as explained in the following post:

Best Regards,

Hi Awais,

Thanks for your reply. But the above link contains C# file.
Kindly find the sample code and suggest me an solution.

Document document = new Document();
Run run = new Run(document, "Hello");
run.getFont().setLocaleId(1033);
DocumentBuilder builder = new DocumentBuilder(document);

ParagraphFormat paragraphFormat = builder.getParagraphFormat();
paragraphFormat.getTabStops().add(288, TabAlignment.LEFT, TabLeader.NONE);

builder.writeln("Source:" + ControlChar.TAB + "Name");

builder.insertParagraph();
paragraphFormat = builder.getParagraphFormat();
paragraphFormat.clearFormatting();
paragraphFormat.getTabStops().add(396, TabAlignment.LEFT, TabLeader.NONE);

builder.writeln("Source:" + ControlChar.TAB + "Name");
document.save("C://CreateSimpleTabDoc.doc");

Thanks,
Siva.

Hi,

Thanks for your inquiry.

By using Aspose.Words v10.7.0, I generated CreateSimpleTabDoc.doc with your code on my side. Unfortunately, when I viewed this document with MS WORD 2007, I was unable to observe Spelling & Grammar button being disabled. This can be seen in the following screen shot:

Moreover, please make sure that you’re using the latest version of Aspose.Words i.e. 10.7.0. You can download it from the following link:
https://downloads.aspose.com/words/java

I hope, this will help.

Best Regards,

Hello Awais,

Thanks for your mail.

I update to latest version, but still the generated document doesn’t recognize the spell check words in English. Its not indicating when I typed misspelled words.

Can you please send me your code in Java for generating this sample document with spell check.

Regards,
Siva.

Hi Siva,

Thanks for your inquiry. I used the following code:

Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);
builder.getFont().setLocaleId(1033);
ParagraphFormat paragraphFormat = builder.getParagraphFormat();
paragraphFormat.getTabStops().add(288, TabAlignment.LEFT, TabLeader.NONE);
builder.writeln("Source:" + ControlChar.TAB + "Name");
builder.insertParagraph();
paragraphFormat = builder.getParagraphFormat();
paragraphFormat.clearFormatting();
paragraphFormat.getTabStops().add(396, TabAlignment.LEFT, TabLeader.NONE);
builder.writeln("Source:" + ControlChar.TAB + "Name");
document.save("C://test//CreateSimpleTabDoc.doc");

Moreover, I have attached the generated document here for your reference. Please let us know if we can be of any further assistance.

Best Regards,