diff --git a/pdf.c b/pdf.c
index 80a196c19f806641565239d41b0dfac2cb67e073..8486fc3af98ecf8f75ddecd61e153428fc356901 100644
--- a/pdf.c
+++ b/pdf.c
@@ -2025,12 +2025,13 @@ act_txtobj(const HParseResult *p, void *u)
 			textlen += 1;
 			break;
 
+		case TW_Tqq:
+			textlen += 1;
 		case TW_TJ:
 			textlen += txte->tarray.flattened.nchars;
 			break;
 
 		case TW_Tq:
-		case TW_Tqq:
 			textlen += 1;
 		case TW_Tj:
 			textlen += txte->tstr.nchars;
@@ -2057,6 +2058,9 @@ act_txtobj(const HParseResult *p, void *u)
 			idx += 1;
 			break;
 
+		case TW_Tqq:
+			tstr[idx] = '\n';
+			idx += 1;
 		case TW_TJ:
 			memcpy(&tstr[idx], txte->tarray.flattened.text, txte->tarray.flattened.nchars);
 			idx += txte->tarray.flattened.nchars;
@@ -2066,7 +2070,6 @@ act_txtobj(const HParseResult *p, void *u)
 			break;
 
 		case TW_Tq:
-		case TW_Tqq:
 			tstr[idx] = '\n';
 			idx += 1;