Hello I have encountered 2 problems when using Chinese to generate PDF

ConsoleApp2.zip (240.4 KB)
Hello I have encountered 2 problems when using Chinese to generate PDF

  1. there is a hyphen after each sentence

  2. the right side cannot be aligned
    but I use the English effect is very good
    My code is
    // Open document
    Document doc = new Document();
    // Add page to pages collection of Document object
    Page page = doc.Pages.Add();
    TextBuilder builder = new TextBuilder(page);
    // Create text paragraph
    TextParagraph paragraph = new TextParagraph();
    // Set subsequent lines indent

         paragraph.VerticalAlignment= VerticalAlignment.Top;
         paragraph.HorizontalAlignment= HorizontalAlignment.FullJustify;
         paragraph.Justify = true;
         paragraph.FormattingOptions.HyphenSymbol = string.Empty;
         // Specify the location to add TextParagraph
         paragraph.Rectangle = new Aspose.Pdf.Rectangle(100, 600, 400, 200);
         // Specify word wraping mode
         paragraph.FormattingOptions.WrapMode = TextFormattingOptions.WordWrapMode.ByWords;
         // Create text fragment
         TextFragment fragment1 = new TextFragment("文学,在广义上,是任何单一的书面作品,I’m trying to create a TextParagraph object 或用文字写作来传达思想、表达情感、发挥想像的所有著作,此时又称文学作品。文学写作则是一种艺术形式,或被认为具有艺术或智力价值的任何单一作品,通常是由于以不同于普通用途的方式部ph(); paragraph.Rectangle = new Rec署语言。中国先秦时期将以文字写成的作品都统称为文学,魏晋以后才逐渐将文学作品单独列出。在现代,则通常将文学分为韵文、散文、剧本、小说四大类别,是文化的重要表现形式,以不同的流派表现内心情感和再现一定时期和一定地域的生w, but nothing worked:  paragra活。这个概念,又随著时间的推移而改变了意义:现在它可以扩大到非书面的口头艺术形式,可以与语言或文字本身de.ByWords;var textBuilder = new TextBuilder(page); tex配合,因此很难就其起源达成一致。印刷技术的发展使得书面作品的分布和扩散成为可能,最终导致了网络文学。");
         // Add fragment to paragraph
         fragment1.TextState.HorizontalAlignment = HorizontalAlignment.Right;
         paragraph.AppendLine(fragment1);
    
         // Add paragraph
         builder.AppendParagraph(paragraph);
    
         // Save resulting PDF document.
         doc.Save("test.pdf");
    

QQ截图20230422163804.jpg (91.6 KB)

@xiaobaobao

Can you please make sure that all the fonts required for Chinese characters support are installed in your system? Can you please share the generated PDF for our reference as well? We will test the scenario in our environment and address it accordingly.

Thank you very much for your reply
I’ve sent the source code at the top
I can’t align left and right in mixed English and Chinese
Only plain Chinese or plain English can be aligned left and right
I want to align in mixed English and Chinese
Also can I remove the hyphen in Chinese?

@xiaobaobao

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54455

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Will my two questions be solved?

@xiaobaobao

Sure, we will check and resolve both of your issues while working on the ticket and let you know once it is resolved.

Thank you very much for your reply
Thank you for all the work you have been doing
Aspose is a great product!

@xiaobaobao

Thanks for the feedback. We will inform you once we have some updates about ticket resolution.