Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7936521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:14:34+00:00 2026-06-03T22:14:34+00:00

I am trying to do a form feed & skip 1 page while printing,

  • 0

I am trying to do a form feed & skip 1 page while printing, however with the below lines of code, i am not able to make a form feed.

private void InserPageBreak(System.Drawing.Printing.PrintPageEventArgs e)
{
      Font sFont = new Font("Arial", 10);
      Brush sBrush = Brushes.White;
      e.Graphics.DrawString("\f", sFont, sBrush, 0, 0);
}

I use PrintDialog to print the page contents. I am using “\f” C#’s form feed character.

Any thoughts on how to implement/make this form feed to work ?

PS: I even tried this:

//ASCII code 12 – printer’s form feed control code.

 string test = char.ConvertFromUtf32(12);
 e.Graphics.DrawString(test, sFont, sBrush, 0, 0);

internally c# converts that to “\f”, but didn’t do form feed, anyone who has implemented “\f”, please share your thoughts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:14:36+00:00Added an answer on June 3, 2026 at 10:14 pm

    In .NET, the PrintPageEventArgs.HasMorePage property should be used to send a form feed to the printer. By calling e.Graphics.DrawString(“\f”, sFont, sBrush, 0, 0), you are simply rendering text to the document to be printed, which will never be interpreted by the printer as a form feed.

    Since you know where you want to break the page, instead of calling your InserPageBreak method, set PrintPageEventArgs.HasMorePages = true within your PrintPage event handler. That will send a form feed to the printer and your PrintPage event will continue to be fired until you set HasMorePages = false.

    I hope this helps. It may be useful to see how you have implemented your PrintPage event handler.

    Example:

    Use the BeginPrint handler to initialize data before printing

        void _document_BeginPrint(object sender, PrintEventArgs e)
        {
            //generate some dummy strings to print
            _pageData = new List<string>()
                    {
                        "Page 1 Data",
                        "Page 2 Data",
                        "Page 3 Data",
                    };
    
            // get enumerator for dummy strings
            _pageEnumerator = _pageData.GetEnumerator();
    
            //position to first string to print (i.e. first page)
            _pageEnumerator.MoveNext();
        }
    

    In the PrintPage handler, print a single page at a time, and set HasMorePages to indicate whether or not there is another page to print. In this example, three pages will print, one string on each page. After the 3rd page, _pageEnumerator.MoveNext() will return false, ending the print job.

        void _document_PrintPage(object sender, PrintPageEventArgs e)
        {
            Font sFont = new Font("Arial", 10);
            Brush sBrush = Brushes.Black;
    
            //print current page
            e.Graphics.DrawString(_pageEnumerator.Current, sFont, sBrush, 10, 10);
    
            // advance enumerator to determine if we have more pages.
            e.HasMorePages = _pageEnumerator.MoveNext();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to validate form data on my page i get the following error:
I'm trying to call a Feed Form in my Facebook application and I'm not
Here's the setup: I'm trying to make a relatively simple Winforms app, a feed
I am trying to make a php page (It's Wordpresss but mostly custom php)
So I'm trying to create a new feed within the Admin page and its
I'm trying to parse just one item form a rss feed. Basically, I'm trying
I am trying to parse form data, including upload files with a node.js http
I'm trying to send form fields and file to a web service using php
I'm trying to use form's CheckboxSelectMultiple widget but I I'd like to change the
I am trying to intercept form submits from webpages I dont control. My current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.