Everydaydiesel wrote:Hello, I am trying to use GetStringWidth() in wxPdfDocument and I was expecting the line drawn to be the same length as the text. Does anyone know what I am doing wrong?

Yes. You are using the Line method incorrectly. You have to specify the start point and the end point of the line. However, you used the intended length of the line as the x coordinate of the end point, but you started the line with an offset of 10 millimeter to the left border. Therefore the line is too short by 10 millimeter.