Justified Paragraph Issue in Aspose.Words

Last post 08-23-2009, 1:04 PM by alexey.noskov. 3 replies.
Sort Posts: Previous Next
  •  08-18-2009, 3:08 AM 193657

    Justified Paragraph Issue in Aspose.Words

    Hello,

    When we use insertHtml method of  Aspose.Words to create PDF from word document, last line of the justified paragraph doesn't seem OK. The last line streches both sides which makes a bad effect.

    For example:

    <P align="justify">Müdürlüğünüzde X XXXX XX XX XXXXXXX XXX XX XX sicil sayılı dosyada işlem gören ve XXXXX Xxx. Taah. San. ve Tic. Ltd. Şti firmasına ihale ederek teslim almış olduğumuz Xxxxx Xxxxx Xxxxx Xxxxxx yapım işine dair İlgi (X) yazınız ile istenen bilgiler takip eden sayfada yer almaktadır. </P>

    Instead of align attribute, when we use <P style="TEXT-ALIGN: justify"> , paragraph seems OK. But our editor component does not allow us to do so. What can be the solution to this?

    Regards

     
  •  08-18-2009, 4:39 AM 193669 in reply to 193657

    Re: Justified Paragraph Issue in Aspose.Words

    Attachment: Present (inaccessible)

    Hi

    Thanks for your inquiry. I cannot reproduce the problem on my side. I use the following code for testing:


    // Create document and DocumentBuidler object

    Document doc = new Document();

    DocumentBuilder builder = new DocumentBuilder(doc);

     

    // Insert HTML.

    string html =

    "<P align=\"justify\">Müdürlüğünüzde X XXXX XX XX XXXXXXX XXX XX XX sicil sayılı dosyada işlem gören ve XXXXX Xxx. Taah. San. ve Tic. Ltd. Şti firmasına ihale ederek teslim almış olduğumuz Xxxxx Xxxxx Xxxxx Xxxxxx yapım işine dair İlgi (X) yazınız ile istenen bilgiler takip eden sayfada yer almaktadır. </P>";

    builder.InsertHtml(html);

     

    // Save output document in PDF format.

    doc.SaveToPdf(@"Test013\out.pdf");

    The output PDF looks fine (I attached it here). I use the latest version of Aspose.Words for testing. You can download it from here:
    http://www.aspose.com/community/files/51/file-format-components/aspose.words-for-.net-and-java/category1188.aspx

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  08-23-2009, 7:18 AM 194526 in reply to 193669

    Re: Justified Paragraph Issue in Aspose.Words

    Attachment: Present (inaccessible)

    Hello,

    Sorry for the late reply,

    Problem is caused by the <br> tags inside the justified <p> tag. Aspose treats the line after <br> tag as the last line and leaves it aligned to left. But the lines before the <br> tag are justified. I attached the the sample pdf output created via the below code.

    Regards

    PS: In the first post, I described the problem incorrectly, sorry for this.

    Aspose.Words.Document dosyaPdf = new Aspose.Words.Document();

    Aspose.Words.DocumentBuilder dosyaPdfPdfBuilder = new Aspose.Words.DocumentBuilder(dosyaPdf);

    dosyaPdfPdfBuilder.InsertHtml("<html><head><style type=\"text/css\">body{font-family:Arial;font-size:12px;} .baslik{font-weight:bold;}</style></head><body><center><table border=\"0\" width=\"100%\"><tr><td colspan=\"5\"><html><body><P align=justify>Müdürlüğünüzde X XXXX XX XX XXXXX XXX XX XX sicil sayılı dosyada işlem gören ve XXXXX İnş. Taah. San. ve Tic. Ltd. Şti firmasına ihale ederek teslim almış olduğumuz Xxxxx xxxx x scscsc xsxsxdcd df df d frfgrfgrgr rgrgrg<br><br><br><br>Xxxxxx Xxxxxx Xxxxxx yapım işine dair İlgi (1) .</P></body></html></td></tr></html>");

    dosyaPdfPdfBuilder.PageSetup.PaperSize = Aspose.Words.PaperSize.A4;

    dosyaPdfPdfBuilder.PageSetup.LeftMargin = Convert.ToDouble(Aspose.Words.ConvertUtil.MillimeterToPoint(20));

    dosyaPdfPdfBuilder.PageSetup.RightMargin = Convert.ToDouble(Aspose.Words.ConvertUtil.MillimeterToPoint(20));

    dosyaPdfPdfBuilder.PageSetup.LeftMargin = Convert.ToDouble(Aspose.Words.ConvertUtil.MillimeterToPoint(20));

    dosyaPdfPdfBuilder.PageSetup.RightMargin = Convert.ToDouble(Aspose.Words.ConvertUtil.MillimeterToPoint(20));

    dosyaPdf.Save(@"c:\deneme.pdf", Aspose.Words.SaveFormat.Pdf);

     
  •  08-23-2009, 1:04 PM 194536 in reply to 194526

    Re: Justified Paragraph Issue in Aspose.Words

    Hi

     

    Thank you for additional information. I managed to reproduce the problem on my side and linked your request to the appropriate issue. You will be notified as soon as it is resolved.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
View as RSS news feed in XML