From 5af0f0b726ba5f5ca2e46078ba8cdd8911e60a38 Mon Sep 17 00:00:00 2001 From: VahidN Date: Thu, 9 May 2019 21:59:52 +0430 Subject: [PATCH] Verify_Issue37_CanBe_Processed --- .../Issues/Issue37.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue37.cs diff --git a/src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue37.cs b/src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue37.cs new file mode 100644 index 0000000..1e0eaab --- /dev/null +++ b/src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue37.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections; +using System.IO; +using iTextSharp.text; +using iTextSharp.text.pdf; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace iTextSharp.LGPLv2.Core.FunctionalTests.Issues +{ + /// + /// https://github.com/VahidN/iTextSharp.LGPLv2.Core/issues/37 + /// + [TestClass] + public class Issue37 + { + [TestMethod] + public void Verify_Issue37_CanBe_Processed() + { + var pdfDoc = new Document(PageSize.A4); + + var pdfFilePath = TestUtils.GetOutputFileName(); + var fileStream = new FileStream(pdfFilePath, FileMode.Create); + var writer = PdfWriter.GetInstance(pdfDoc, fileStream); + + pdfDoc.AddAuthor(TestUtils.Author); + pdfDoc.Open(); + + var ct = new ColumnText(writer.DirectContent); + + var text = new Phrase("TEST paragraph\nAfter Newline"); + text.Add(new Chunk("\u00A0Test Test\u00A0")); + text.Add(new Chunk("\nNew line")); + + ct.SetSimpleColumn(text, 34, 750, 580, 317, 15, Element.ALIGN_LEFT); + ct.Go(); + + pdfDoc.Close(); + fileStream.Dispose(); + + TestUtils.VerifyPdfFileIsReadable(pdfFilePath); + } + } +} \ No newline at end of file