Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

Right-aligned tabstop with line breaks bug

Last post 02-14-2008, 8:26 AM by Hans.firefox. 2 replies.
Sort Posts: Previous Next
  •  12-16-2007, 9:51 PM 106369

    Right-aligned tabstop with line breaks bug

    Hi,

    Using Aspose.Pdf 3.6.1.0, I've got a bug with right-aligned tabstops and line break. Whenever I use a multi-line text paragraph with a right-aligned tabstop and "\n" to break lines, only the last line has the correct tabstop, all others are "too left".

    Any ideas ?

    Thanks a lot,

    Dominic.

    The following code to illustrate the problem:

    Aspose.Pdf.Pdf pdfDocument = new Aspose.Pdf.Pdf();
    Aspose.Pdf.Section pdfSection = pdfDocument.Sections.Add();

    Aspose.Pdf.Text pdfText;
    Aspose.Pdf.Segment pdfSegment;

    pdfText = new Aspose.Pdf.Text();
    pdfSection.Paragraphs.Add(pdfText);

    pdfText.TabStops = new Aspose.Pdf.TabStops();
    Aspose.Pdf.TabStop pdfTabStop = pdfText.TabStops.Add();
    pdfTabStop.Position = 100 * MM2PT;
    pdfTabStop.AlignmentType = Aspose.Pdf.TabAlignmentType.Right;

    // Line 1
    pdfSegment = new Aspose.Pdf.Segment("Left text 1");
    pdfText.Segments.Add(pdfSegment);

    pdfSegment = new Aspose.Pdf.Segment("\tRight text 1");
    pdfText.Segments.Add(pdfSegment);

    // Line 2
    pdfSegment = new Aspose.Pdf.Segment("\nLeft text 2");
    pdfText.Segments.Add(pdfSegment);

    pdfSegment = new Aspose.Pdf.Segment("\tRight text 2");
    pdfText.Segments.Add(pdfSegment);

    // Line 3
    pdfSegment = new Aspose.Pdf.Segment("\nLeft text 3");
    pdfText.Segments.Add(pdfSegment);

    pdfSegment = new Aspose.Pdf.Segment("\tRight text 3");
    pdfText.Segments.Add(pdfSegment);

    pdfDocument.Save("c:\\temp\\pdfTest.pdf");

     
  •  12-17-2007, 10:22 AM 106438 in reply to 106369

    Re: Right-aligned tabstop with line breaks bug

    Hi,

    I have tested the code and was able to reproduce the error. I have logged this as PDFNET-4183. We will try to solve this as soon as possible.

    Thanks.

     
  •  02-14-2008, 8:26 AM 113374 in reply to 106438

    Re: Right-aligned tabstop with line breaks bug

    Hi,

    The new hot fix Aspose.Pdf 3.6.2.0 has been published and the fix of PDFNET-4183 is included. Please download it follow this link: http://www.aspose.com/Community/Files/
    Thanks.

    Best regards.

    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
View as RSS news feed in XML