Can We remove Label Number before Headings in PDF

Hi!

I have a problem, I dont want to show the label number before the headings.

how can i achieve this?

please help

Thanks.
Adi!

Hi,

Besides using the predefined numbering styles, the Heading class also provides the leverage to use system labels and even custom user-defined labels. According to your requirement, you can specify the user label with no value, so ultimately the resultant heading in PDF would be without a label. Please try using the following code snippet.

[C#]

//Instantiate the Pdf object by calling its empty constructor
Pdf pdf1 = new Pdf();

//Create the section in the Pdf object
Aspose.Pdf. Section sec1 = pdf1.Sections.Add();
Heading heading1 = new Heading(pdf1, sec1, 1);
Segment segment1 = new Segment(heading1);
heading1.Segments.Add(segment1);

// content of the heading
segment1.Content = "NO - Label Number";

// user defined label with no value
heading1.UserLabel = "";
// add the heading object to paragraphs collection of section1
sec1.Paragraphs.Add(heading1);

// save the PDF file
pdf1.Save(@"d:\pdftest\UserHeading_Issue.pdf");

For more information please visit Apply User Defined Bullets.

It works, but it does'nt solove my problem, I wish to remove Label from only Headings not from the TOC. This arrangement is removing from the both.

Thanks

Hi,

As a workaround, you can set the label color value to "White" for the heading. Please try using the following code line. In case it does not resolve your problem, please feel free to share.

[C#]

_heading.LabelColor = new Aspose.Pdf.Color("White");

It can be done, but in this case, how can we remove the left Margin for heading?

Hi,

For the reason you can specify the Left margin value as negative. Please try using the following code line. In case if it does not satisfy your requirement, feel free to share.

[C#]

_heading.Margin.Left = -20;    //or any other value that suits the condition

It works :slight_smile: thanks a lot!