Skip to content

Commit 2c88ae7

Browse files
SnipxiText-CI
authored andcommitted
Revise destination name generation mechanism when building outlines
Previously, prefix was duplicated which resulted in named like "pdfHTML-iText-outline-pdfHTML-iText-outline-1" DEVSIX-3495 Autoported commit. Original commit hash: [69a8e214]
1 parent 0db0391 commit 2c88ae7

File tree

10 files changed

+4
-5
lines changed

10 files changed

+4
-5
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/attach/impl/OutlineHandlerTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ public virtual void DefaultDestinationPrefixTest() {
5353
PdfOutline pdfOutline = context.GetPdfDocument().GetOutlines(false).GetAllChildren()[0];
5454
NUnit.Framework.Assert.AreEqual("p1", pdfOutline.GetTitle());
5555
PdfString pdfStringDest = (PdfString)pdfOutline.GetDestination().GetPdfObject();
56-
NUnit.Framework.Assert.AreEqual("pdfHTML-iText-outline-pdfHTML-iText-outline-1", pdfStringDest.ToUnicodeString
57-
());
56+
NUnit.Framework.Assert.AreEqual("pdfHTML-iText-outline-1", pdfStringDest.ToUnicodeString());
5857
}
5958

6059
[NUnit.Framework.Test]
@@ -78,7 +77,7 @@ public virtual void CustomDestinationPrefixTest() {
7877
PdfOutline pdfOutline = context.GetPdfDocument().GetOutlines(false).GetAllChildren()[0];
7978
NUnit.Framework.Assert.AreEqual("p1", pdfOutline.GetTitle());
8079
PdfString pdfStringDest = (PdfString)pdfOutline.GetDestination().GetPdfObject();
81-
NUnit.Framework.Assert.AreEqual("prefix-prefix-1", pdfStringDest.ToUnicodeString());
80+
NUnit.Framework.Assert.AreEqual("prefix-1", pdfStringDest.ToUnicodeString());
8281
}
8382
}
8483
}
-132 Bytes
Binary file not shown.
-132 Bytes
Binary file not shown.
-264 Bytes
Binary file not shown.
-528 Bytes
Binary file not shown.
-88 Bytes
Binary file not shown.
-484 Bytes
Binary file not shown.
-264 Bytes
Binary file not shown.

itext/itext.html2pdf/itext/html2pdf/attach/impl/OutlineHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public virtual String GetDestinationNamePrefix() {
186186
/// <param name="element">the element</param>
187187
/// <returns>the unique destination name</returns>
188188
protected internal virtual String GenerateUniqueDestinationName(IElementNode element) {
189-
return destinationNamePrefix + GetUniqueID(destinationNamePrefix);
189+
return GetUniqueID(destinationNamePrefix);
190190
}
191191

192192
/// <summary>Generate the unique outline name.</summary>

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d0f3df080977a62243ceeab41242fff9402dde59
1+
69a8e214688a8b3f38ecf42ea7f5e1ebfc7211ca

0 commit comments

Comments
 (0)