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

  • Home
  • SEARCH
  • 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 3943200
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:45:13+00:00 2026-05-20T00:45:13+00:00

What I’m trying to do is get this to print in landscape mode without

  • 0

What I’m trying to do is get this to print in landscape mode without showing the dialog box. This is what I have so far:

((mshtml.IHTMLDocument2)Browser.Document.DomDocument).execCommand("Print", true, 0);

I know that the instruction to print in landscape mode needs to be sent through the third argument, but I don’t know how to construct the third argument to do this. Can anyone give me some help on how to make this last argument accomplish my goal?

  • 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-05-20T00:45:14+00:00Added an answer on May 20, 2026 at 12:45 am

    ADDITIONS: This is from Microsoft http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.defaultpagesettings%28v=vs.71%29.aspx

    public void Printing()
    {
       try
       {
          streamToPrint = new StreamReader (filePath);
          try
          {
             printFont = new Font("Arial", 10);
             PrintDocument pd = new PrintDocument(); 
             pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
             pd.PrinterSettings.PrinterName = printer;
             // Set the page orientation to landscape.
             pd.DefaultPageSettings.Landscape = true;
             pd.Print();
          } 
          finally
          {
             streamToPrint.Close() ;
          }
       } 
       catch(Exception ex)
       { 
          MessageBox.Show(ex.Message);
       }
    }
    

    So you would probably just replace pd in the example above with your document.


    ORIGINAL ANSWER:
    Possibly integrate:

    DefaultPageSettings.Landscape = true;
    

    So maybe something like this:

    ((mshtml.IHTMLDocument2)Browser.Document.DomDocument).DefaultPageSettings.Landscape = true;
    ((mshtml.IHTMLDocument2)Browser.Document.DomDocument).execCommand("Print", true, 0);
    

    Taking a little bit of a stab in the dark since C# is a weak spot but I believe this is how I once did it from an C# application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.