Skip to content

Commit b702862

Browse files
Removed manual right alignment of list block element
1 parent 3424951 commit b702862

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

dotnet/src/dotnetcore/GxPdfReportsCS/PDFReportItext8.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,10 @@ protected override void init(ref int gxYPage, ref int gxXPage, int pageWidth, in
9999
//if (SetComplainceLevel(complianceLevel))
100100
//writer.SetTagged();
101101
}
102-
103102
pdfDocument = new PdfDocument(writer);
104103
pdfDocument.SetDefaultPageSize(this.pageSize);
105104
document = new Document(pdfDocument);
106105
document.SetFontProvider(new DefaultFontProvider());
107-
108106
}
109107
catch (PdfException de)
110108
{
@@ -132,7 +130,7 @@ internal override bool SetComplainceLevel(PdfConformanceLevel level)
132130
* @param hideCorners indicates whether corner triangles should be hidden when the side that joins them is hidden.
133131
*/
134132

135-
private void drawRectangle(PdfCanvas cb, float x, float y, float w, float h, int styleTop, int styleBottom, int styleRight, int styleLeft,
133+
private void drawRectangle(PdfCanvas cb, float x, float y, float w, float h, int styleTop, int styleBottom, int styleRight, int styleLeft,
136134
float radioTL, float radioTR, float radioBL, float radioBR, float penAux, bool hideCorners)
137135
{
138136

@@ -468,7 +466,6 @@ public override void GxDrawLine(int left, int top, int right, int bottom, int wi
468466

469467
public override void GxDrawBitMap(String bitmap, int left, int top, int right, int bottom, int aspectRatio)
470468
{
471-
472469
try
473470
{
474471
Image image;
@@ -994,10 +991,7 @@ private void ProcessHTMLElement(Rectangle htmlRectangle, YPosition currentYPosit
994991
}
995992
else if (list != null)
996993
{
997-
// This is a hack for the specific case of rendering a list as cb.Add(list) fails to add numeration to each element but document.Add(list) fails to
998-
// consider the numeration of each element as part of it. Solution is to use document.Add(list) and move the list to the right.
999-
float numWidth = new Paragraph("1. ").CreateRendererSubTree().SetParent(document.GetRenderer()).Layout(new LayoutContext(new LayoutArea(this.getPage(), htmlRectangle))).GetOccupiedArea().GetBBox().GetHeight();
1000-
list.SetFixedPosition(this.getPage(), htmlRectangle.GetX() + numWidth, currentYPosition.CurrentYPosition - blockElementHeight, htmlRectangle.GetWidth());
994+
list.SetFixedPosition(this.getPage(), htmlRectangle.GetX(), currentYPosition.CurrentYPosition - blockElementHeight, htmlRectangle.GetWidth());
1001995
document.Add(list);
1002996
}
1003997
else if (anchor != null)

0 commit comments

Comments
 (0)