Hello,
Setting
the row span works fine in LTR conditions, but when I set the run direction to
RTL, currentColIdx will be -1.
=====================
private void SkipColsWithRowspanAbove()
{
int direction = 1;
if (runDirection ==PdfWriter.RUN_DIRECTION_RTL)
direction = -1;
while (RowSpanAbove(rows.Count,
currentColIdx))
currentColIdx += direction;
}
=====================
public
void AddCell(PdfPCell cell) {
//...
if (currentColIdx <
currentRow.Length) {
in
line 414: currentRow[currentColIdx] = ncell; // currentColIdx is -1
currentColIdx += colspan;
cellAdded = true;
}
=====================
And here
is the sample table to reproduce it: (it works find when run dir is set to LTR)
var table = new PdfPTable(3)
{
RunDirection = PdfWriter.RUN_DIRECTION_RTL,
WidthPercentage = 100,
SpacingBefore = 5,
SpacingAfter = 5
};
//---------------- row - 1
var textCell = new PdfPCell(new
Phrase("data"))
{
Border = 0,
PaddingLeft = 5
};
textCell.Colspan = 4;
table.AddCell(textCell);
//---------------- row - 2
table.AddCell(new PdfPCell(new
Phrase("a) "))
{
Border = 0,
PaddingLeft = 5
});
table.AddCell(new PdfPCell(new
Phrase("b) "))
{
Border = 0,
PaddingLeft = 5
});
var imageCell = new PdfPCell(new
Phrase("date"))
{
Border = 0,
HorizontalAlignment =
Element.ALIGN_CENTER,
VerticalAlignment =
Element.ALIGN_MIDDLE
};
imageCell.Rowspan = 2;
table.AddCell(imageCell);
//---------------- row - 3
table.AddCell(new PdfPCell(new
Phrase("c) "))
{
Border = 0,
PaddingLeft = 5
});
table.AddCell(new PdfPCell(new
Phrase("d) "))
{
Border = 0,
PaddingLeft = 5
});
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php