Skip to content

Commit 3344853

Browse files
Kate IvanovaiText-CI
authored andcommitted
Add test for collaboration between radiobuttons and page-counter
DEVSIX-4773 Autoported commit. Original commit hash: [e453beee]
1 parent 21226c0 commit 3344853

File tree

8 files changed

+1719
-1
lines changed

8 files changed

+1719
-1
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/element/FormTest.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ source product.
4444
using System.IO;
4545
using iText.Forms;
4646
using iText.Html2pdf;
47+
using iText.IO.Util;
4748
using iText.Kernel.Pdf;
4849
using iText.Kernel.Utils;
4950
using iText.Test;
@@ -177,6 +178,41 @@ public virtual void SelectTest02() {
177178
RunTest("select02", false);
178179
}
179180

181+
[NUnit.Framework.Test]
182+
public virtual void RadioButtonWithPageCounterAtBottonTest() {
183+
//TODO: update cmpfile after DEVSIX-4772 will be fixed
184+
String html = sourceFolder + "radioButtonWithPageCounterAtBotton.html";
185+
String pdf = destinationFolder + "radioButtonWithPageCounterAtBotton.pdf";
186+
HtmlConverter.ConvertToPdf(new FileInfo(html), new FileInfo(pdf), new ConverterProperties().SetCreateAcroForm
187+
(true));
188+
System.Console.Out.WriteLine("html: " + UrlUtil.GetNormalizedFileUriString(html) + "\n");
189+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(pdf, sourceFolder + "cmp_radioButtonWithPageCounterAtBotton.pdf"
190+
, destinationFolder));
191+
}
192+
193+
[NUnit.Framework.Test]
194+
public virtual void RadioButtonWithPageCounterOnTopTest() {
195+
//TODO: update cmpfile after DEVSIX-4772 will be fixed
196+
String html = sourceFolder + "radioButtonWithPageCounterOnTop.html";
197+
String pdf = destinationFolder + "radioButtonWithPageCounterOnTop.pdf";
198+
HtmlConverter.ConvertToPdf(new FileInfo(html), new FileInfo(pdf), new ConverterProperties().SetCreateAcroForm
199+
(true));
200+
System.Console.Out.WriteLine("html: " + UrlUtil.GetNormalizedFileUriString(html) + "\n");
201+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(pdf, sourceFolder + "cmp_radioButtonWithPageCounterOnTop.pdf"
202+
, destinationFolder));
203+
}
204+
205+
[NUnit.Framework.Test]
206+
public virtual void RadioButtonNoPageCounterTest() {
207+
String html = sourceFolder + "radioButtonNoPageCounter.html";
208+
String pdf = destinationFolder + "radioButtonNoPageCounter.pdf";
209+
HtmlConverter.ConvertToPdf(new FileInfo(html), new FileInfo(pdf), new ConverterProperties().SetCreateAcroForm
210+
(true));
211+
System.Console.Out.WriteLine("html: " + UrlUtil.GetNormalizedFileUriString(html) + "\n");
212+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(pdf, sourceFolder + "cmp_radioButtonNoPageCounter.pdf"
213+
, destinationFolder));
214+
}
215+
180216
private void RunTest(String name) {
181217
RunTest(name, true);
182218
}

0 commit comments

Comments
 (0)