Skip to content

Commit

Permalink
Merge branch 'develop' into devsecops
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-ivanov committed Feb 1, 2025
2 parents 8d64b57 + d01c2ec commit 6d2197a
Show file tree
Hide file tree
Showing 64 changed files with 865 additions and 120 deletions.
10 changes: 3 additions & 7 deletions itext.tests/itext.svg.tests/itext/svg/renderers/OpacityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,14 @@ public virtual void TestRGBA() {

[NUnit.Framework.Test]
public virtual void TestFillOpacityWithComma() {
//TODO DEVSIX-2678
//TODO DEVSIX-2678 SVG: Displaying invalid value of fill-opacity incorrectly
NUnit.Framework.Assert.Catch(typeof(FormatException), () => ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER
, "testFillOpacityWithComma"));
}

[NUnit.Framework.Test]
public virtual void TestFillOpacityWithPercents() {
//TODO DEVSIX-2678
NUnit.Framework.Assert.Catch(typeof(FormatException), () => ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER
, "testFillOpacityWithPercents"));
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "testFillOpacityWithPercents");
}

[NUnit.Framework.Test]
Expand All @@ -87,9 +85,7 @@ public virtual void TestStrokeOpacityWithComma() {

[NUnit.Framework.Test]
public virtual void TestStrokeOpacityWithPercents() {
//TODO DEVSIX-2679
NUnit.Framework.Assert.Catch(typeof(FormatException), () => ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER
, "testStrokeOpacityWithPercents"));
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "testStrokeOpacityWithPercents");
}

[NUnit.Framework.Test]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.svg.tests/itext/svg/renderers/StrokeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ public virtual void StrokeObjectsOverlap1Test() {

[NUnit.Framework.Test]
public virtual void StrokeObjectsOverlap2Test() {
//TODO DEVSIX-7338: Update cmp file
//TODO DEVSIX-7338: SVG stroke on group applied incorrectly
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "strokeOnGroup2");
}

[NUnit.Framework.Test]
public virtual void StrokeObjectsOverlap3Test() {
//TODO DEVSIX-7338: Update cmp file
//TODO DEVSIX-7338: SVG stroke on group applied incorrectly
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "strokeOnGroupNoInsideStroke");
}

[NUnit.Framework.Test]
public virtual void StrokeObjectsOverlap4Test() {
//TODO DEVSIX-7338: Update cmp file
//TODO DEVSIX-7338: SVG stroke on group applied incorrectly
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "strokeOnGroupNoInsideStroke2");
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,25 @@ public virtual void MarkerParentElementTest() {
// Compare with Chrome browser
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "markerParentElement");
}

[NUnit.Framework.Test]
public virtual void MarkerDefinedInStyleTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "markerDefinedInStyle");
}

[NUnit.Framework.Test]
public virtual void MarkerOnGroupTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "markerOnGroup");
}

[NUnit.Framework.Test]
public virtual void MarkerOnSvgTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "markerOnSvg");
}

[NUnit.Framework.Test]
public virtual void MarkerOnSymbolTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "markerOnSymbol");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public virtual void BothStyleAttributeTest() {

[NUnit.Framework.Test]
public virtual void OpacityAttributeTest() {
// TODO DEVSIX-2258 Processing of stroke attribute is not currently correct supported
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "opacityAttrTest");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,10 @@ public virtual void TextWhiteSpacePreWrapTest() {
public virtual void TextWhiteSpacePreLineTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "textWhiteSpacePreLine");
}

[NUnit.Framework.Test]
public virtual void TextRelativeXYTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "textRelativeXY");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ You should have received a copy of the GNU Affero General Public License
*/
using System;
using iText.Svg;
using iText.Svg.Renderers;
using iText.Svg.Renderers.Impl;
using iText.Test;

Expand Down Expand Up @@ -185,7 +186,7 @@ public virtual void ProcessWhiteSpaceBreakLine() {
);
root.AddChild(textAfter);
//Run
SvgTextUtil.ProcessWhiteSpace(root, true);
SvgTextUtil.ProcessWhiteSpace(root, true, new SvgDrawContext(null, null));
root.GetChildren()[0].GetAttribute(SvgConstants.Attributes.TEXT_CONTENT);
//Create result array
String[] actual = new String[] { root.GetChildren()[0].GetAttribute(SvgConstants.Attributes.TEXT_CONTENT),
Expand Down Expand Up @@ -217,7 +218,7 @@ public virtual void ProcessWhiteSpaceAbsPositionChange() {
);
root.AddChild(textAfter);
//Run
SvgTextUtil.ProcessWhiteSpace(root, true);
SvgTextUtil.ProcessWhiteSpace(root, true, new SvgDrawContext(null, null));
root.GetChildren()[0].GetAttribute(SvgConstants.Attributes.TEXT_CONTENT);
//Create result array
String[] actual = new String[] { root.GetChildren()[0].GetAttribute(SvgConstants.Attributes.TEXT_CONTENT),
Expand Down
25 changes: 25 additions & 0 deletions itext.tests/itext.svg.tests/itext/svg/utils/TransformUtilsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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.Commons.Utils;
using iText.Kernel.Geom;
using iText.Svg.Exceptions;
using iText.Test;
Expand Down Expand Up @@ -173,5 +174,29 @@ public virtual void MixedWhiteSpace() {
AffineTransform expected = AffineTransform.GetTranslateInstance(2.25, 0);
NUnit.Framework.Assert.AreEqual(expected, actual);
}

[NUnit.Framework.Test]
public virtual void ParseInvalidRotateTest() {
Exception e = NUnit.Framework.Assert.Catch(typeof(SvgProcessingException), () => TransformUtils.ParseTransform
("rotate(text)"));
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(SvgExceptionMessageConstant.INVALID_TRANSFORM_VALUE
, "text"), e.Message);
}

[NUnit.Framework.Test]
public virtual void ParseInvalidSkewXTest() {
Exception e = NUnit.Framework.Assert.Catch(typeof(SvgProcessingException), () => TransformUtils.ParseTransform
("skewX(text)"));
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(SvgExceptionMessageConstant.INVALID_TRANSFORM_VALUE
, "text"), e.Message);
}

[NUnit.Framework.Test]
public virtual void ParseInvalidSkewYTest() {
Exception e = NUnit.Framework.Assert.Catch(typeof(SvgProcessingException), () => TransformUtils.ParseTransform
("skewY(text)"));
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(SvgExceptionMessageConstant.INVALID_TRANSFORM_VALUE
, "text"), e.Message);
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions itext/itext.kernel/itext/kernel/pdf/xobject/PdfFormXObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,21 @@ public virtual iText.Kernel.Pdf.Xobject.PdfFormXObject Put(PdfName key, PdfObjec
SetModified();
return this;
}

/// <summary>If the form xobject is relative sized.</summary>
/// <remarks>
/// If the form xobject is relative sized. This information
/// is used during xobject layout to resolve it's relative size.
/// </remarks>
/// <returns>
///
/// <see langword="true"/>
/// if the xobject is relative sized,
/// <see langword="false"/>
/// otherwise
/// </returns>
public virtual bool IsRelativeSized() {
return false;
}
}
}
Loading

0 comments on commit 6d2197a

Please sign in to comment.