forked from pipeline-foundation/itext7-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into devsecops
- Loading branch information
Showing
17 changed files
with
269 additions
and
10 deletions.
There are no files selected for viewing
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
62 changes: 62 additions & 0 deletions
62
itext.tests/itext.forms.tests/itext/forms/PdfPushButtonTest.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,62 @@ | ||
/* | ||
This file is part of the iText (R) project. | ||
Copyright (c) 1998-2024 Apryse Group NV | ||
Authors: Apryse Software. | ||
This program is offered under a commercial and under the AGPL license. | ||
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. | ||
AGPL licensing: | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
using System; | ||
using iText.Forms.Fields; | ||
using iText.Kernel.Geom; | ||
using iText.Kernel.Pdf; | ||
using iText.Kernel.Utils; | ||
using iText.Test; | ||
|
||
namespace iText.Forms { | ||
[NUnit.Framework.Category("IntegrationTest")] | ||
public class PdfPushButtonTest : ExtendedITextTest { | ||
public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory | ||
+ "/test/itext/forms/PdfPushButtonTest/"; | ||
|
||
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext | ||
.CurrentContext.TestDirectory) + "/resources/itext/forms/PdfPushButtonTest/"; | ||
|
||
[NUnit.Framework.OneTimeSetUp] | ||
public static void BeforeClass() { | ||
CreateOrClearDestinationFolder(DESTINATION_FOLDER); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void SetFontSizePushButtonWithDisplayTest() { | ||
String outPdf = DESTINATION_FOLDER + "pushButtonWithDisplay.pdf"; | ||
String cmpPdf = SOURCE_FOLDER + "cmp_pushButtonWithDisplay.pdf"; | ||
using (PdfDocument doc = new PdfDocument(CompareTool.CreateTestPdfWriter(outPdf))) { | ||
doc.AddNewPage(); | ||
Rectangle rectangle = new Rectangle(150, 400, 400, 100); | ||
PdfButtonFormField button = new PushButtonFormFieldBuilder(doc, "button").SetWidgetRectangle(rectangle).SetPage | ||
(1).CreatePushButton(); | ||
button.SetFontSize(50); | ||
button.SetValue("value", "some display text"); | ||
PdfAcroForm acroForm = PdfAcroForm.GetAcroForm(doc, true); | ||
acroForm.AddField(button); | ||
} | ||
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, DESTINATION_FOLDER, "diff_" | ||
)); | ||
} | ||
} | ||
} |
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
Binary file added
BIN
+1.61 KB
...itext.forms.tests/resources/itext/forms/PdfChoiceFieldTest/cmp_setFontSizeChoiceField.pdf
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
...text.forms.tests/resources/itext/forms/PdfFormFieldTest/cmp_choiceFieldAutoSize01Test.pdf
Binary file not shown.
Binary file added
BIN
+1.64 KB
...s/itext.forms.tests/resources/itext/forms/PdfPushButtonTest/cmp_pushButtonWithDisplay.pdf
Binary file not shown.
Binary file modified
BIN
+98 Bytes
(100%)
itext.tests/itext.forms.tests/resources/itext/forms/XfdfReaderTest/cmp_xfdfCheckBox.pdf
Binary file not shown.
Binary file added
BIN
+1.64 KB
...sts/resources/itext/forms/fields/FieldsRotationTest/cmp_filledRotated270TextFormField.pdf
Binary file not shown.
Binary file added
BIN
+1.64 KB
...ests/resources/itext/forms/fields/FieldsRotationTest/cmp_filledRotated90TextFormField.pdf
Binary file not shown.
Binary file added
BIN
+1.66 KB
...sts/resources/itext/forms/fields/FieldsRotationTest/cmp_rotatedButtonWithDisplayValue.pdf
Binary file not shown.
Binary file added
BIN
+3.02 KB
...itext.forms.tests/resources/itext/forms/fields/FieldsRotationTest/cmp_rotatedCheckBox.pdf
Binary file not shown.
Binary file added
BIN
+1.69 KB
...text.forms.tests/resources/itext/forms/fields/FieldsRotationTest/cmp_rotatedChoiceBox.pdf
Binary file not shown.
Binary file added
BIN
+1.67 KB
...itext.forms.tests/resources/itext/forms/fields/FieldsRotationTest/cmp_rotatedComboBox.pdf
Binary file not shown.
Binary file added
BIN
+1.57 KB
...t.forms.tests/resources/itext/forms/fields/FieldsRotationTest/rotated270TextFormField.pdf
Binary file not shown.
Binary file added
BIN
+1.57 KB
...xt.forms.tests/resources/itext/forms/fields/FieldsRotationTest/rotated90TextFormField.pdf
Binary file not shown.
Oops, something went wrong.