forked from VahidN/iTextSharp.LGPLv2.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue37.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |