I'm trying to print in PDF two columns of information that contain some strings that the user inputs. This is my code so far:
string s = "";
s = s + string.Format("{0,-60}", "Name: " + name);
s = s + string.Format("{0,15}","AAA: ");
p1.Add(s);
document.Add(p1);
string p = "";
p = p + string.Format("{0,-60}", "Surname: " + surname);
p = p + string.Format("{0,15}","BBB: ");
p2.Add(p);
document.Add(p2);
string r = "";
r = r + string.Format("{0,-60}", "School: " + school);
r = r + string.Format("{0,15}","CCC: ");
p3.Add(r);
document.Add(p3);
If the user enters, for example, "John Edward Jr." for name, "Pascal Einstein W. Alfi" for surname and "St. John" for school, then the expected output is something like this:
Name: John Edward Jr.________________AAA:
Surname: Pascal Einstein W. Alfi_______BBB:
School: St. John___________________CCC:
I suppose the spaces in every string name, surname and school are the problem. How can I deal with this?
EXPECTED OUTPUT:
Name: John Edward Jr._________________AAA:
Surname: Pascal Einstein W. Alfi_______BBB:
School: St. John________________________CCC: