{"id":737,"date":"2011-12-15T14:07:14","date_gmt":"2011-12-15T14:07:14","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=737"},"modified":"2022-02-17T06:24:03","modified_gmt":"2022-02-17T06:24:03","slug":"page-settings","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/printing\/page-settings","title":{"rendered":"Page Settings"},"content":{"rendered":"<p>You can&#8217;t easily force things like margins and orientation, all you can do is use<\/p>\n<pre><code>dlgPrint-&gt;PrinterSettings-&gt;DefaultPageSettings-&gt;Landscape = true;<\/code><\/pre>\n<p>Which if not forced and often ignored leaving the user to have to decide.<\/p>\n<h4>Detecting Page Orientation<\/h4>\n<p>You can do this in the print page callback:<\/p>\n<pre><code>\r\n\tvoid DataGridViewPrint::PrintDoc_PrintPage(System::Object ^sender, System::Drawing::Printing::PrintPageEventArgs ^e)\r\n\t{\r\n\t\tif (e-&gt;PageSettings-&gt;Landscape)\t\t\/\/True for landscape\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can&#8217;t easily force things like margins and orientation, all you can do is use dlgPrint-&gt;PrinterSettings-&gt;DefaultPageSettings-&gt;Landscape = true; Which if not forced and often ignored leaving the user to have to decide. Detecting Page Orientation You can do this in the print page callback: void DataGridViewPrint::PrintDoc_PrintPage(System::Object ^sender, System::Drawing::Printing::PrintPageEventArgs ^e) { if (e-&gt;PageSettings-&gt;Landscape) \/\/True for landscape<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[80],"tags":[],"class_list":["post-737","post","type-post","status-publish","format-standard","hentry","category-printing"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=737"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/737\/revisions"}],"predecessor-version":[{"id":1032,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/737\/revisions\/1032"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}