Results 1 to 4 of 4
  1. #1

    Default C#.Net printing multiple pages


    Mga master khbaw mo unsa pag print sa multiple pages mao neh koa codes...

    private void PrintDocument()
    {

    PrintDocument prnDoc = new PrintDocument();
    PrintDialog prnDlg = new PrintDialog();

    prnDlg.Document = prnDoc;
    prnDoc.PrintPage += new PrintPageEventHandler(prnDoc_PrintPage);
    if (DialogResult.OK == prnDlg.ShowDialog())
    {

    prnDoc.Print();
    }

    }


    int y = 0; // Y point Offset


    void prnDoc_PrintPage(object sender, PrintPageEventArgs e)
    {

    for (int i = 0; i < 100; i++)
    {

    e.Graphics.DrawString("Hello " + i, new Font("Courier New", 12), new SolidBrush(Color.Red), new PointF(12, y));

    y += 20;


    if (y >= e.PageBounds.Height)
    {
    y = 0;
    e.HasMorePages = true;

    }
    else
    {
    e.HasMorePages = false;
    }


    }

    }

  2. #2
    Hi TS, have you tried using Google with keywords same as your Thread Title? have fun with Google, he's your Friend...

    Also, try Google's cousin, YouTube...

    or this cool search engine..

    Cool Search Engine

  3. #3
    Quote Originally Posted by stealthghost View Post
    Hi TS, have you tried using Google with keywords same as your Thread Title? have fun with Google, he's your Friend...

    Also, try Google's cousin, YouTube...

    or this cool search engine..

    Cool Search Engine


    Hehehehe TY boss,, pero morag nahurot nmn tngaleh ang tubag ni google nko... ,,

  4. #4
    Quote Originally Posted by blusking View Post
    Mga master khbaw mo unsa pag print sa multiple pages mao neh koa codes...

    private void PrintDocument()
    {

    PrintDocument prnDoc = new PrintDocument();
    PrintDialog prnDlg = new PrintDialog();

    prnDlg.Document = prnDoc;
    prnDoc.PrintPage += new PrintPageEventHandler(prnDoc_PrintPage);
    if (DialogResult.OK == prnDlg.ShowDialog())
    {

    prnDoc.Print();
    }

    }


    int y = 0; // Y point Offset


    void prnDoc_PrintPage(object sender, PrintPageEventArgs e)
    {

    for (int i = 0; i < 100; i++)
    {

    e.Graphics.DrawString("Hello " + i, new Font("Courier New", 12), new SolidBrush(Color.Red), new PointF(12, y));

    y += 20;


    if (y >= e.PageBounds.Height)
    {
    y = 0;
    e.HasMorePages = true;

    }
    else
    {
    e.HasMorePages = false;
    }


    }

    }
    tan.awa ang answer diri,
    c# - How do I print multiple pages from WinForms? - Stack Overflow

    Code:
    if (offsetY >= pageHeight)
    {
        e.HasMorePages = true;
        offsetY = 0;
        return; // you need to return, then it will go into this function again
    }
    else {
        e.HasMorePages = false;
    }

  5.    Advertisement

Similar Threads

 
  1. Istorya.net Problem Loading Page
    By King in forum General Discussions
    Replies: 13
    Last Post: 08-03-2012, 05:27 PM
  2. unsa gamiton if i-arrange ang pages for prints like magazines?
    By kurdapia.nikki in forum Websites & Multimedia
    Replies: 0
    Last Post: 03-15-2010, 08:57 PM
  3. Replies: 8
    Last Post: 07-26-2008, 10:07 PM
  4. Page Cannot Display sa www.istorya.net
    By nilo_pepito in forum Software & Games (Old)
    Replies: 15
    Last Post: 08-31-2005, 11:19 PM
  5. iSTORYA.Net Summer Outing (Pics on Page 32 and 37)
    By hondarevo in forum Parties & Events
    Replies: 913
    Last Post: 05-23-2005, 05:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top