Insert Bullets in front of Text

Last post 03-23-2009, 9:27 AM by codewarior. 1 replies.
Sort Posts: Previous Next
  •  03-20-2009, 3:55 AM 170757

    Insert Bullets in front of Text

    Hi

    I have a requirement where i have to Insert bullet in front of text...

    Please consider the below sample:

    • Topic Name

    I am getting the text as follows from the oracle '<ul><li>' || Topic Name || '</li></ul>'

    When it is actually printed in the PDF lot of gap appears between the bullet and Topic Name.

    Can any one please help me in solving this problem.


    This message was posted using Page2Forum from Aspose.Pdf for .NET and Java - Documentation
     
  •  03-23-2009, 9:27 AM 171024 in reply to 170757

    Re: Insert Bullets in front of Text

    Hello Aneesh,

    Thanks for considering Aspose.

    First of all I really apologize for replying you so late. In fact we have been trying to figure out a solution for your requirement. I've tested the scenario and have noticed that the distance between the List consents and the bullet sign is quite much. And I am sorry to inform you that we might be able to resolve this problem in short time.

    As a workaround, I would suggest you to use Headings instead of HTML list. I know you are getting the contents from Oracle database, but you can parse the contents and eliminate the <ul> <li> tags programmatically, and create heading based over rest of the contents. Please take a look over the following code snippet, in which I've created a Heading object which generates output identical to your requirement. I know its bit difficult to follow the above specified approach but I am afraid at the moment I might not be able to suggest you something better than this one.

    [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();

    // Create an object of heading
    Heading
    heading1 = new Heading(pdf1, sec1, 1);
    // create a segment to be added to heading
    Segment segment1 = new Segment(heading1);
    // Add the segement1 to segements collection of Heading
    heading1.Segments.Add(segment1);
    // Specify the value for Heading contents.
    segment1.Content = " Topic Name ";
    // Enable the value to display the HTML contents (if the contents from database contain other HTML formatting objects)
    heading1.IsHtmlTagSupported = true
    ;
    // Set the user label for Heading
    heading1.UserLabel = "Bullet1";
    // Set the Label font size of heading
    heading1.LabelFontSize = 6;
    // Set the value of distance between Heading label & Contents
    heading1.LabelWidth = 8;
    // Add the Heading to Paragraphs collection of Section
    sec1.Paragraphs.Add(heading1);

    // Save the Pdf file
    pdf1.Save("d:/pdftest/headings123.pdf");

    For further information, please visit Working with Headings

    Please take a look an in case of any further query, feel free to contact.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML