When we create a PageLayout from the A4 Landscape template and print the layout on a pinter with A4 Landscape paper we get four pages instead of one. We are using the IPage.PageToPrinterMapping = esriPageMappingTile and the reason that we get four instead of one page is that the printer by default has a margin for the A4 format. If I try to do the same procedure for a format that the printer doesn't have a margin for it prints only one page. Is there a way to create the same margin on the PageLayout?
Steps to reproduce in ArcMap:
- File | New...
- Choose Templates | ISO A4 Landscape
- File | Page and Print setup...
- Set Printer and Map to the same
format A4 and orientation landscape
- File | Print...
- The Print dialog is showing four pages
Update: Tried different approaches using the IPage interface but can't find any API to set the margin.
Tried setting the PrintableBounds on the page, but it seems to be readonly:
m_hookHelper.PageLayout.Page.PrintableBounds.Envelope.PutCoords(docPaper.PrintableBounds.XMin, docPaper.PrintableBounds.YMin, docPaper.PrintableBounds.XMax, docPaper.PrintableBounds.YMax)
Tried setting the Custom size on the Page and it sets the size correctly, but it corp the layout, because it doesen't set the offset:
m_hookHelper.PageLayout.Page.PutCustomSize(docPaper.PrintableBounds.Width, docPaper.PrintableBounds.Height)
Tried to set the FormID to be esriPageFormSameAsPrinter and it workes as long as the user chooses the layouts' orientation and format on the printer. If not, it crops the layout when it is printed.
m_hookHelper.PageLayout.Page.FormID = esriPageFormID.esriPageFormSameAsPrinter