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.

Fri Nov 06, 2020 9:03 am

Why when i replace text i have an underline char at end of string ??
Looh example in this url:
https://elicat-my.sharepoint.com/:i:/g/personal/gianfranco_facchini_elicat_net/Ec8pwKRIY_RJoz06qd9pTJwB2KXGCtgoRqbKs64X1Vy38w?e=vcbOrM

This is my code :
Code: Select all
                            rect = find.Bounds;
                            float hRect = rect.Height;
                            float yRect = rect.Y;
                            rect.Height = (rect.Height - 0.5).ToFloat(); // per evitare che sovvrascriva delle righe bordi di tabella in cui è il testo
                            page.Canvas.DrawRectangle(PdfBrushes.White, rect); // pulisco il testo precedente
                            rect.Height = hRect; // memorizza altezza rettancolo testo originale
                            SizeF size = font.MeasureString(newText); // recupera la dimensione del nuovo testo in base al nuovo font da impostare
                            float widthstring = size.Width > rect.Width ? (size.Width) : rect.Width; // imposta nuova larghezza
                            float heightstring = size.Height> rect.Height ? (size.Height+1) : rect.Height; // imposta nuova altezza
                            // se la nuova altezza del etsto è maggiore della precedete allora reimposto posizione verticale
                            float diffHeigth = (size.Height - rect.Height);
                            if (diffHeigth > 0) rect.Y = (rect.Y - (diffHeigth/2));
                            RectangleF textRect = new RectangleF(rect.X, rect.Y, widthstring, heightstring);
                            page.Canvas.DrawString(newText, font, brush, textRect);

gianfranco.facchini
 
Posts: 6
Joined: Mon Nov 02, 2020 1:44 pm

Fri Nov 06, 2020 10:48 am

Hello,

Thanks for your inquiry.
I did an initial test with the latest Spire.PDF Pack (Hot Fix) Version:6.11.0 but did not reproduce it. To help us look into it, could you please provide us with your input file? You could send it to us ([email protected]) via email. Don’t worry, we promise to keep your document confidential and will not use it for any other purpose.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Nov 06, 2020 12:02 pm

Thanks for your support. I have soved. Is it a false probelm. When i salve the document and print o read it from loacl position the underline char not appar.
I'm sorry for your disturb.

gianfranco.facchini
 
Posts: 6
Joined: Mon Nov 02, 2020 1:44 pm

Mon Nov 09, 2020 2:20 am

Hello,

It doesn’t matter.
If you need any other help, just feel free to let us know. We are always here to help.
Have a nice day!

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF

cron