Issue with html input inserting itno Worddoc and editing Worddoc

Hi Sonam,

Thanks for your inquiry. I will do analysis of this problem one more time. Please spare me some time for the investigation of this issue. I will get back to you as soon as possible.

Best regards,

Hi Awais,

Kindly let me know once you are done with the above .

Thanks
Sonam

Hi Sonam,

Thanks for being patient. Please try doing the following changes:

level0.setNumberPosition(levelnumber * 11); 
level0.setTabPosition(20 + (levelnumber * 11));
level0.setTrailingCharacter(ListTrailingCharacter.length);
level0.setTextPosition(level0.getTabPosition());

I hope, this helps.

Best regards,

Hi Awais,

The above code provided by you adds spacing between lines.But Before I can check this issue.Please confirm my earlier issue in which the aspose is not able to get relative path to image from html and paste that image into Word.You have provided the code for that fix.But Still the issue exists.
Iss ue # :: 554903
Please assist on this.

Thanks
Sonam Arora

Hi Sonam,

Thanks for your inquiry. I checked your scenario again and was not able to reproduce this issue on my side. Could you please double check if your’re using the latest version of Aspose.Words on your side? Please unzip “aspose-words-14.5.0-jdk16.jar” file, navigate to ‘META-INF’ folder and then open ‘MANIFEST.MF’ with Notepad to verify the version number.

Best regards,

Hi Awais,

Thanks for reply…
The spacing is working good for arrow and hyphen bullets.
Secondly,we are using the latest version i.e : aspose-words-14.5.0-jdk16.jar .
The issue is aspose not understanding the relative path,Let me first check this on our side.

Well thanks.

Regards
Sonam

Hi Awais,

As confirmed above :

  1. Spacing is good for arrow and hyphen bullets on word file.
  2. Was facing issue with relative path that we corrected on java side by replacing with absolute path.

We are facing the below issue now:

  1. Arrow and Hyphen bullets which are rendering on word file are not rendering good on PDF.
  2. These arrow and hyphen bullets are added as images as attached.

Steps:

  1. Arrow and Hyphen bullets are taken as images(path is defined ) from rich text editor in html .attached is the inputhtml having path of bullet images.
    2.This html is inserted into default Word document as explained earlier.
  2. The html have other bullets too(like disc ,circle and square)
  3. This word document containing bullet images and other normal bullets is then corrected for bullet to text and bullet to bullet spacing and line spacing .The Code snippet for same is attached.
  4. After the above step the worddocument is save and given to Indesign tool for rendering it into PDF.Indesign too of our uses xPresso plugin to convert a word file to PDF.
    6.However in PDF the bullet images are not rendering .
    Issue ::

7 The Issue is that the Indesign tool is not taking images as bullets on PDF.
8. For this we need to correct this in our code itself that is we need to take ASCII values of arrow and hyphen bullets and then insert using these ASCII values of arrow and hyphen in word document.
9. please help to get the code snippet in aspose to read the ASCII values whereever the bullets are arrow and hyphen.And how to determine that the bullet is arrow or hyphen.

After these bullet images as symbols are added to word document using aspose code .How can we adjust these symbols spacing using aspose itself.As these symbols added as ASCII values are not able to get adjusted using attached code snippet.

Kindly let me know if you have any queries in requirement itself.

Attached are the necessary files for your help.

Appreciate for soon reply.

Thanks
Sonam

Hi Sonam,

Thanks for your inquiry. The problem does not occur when rendering to PDF directly using Aspose.Words. It seems Adobe InDesign is not able to correctly process Aspose.Words generated documents. We will check this and get back to you soon.

Secondly, in Microsoft Word, go to Insert tab, then click on ‘More Symbols’ in Symbol drop down. This opens Symbol dialog box. There you can find ascii character codes of many symbols.

Best regards,

Hi Awais,
A pint to note here :
1 We are rendering PDF from aspose generated docx using xPresso pluggin.We cannot provide details of this licensed product.
2. I am aware of getting the symbols on Microsoft word .Ths issue is ::

How to read ascii values using Aspose code.
With java code ,I am able to read all symbols in aspose word and store the key and values in a map like :

symbolMap : {3,→}

- Now we have the code as attached where we are reading the word document to find any bullet(using paragrapgh class) and adjust its spacing that is bullet to text spacing ,line to line spacing using aspose code .
- Can you please suggest how to read this word (containing symbols is map values) and adjust spacing of symbols from text and line to line spacing containing symbols using aspose code?Is there any functionality in aspose to read symbols ?

Thanks
Sonam Arora

Hi Awais,

In a very simple way How to make symbols to treat as bullets?

Attatched the input File :: MyList_bullet
and Output File :: output

The symbols are not treated as bullelts as u can see in output word file and hence are not adjusted like other bullets using paragrapgh class.

Is there a way in aspose to read these symbols(or their ascii values) and treat them as bullets using any class in Aspose API???

Thanks
Sonam

Hi Awais,

Any update?Its quite urgent…

Thanks
Sonam Arora

Hi Sonam,

Thanks for your inquiry. Please try executing the following code which identifies all special symbols in your document and returns their ascii character code:

Document doc = new Document(getMyDir() + "MyList_bullet.doc");
for (Run run : (Iterable<Run>)doc.getChildNodes(NodeType.RUN, true))
{
    Run currentRun = run;
    do
    {
        if (currentRun.getText().length() > 1)
        {
            currentRun = SplitRun(currentRun, 1);
        }
        else
        {
            Pattern p = Pattern.compile("[^a-z0-9 ]", Pattern.CASE_INSENSITIVE);
            String str = currentRun.toString(SaveFormat.TEXT);
            Matcher m = p.matcher(str);
            boolean b = m.find();
            if (b)
                System.out.println("Special character: " + str.toCharArray()[0] + " Code: " + (int)str.toCharArray()[0]);
        }
    }
    while (currentRun.getText().length() > 1);
}
private static Run SplitRun(Run run, int position) throws Exception {
    Run afterRun = (Run)run.deepClone(true);
    afterRun.setText(run.getText().substring(position));
    run.setText(run.getText().substring(0, position));
    run.getParentNode().insertAfter(afterRun, run);
    return afterRun;
}

I hope, this helps.

Best regards,

Hi Awais,

With above code I am able to read the ascii value of symbols.Is there any way to make the particular symbol to treat as list.so that I can adjust there spacing .That is

if (b) {
    System.out.println("Special character: " + str.toCharArray()[0] + " Code: " + (int)str.toCharArray()[0]);
    //want to adjust spacing of this special character??
}

The above line of code simply prints the ascii value.is there any way if I can handle its spacing using currentrun?
As I cannot see any method in current run to handle position of particular symbol.

Thanks
Sonam

Hi Sonam,

Thanks for your inquiry. As suggested here, you can use the following code to make these symbols appear in lists:

Document doc = new Document(MyDir + "in.docx");
// Create a list based on one of the Microsoft Word list templates.
List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);
// Completely customize one list level.
ListLevel level1 = list.getListLevels().get(0);
level1.setNumberStyle(NumberStyle.ORDINAL_TEXT);
level1.getFont().setName("Wingdings");
level1.setNumberFormat("\uf0af");
for (Paragraph para : (Iterable)doc.getChildNodes(NodeType.PARAGRAPH, true))
{
    if (para.isListItem())
    {
        para.getListFormat().setList(list);
    }
}
doc.save(MyDir + "Out.docx");

I hope, this helps.

Best regards,

Hi Awais,
Appreciate for your response here.I was not able to check the above utility due other priorities.
I will try the above code and let you know if I face any issue.

Thanks

Regards
Sonam