PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 6:20 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Multipage not coming
PostPosted: Tue Aug 24, 2010 10:42 am 
Offline

Joined: Tue Aug 24, 2010 10:07 am
Posts: 3
hi,

I have some data it is coming based on some query. It will be one page or more than on page. Now the data printed only one page. 2nd and 3rd..etc page not printing.

Thanks,
Raja S


Top
 Profile  
Reply with quote  
 Post subject: Re: Multipage not coming
PostPosted: Tue Aug 24, 2010 11:23 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
Hi!
rajaselvaraju wrote:
2nd and 3rd..etc page not printing.

Probably an error in your code.

How are you printing?

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
 Post subject: Re: Multipage not coming
PostPosted: Tue Aug 24, 2010 12:05 pm 
Offline

Joined: Tue Aug 24, 2010 10:07 am
Posts: 3
() => 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();
           
    }


Top
 Profile  
Reply with quote  
 Post subject: Re: Multipage not coming
PostPosted: Tue Aug 24, 2010 1:04 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
rajaselvaraju wrote:
below is the code

That is the code that creates the MigraDoc document (at least we know now that you're using MigraDoc), not the code that does the printing.

Something like
Code:
            DocumentRenderer renderer = new DocumentRenderer(document);
            renderer.PrepareDocument();
            for (int i = 1; i <= renderer.FormattedDocument.PageCount; ++i)

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 96 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group