-
Notifications
You must be signed in to change notification settings - Fork 149
/
Issue17.cs
48 lines (39 loc) · 1.35 KB
/
Issue17.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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/17
/// </summary>
[TestClass]
public class Issue17
{
[TestMethod]
public void Verify_Issue17_CanBe_Processed()
{
var pdfDoc = new Document(PageSize.A4);
var pdfFilePath = TestUtils.GetOutputFileName();
var fileStream = new FileStream(pdfFilePath, FileMode.Create);
PdfWriter.GetInstance(pdfDoc, fileStream);
pdfDoc.AddAuthor(TestUtils.Author);
pdfDoc.Open();
var image = Image.GetInstance(TestUtils.GetImagePath("loa.jpg"));
image.WidthPercentage = 60;
image.Alignment = Element.ALIGN_RIGHT;
var table = new PdfPTable(3);
var cell = new PdfPCell( /*image: image, fit: false*/)
{
Colspan = 2,
//Border = 0,
HorizontalAlignment = Element.ALIGN_RIGHT,
};
cell.AddElement(image);
table.AddCell(cell);
table.AddCell(new PdfPCell(new Phrase("Test...")));
pdfDoc.Add(table);
pdfDoc.Close();
fileStream.Dispose();
TestUtils.VerifyPdfFileIsReadable(pdfFilePath);
}
}