Heading numbering display issue

Hi,

Please note that for headings with the level greater than 4, the numbering string overlaps the heading’s text.

Best regards,
Milan

Hello Milan,

The issue has already been logged it in our issue tracking system as PDFJAVA-6551. We will investigate this issue in detail and will keep you updated on the status of a correction. We apologize for your inconvenience.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi Nayyer,

Please update the status of this issue in order to decide about the way we can handle this on our side until the fix is released.

Best regards,
Milan

Hello Milan,

I am pleased to inform you that the issue that you have reported earlier, has been resolved and I have contacted the development team to share the hotfix related to this problem. We really appreciate your patience.

Hi milan,

I think you can use the method Heading.setLabelWidth(float) to enlarge the space for label. I'm very sorry to bring you so much trouble.

Thank you for your patience.

Hi Sandy.Zhang,

Your solution works very well.

Thank you,
Milan

Hi,

Thus, there still is an issue. I can set the label width according to the heading level, and it works good for heading numbers under 10, like : 1.3.5.2.3 (every number is under 10). If the numbers in the label are greater than 10, or 100, than I cannot use my rule (that was setting the label to ~11*(heading level)), because the label width is now to small, and will overwrite the heading text. As you can note from “Heading labels” , I cannot get the user label string. If this would be possible, I could find the number of characters in the label, and set the label width according to this.

Please advice,
Milan

Hello Milan,

Please share the code snippet that you are using so that we can test the issue at our end. In my test, I am using a variable to hold the heading level value, and then using the same variable to set the label width with certain proportion, and label width is adjusting properly, but in order for us to have a deep insight into this problem we need to check the code that you are using.

We apologize for your inconvenience.


Hy Nayyer,

As I was saying, I’m using the same principle as the one described by you : “using a variable to hold the heading level value, and then using the
same variable to set the label width with certain proportion” - my proportion is 10. But note what happens when the numbers in label are greater than “9”, or “99” :

Pdf pdf1 = new Pdf();
Section sec1 = pdf1.getSections().add();

//this looks good in the output
for(int i=1; i < 10 ; ++i)
{
Heading heading = new Heading(pdf1,sec1, i);
heading.getSegments().add(“Heading_” + i);
heading.setLabelWidth(i * 10);
sec1.getParagraphs().add(heading);
}

Heading headingA = new Heading(pdf1,sec1, 2);
headingA.getSegments().add(“Heading_2”);
headingA.setIsAutoSequence(true);
headingA.setStartNumber(1);
headingA.setLabelWidth(2 * 10);
sec1.getParagraphs().add(headingA);

//this looks good just for the labels where numbers are smaller or equal with “9”
for(int i=1; i < 200 ; ++i)
{
Heading headingB = new Heading(pdf1,sec1, 2);
headingB.getSegments().add(“Heading_2”);
headingB.setLabelWidth(2 * 10);
sec1.getParagraphs().add(headingB);
}

FileOutputStream out = new FileOutputStream(new File(“C:/Temp/HeadingNumbering.pdf”));
pdf1.save(out);

If I could find the number of characters in the label, I could obtain better results, even if the “.” and “5” character, for example have different widths.

Thank you,
Milan

Hello <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Milan,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I've tested the scenario and I am able to notice the problem that you have stated. We are looking into the details of this problem, and will keep you updated with the status of correction .We apologize for your inconvenience.

Hi milan,

I am very sorry to reply to you until now, Thank you for your patience.

As to your problem, if you know your Heading in advance, you can set the width according to digits the Heading have.

At present, we set a fixed margin for the Heading in our product. What you expects is the margin can auto-fit the Heading number. We maybe will support this function in the future release.

Thank you for using our product.