Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Nov 06, 2019 4:47 pm

Hi team,
I use the function
  doc.Pages [0] .Canvas.DrawString (....)
to add mutiline text (the text is very long).
But there is a problem, when the text exceeds the length of the pdf file, it automatically descends the line of text and it makes the text lose meaning (the meaning of the text).
As in the HTML environment, there is css3 with attribute is word-break,
textarea {
word-break: break-all;
}
So how to use Spire.Pdf?
Note: my text uses UTF8, I tried it with English and it didn't get errors
Hope the helping
thank you

Text typing

thuytd86
 
Posts: 13
Joined: Wed Oct 16, 2019 4:17 am

Thu Nov 07, 2019 6:18 am

Hi,

Thanks for your inquiry.
I made an initial test but didn't reproduce your issue, the word wouldn't be broke when I draw a long text on the Pdf page.
To help us investigate your issue accurately, please offer us your input string and the complete code you were using which could reproduce your issue directly. You could upload them here or send us(support@e-iceblue.com) via email.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Fri Nov 08, 2019 7:34 am

Hi,
I have PDF file.
My code
static void Main(string[] args)
{

string pdffile = @"C:\fileky.pdf";
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile(pdffile);
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Times new roman", 13f, FontStyle.Regular), true);
PdfBrush brush = PdfBrushes.Blue;
float postx = 27.98004f;
float posty = 596.5847f;
float widthvalue = 474.804535f;
string Contents = "Sáng 8/11, Bộ trưởng Thông tin & Truyền thông Nguyễn Mạnh Hùng lần đầu đăng đàn trả lời chất vấn Quốc hội. Ông cũng là thành viên \n- Chính phủ thứ tư trả lời chất vấn tại kỳ họp Quốc hội lần này. Chiều nay, cùng ông Nguyễn Mạnh Hùng, \n-Bộ trưởng Công an Tô Lâm, Bộ trưởng Văn phòng Chính phủ Mai Tiến Dũng và Phó thủ tướng Vũ Đức Đam sẽ tham gia trả lời, làm rõ các vấn đề liên quan.\nTuy nhiên, người đứng đầu ngành cũng khẳng định không đặt mục tiêu thay thế mạng xã hội nước ngoài. \"Việt Nam đã hội nhập, mở cửa kêu gọi đầu tư. Nhưng ai vào Việt Nam làm ăn đều phải tuân thủ pháp luật Việt Nam, giúp Việt Nam thịnh vượng lên";
RectangleF rectf = new RectangleF(postx, posty, widthvalue, 0);
PdfStringFormat format = new PdfStringFormat();
doc.Pages[0].Canvas.DrawString(Contents, font, brush, rectf, format);
string result = @"C:\filekyOK.pdf";
doc.SaveToFile(result);
doc.Close();

}
I am looking for a PdfStringFormat method but I do not understand the uses,
Please help me how to make my text automatically down the line of meaning,
You can view the Text when users type from the web interface and the resulting file,
Note that the width of the text is decided by the user

thuytd86
 
Posts: 13
Joined: Wed Oct 16, 2019 4:17 am

Fri Nov 08, 2019 9:08 am

Hi,

Thanks for your information.
I tested your file and did notice the issue you mentioned, I have logged it into our bug tacking system. Once there is any progress, we will inform you.
Sorry for the inconvenience caused.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Tue Nov 12, 2019 1:41 am

Hi,
Is there a solution to help me solve this problem yet,
I have no way to solve it yet
Tell me what to do

thuytd86
 
Posts: 13
Joined: Wed Oct 16, 2019 4:17 am

Tue Nov 12, 2019 8:43 am

Hi,

Thanks for your reply.
I checked the state of your issue in our bug tacking system. Sorry that it has not been solved yet. I have urged our Dev team.
Please share us little more time, once there is any progress, we will inform you ASAP. Sorry for the inconvenience caused.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Thu Nov 21, 2019 1:58 am

Hi Team,
Let me know, is there any solution to help us

thuytd86
 
Posts: 13
Joined: Wed Oct 16, 2019 4:17 am

Thu Nov 21, 2019 9:03 am

Hi,

Thanks for your inquiry.
I checked the state of your issue in our bug tacking system. Sorry that it has not been solved yet. I have improved the priority of your issue.
Once there is any progress, we will inform you ASAP. Sorry for the inconvenience caused.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Thu Dec 05, 2019 11:09 am

Hi,

Hope you are doing well.
Glad to inform you that the previous issue has been resolved in Spire.PDF Pack(Hot Fix) Version:5.12.3. Welcome to download and test it from the following links.
Our website link: https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
NuGet link: https://www.nuget.org/packages/Spire.PDF/5.12.3

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Mon Dec 09, 2019 7:18 am

Thank you very much team,
It's great it works very well,
So, it did not work on the free version,

thuytd86
 
Posts: 13
Joined: Wed Oct 16, 2019 4:17 am

Mon Dec 09, 2019 8:26 am

Hi,

Thanks for your feedback. Glad to hear that your issue has been resolved.
Since we update free version irregularly, we suggest you use the latest commercial version because the fixes and new features are always included in it firstly.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.PDF