How to findout Pageno of "Run" Node

*awais.hafeez:
Hi Yanlin,

Thanks for your inquiry. I suppose you should just call Document.UpdateListLabels method to update list label properties such as LabelValue and LabelString for each ListLabel object in the document. Secondly, to get the value of a list item you can use the ListLabel class and the ListLabel.LabelValue member. I hope, this helps.

Best regards,*

Should I use ListLable.LableString instead of ListLable.LableValue? for example, when the list number is 3.3, ListLable.LableValue will equal 3, but ListLable.LableString will equal 3.3(That is what I want.).

Please reach the colored lines below, and give me an advice.

Another question:
The bullet list nested in a arabic list. All these lists are headings.How can I get all these text?
Please open the attachements to get more infomation.

-----
my test result:
-----

section:{0}
PageStartingNumber:1
sec.PageSetup.PageStartingNumber:Arabic
sec.PageSetup.RestartPageNumbering:False
sec.PageSetup.PageNumberStyle:Arabic
parag.ListFormat.ListLevelNumber:0
parag.ListFormat..ListLevel.NumberStyle:Arabic
parag.ListFormat..ListLevel.StartAt:1
parag.ListLabel.LabelString:1
parag.ListLabel.LabelValue:1
parag Text:1目标
parag OutlineLevel:Level1
parag page number:4
parag end page number:4
parag.ListFormat.ListLevelNumber:0
parag.ListFormat..ListLevel.NumberStyle:Arabic
parag.ListFormat..ListLevel.StartAt:1
parag.ListLabel.LabelString:2
parag.ListLabel.LabelValue:2
parag Text:2工程类型
parag OutlineLevel:Level1
parag page number:4
parag end page number:4
parag.ListFormat.ListLevelNumber:0
parag.ListFormat..ListLevel.NumberStyle:Arabic
parag.ListFormat..ListLevel.StartAt:1
parag.ListLabel.LabelString:3
parag.ListLabel.LabelValue:3
parag Text:3流程描述
parag OutlineLevel:Level1
parag page number:4
parag end page number:4
parag.ListFormat.ListLevelNumber:1
parag.ListFormat..ListLevel.NumberStyle:Arabic
parag.ListFormat..ListLevel.StartAt:1
parag.ListLabel.LabelString:3.1
parag.ListLabel.LabelValue:1
parag Text:3.1系统设计
parag OutlineLevel:Level2
parag page number:5
parag end page number:5
parag.ListFormat.ListLevelNumber:1
parag.ListFormat..ListLevel.NumberStyle:Arabic
parag.ListFormat..ListLevel.StartAt:1
parag.ListLabel.LabelString:3.2
parag.ListLabel.LabelValue:2
parag Text:3.2实施
parag OutlineLevel:Level2
parag page number:6
parag end page number:6
parag.ListFormat.ListLevelNumber:1
parag.ListFormat..ListLevel.NumberStyle:Arabic
parag.ListFormat..ListLevel.StartAt:1
parag.ListLabel.LabelString:3.3
parag.ListLabel.LabelValue:3
parag Text:3.3试运行

Hi Yanlin,

Thanks for your inquiry. LabelValue is used to get the position of the paragraph in current level of the list. If we have a list with multiple level then this will tell us what position it is on that particular level. I think, to display the complete paragraph text, you should just output the Paragraph node to text format as follows:

builder.Writeln("parag Text:" + parag.ListLabel.LabelString + parag.Range.Text);
builder.Writeln("parag Text:" + parag.ToString(SaveFormat.Text).Trim());

I hope, this helps.

Best regards,

Hi awais,

the phrase builder.Writeln(“parag Text:” + parag.ToString(SaveFormat.Text).Trim()); cant print bullet character into file.

I see some code like these:

level2.NumberFormat = “\xf0af”; // A bullet that looks like some sort of a star.
or
level2.NumberFormat = ChrW(&Hf0af).ToString() ’ A bullet that looks like some sort of a star.

question: where can I get definition of these codes like “\xf0af”?

I find these codes from the manual with key word ListTemplate:

// Create a bulleted list based on one of the Microsoft Word list templates
// and apply it to the current paragraph in the document builder.
builder.ListFormat.List = doc.Lists.Add(ListTemplate.BulletDiamonds);
// There are 9 levels in this list, lets try them all.
for (int i = 0; i < 9; i++)
{
    builder.ListFormat.ListLevelNumber = i;
    builder.Writeln("Level " + i);
}

How can I get bullet character and print them into ms word? such as bulletdiamonds, and something like that.

Hi Yanlin,

Thanks for your inquiry. Please use the following code snippet to be able to print the bullet symbols and their hexadecimal character code:

Document doc = new Document(@"C:\Temp\demo.doc");
doc.UpdateListLabels();
DocumentBuilder builder = new DocumentBuilder();
foreach (Paragraph p in doc.GetChildNodes(NodeType.Paragraph, true))
{
    if (p.IsListItem)
    {
        char[] chars = p.ListLabel.LabelString.ToCharArray();
        StringBuilder stringBuilder = new StringBuilder();
        foreach (char c in chars)
        {
            stringBuilder.Append(((Int32)c).ToString("X"));
        }
        String textAsHex = stringBuilder.ToString();
        builder.Font.Name = "Arial";
        builder.Write("The charctaer code of symbol'");
        builder.Font.Name = "Wingdings";
        builder.Write(p.ListLabel.LabelString);
        builder.Font.Name = "Arial";
        builder.Writeln("' is " + textAsHex);
    }
}
builder.Document.Save(@"C:\Temp\out.docx");

I hope, this helps.

Best regards,

The issues you have found earlier (filed as WORDSNET-2978) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(80)

The issues you have found earlier (filed as WORDSNET-2978) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)

Hello,

Faces with the same issue (initial one), I need to get page number from nodes.
Please, could you provide the same workaround solution “PageFinder.zip” and PageNumbersTest.zip in java?
Thus, the proposed code is written in c#.

Thank you for your help.

Regards

Samuel VILLENEUVE
Sopra group.

Hi Samuel,

Thanks for your inquiry. PageFinder.java and PageSplitter.java files can be found in the attachment posted here.

Best regards,

Hello,

Thank you. It works well as expected.

Regards

Samuel VILLENEUVE

Hello,

I’m using the getPage method of class PageFinder.
I’m encounter a memory issue in some case when using this workaround.

Caused by: java.lang.OutOfMemoryError: Java heap space
at asposewobfuscated.ëCW.ëzE(Unknown Source)
at com.aspose.words.ëF.ësP(Unknown Source)
at com.aspose.words.DocumentBuilder.ëj9(Unknown Source)
at com.aspose.words.DocumentBuilder.ëUX(Unknown Source)
at com.aspose.words.DocumentBuilder.ëX(Unknown Source)
at com.aspose.words.DocumentBuilder.insertField(Unknown Source)
at fr.aspose.words.pagefinderutility.PageFinder.insertFieldsAtInlineLevel(PageFinder.java:292)
at fr.aspose.words.pagefinderutility.PageFinder.findPageNumbersOfNodes(PageFinder.java:181)
at fr.aspose.words.pagefinderutility.PageFinder.checkHasFoundPageNumbers(PageFinder.java:549)
at fr.aspose.words.pagefinderutility.PageFinder.getPage(PageFinder.java:50)

Please, could you tell us if it exists now the same feature (getting the page number of a node) implemented in the last release of Aspose.Words or if it’s scheduled?

Thank you.

Regards.

Hello,

Please, could you give us a status on analysis of this issue?

Thank you.

Regards

Hi Samuel,

Thanks for your inquiry. Sure, Aspose.Words has introduced a new Layout namespace that provides classes allowing access to information such as on what page and where on a page particular document elements are positioned, when the document is formatted into pages.

For example, the LayoutCollector class collects mapping of document nodes to layout objects and computes page numbers of nodes.

When you create a LayoutCollector and specify a Document document object to attach to, the collector will record mapping of document nodes to layout objects when the document is formatted into pages.

You will be able to find out on which page a particular document node (e.g. run, paragraph or table cell) is located by using the GetStartPageIndex, GetEndPageIndex and GetNumPagesSpanned methods. These methods automatically build page layout model of the document and update fields if required.

I hope, this helps.

Best regards,

Hello,

Thank you very much for your help.
By using LayoutCollector class, I can find successfully page number of given node.
It solved my issue about “java.lang.OutOfMemoryError: Java heap space”.

Regards