Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static PdfPTable PDFTableCreator(QuestionDTO question, int questionNumber)
- {
- GetEmptySquare();
- PdfPTable table = new PdfPTable(2)
- {
- KeepTogether = true,
- WidthPercentage = 100,
- };
- table.SetWidths(new float[] { 1f, 12f });
- table.AddCell(new PdfPCell(new Paragraph(questionNumber + ". " + question.QuestionText, _polishFont))
- {
- Border = _border,
- Colspan = 2,
- HorizontalAlignment = Element.ALIGN_LEFT
- });
- foreach (var answer in question.AnswersDTO)
- {
- table.AddCell(new PdfPCell(GetEmptySquare())
- {
- Border = _border,
- HorizontalAlignment = Element.ALIGN_CENTER,
- Padding = 4
- });
- table.AddCell(new PdfPCell(new Paragraph(answer.TextAnswer, _polishFont))
- {
- Border = _border,
- });
- }
- return table;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement