diff --git a/pdf.c b/pdf.c
index daca61d7b54644090392502f15125b9bf4a0a3b9..fb8876be9c43b67e5753d6e85a7776c033de2f76 100644
--- a/pdf.c
+++ b/pdf.c
@@ -2048,6 +2048,7 @@ act_txtobj(const HParseResult *p, void *u)
 
 		// text positioning and showing operators
 		case TP_TD:
+			node->ts.line_spacing = txte->pos.ty;
 		case TP_Td:
 			if ( (*px == 0.0) && (*py == 0.0) ) { // initialize
 				*px = txte->pos.tx;
@@ -2084,7 +2085,7 @@ act_txtobj(const HParseResult *p, void *u)
 			memcpy(&tstr[idx], txte->tstr.text, txte->tstr.nchars);
 			idx += txte->tstr.nchars;
 			if (node->ts.font != NULL)
-				*px += txte->tarray.flattened.nchars * node->ts.font->fref.fontsize; // TODO:: handle character width from font description
+				*px += txte->tstr.nchars * node->ts.font->fref.fontsize; // TODO:: handle character width from font description
 			break;