Migradoc Coverpage Picture

风格不统一 提交于 2019-12-24 09:51:07

问题


I need to find a way of how to fill whole cover page with a .png picture and put some text in the buttom of a page, where picture wouldnt be.

Right now i got it to stretch by using :

document.DefaultPageSetup.LeftMargin = 0;
document.DefaultPageSetup.TopMargin = 0; 

but top margin still leaves som mm of space left (and its not picture which have some white colore in top.)

P.S in future i need to put a picture above the cover page picture. so it actually have to be in 2 layers. Any suggestions?


回答1:


You don't have to change the page margins to achieve this: images are shapes and shapes can be placed at absolute positions anywhere on the page.

Here's an (untested) code snippet (assuming DIN A4 page size):

var myImage = section.Headers.FirstPage.AddImage("ImageLocation");
myImage.Height = "29.7cm";
myImage.Width = "21cm";
myImage.RelativeVertical = RelativeVertical.Page;
myImage.RelativeHorizontal = RelativeHorizontal.Page;
myImage.WrapFormat.Style = WrapStyle.Through;

The trick is to use "WrapStyle.Through" and make positions relative to the page. This should also solve your "P. S." question.



来源:https://stackoverflow.com/questions/9618242/migradoc-coverpage-picture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!