From d1f199c7aea0cd2e535324d24a0d70d5dfc53d1f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 11 Jun 2021 11:33:41 -0400 Subject: [PATCH] Hard wrap text in README.md --- testpdfio.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/testpdfio.c b/testpdfio.c index 8b78940..cc7eaba 100644 --- a/testpdfio.c +++ b/testpdfio.c @@ -1940,7 +1940,23 @@ write_text_test(pdfio_file_t *pdf, // I - PDF file goto error; if (!pdfioContentSetFillColorDeviceGray(st, 0.0)) goto error; - if (!pdfioContentTextShow(st, line)) + if (strlen(line) > 81) + { + char temp[82]; // Temporary string + + memcpy(temp, line, 80); + temp[80] = '\n'; + temp[81] = '\0'; + + if (!pdfioContentTextShow(st, temp)) + goto error; + + if (!pdfioContentTextShowf(st, " %s", line + 80)) + goto error; + + plinenum ++; + } + else if (!pdfioContentTextShow(st, line)) goto error; plinenum ++;