Skip to content

Commit

Permalink
Verify_Issue37_CanBe_Processed
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed May 9, 2019
1 parent 0a6b437 commit 5af0f0b
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue37.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// https://github.com/VahidN/iTextSharp.LGPLv2.Core/issues/37
/// </summary>
[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);
}
}
}

0 comments on commit 5af0f0b

Please sign in to comment.