() => true wrote:
Hi!
rajaselvaraju wrote:
2nd and 3rd..etc page not printing.
Probably an error in your code.
How are you printing?
below is the code,
Code:
public static void Pdf_OnDocumentRenderQuestions(Document doc)
{
HttpContext context = HttpContext.Current;
//string[] stglt1 = context.Request.Params["temp"].Split(',');
string[] questions = context.Request.Params["Questions"].Split(',');
string groupName = context.Request.Params["GroupName"];
Section sec = doc.AddSection();
TextFrame textFrame = sec.AddTextFrame();
textFrame.Left = ShapePosition.Left;
textFrame.Width = 500;
textFrame.Height = 1000;
textFrame.RelativeHorizontal = RelativeHorizontal.Margin;
// Put sender in text frame
Paragraph paragraph = textFrame.AddParagraph();
paragraph = textFrame.AddParagraph();
paragraph.Format.Font.Name = "Times New Roman";
paragraph.Format.Font.Size = 12;
paragraph.Format.Font.Color = blackcolor;
paragraph.AddFormattedText("Question Group: ", TextFormat.Bold);
paragraph.AddText(groupName);
paragraph.AddLineBreak(); paragraph.AddLineBreak();
int count = 1;
foreach (string question in questions)
{
TS_QuestionDL qid = new TS_QuestionDL();
Guid questId = new Guid(question);
string str = qid.GetQuestions(questId);
paragraph.AddLineBreak();
paragraph.AddFormattedText(count.ToString()+". ", TextFormat.Bold);
paragraph.AddText(str.Trim());
paragraph.AddLineBreak(); paragraph.AddLineBreak();
List<string> options = new List<string>();
TS_OptionDL optionIds = new TS_OptionDL();
int count1 = 1;
string questionType = qid.GetQuestionType(questId);
if (questionType == "MCQ")
{
options = optionIds.GetQuestionOptions(questId);
foreach (string option in options)
{
paragraph.AddTab(); paragraph.AddTab();
paragraph.AddFormattedText(count1.ToString() + ". ", TextFormat.Bold);
paragraph.AddText(option.StripHTML());
paragraph.AddLineBreak();
count1++;
}
}
count++;
}
paragraph = sec.AddParagraph();
}