问题
I have pdf cover page where i have 5 paragraph lines, and over for those 5 paragraph line i need to be able to add a logo picture, so it will looks something like this :
Pragraph 1 First part of picture
Pragraph 2 Second part of picture
Pragraph 3 Third part of picture
Pragraph 4 fourth part of picture
Pragraph 5 fifth part of picture
Any ideas?
Right now if i create 5 lines and put a picture with wrapperformat set to through it just ends over or under paragraph lines.
回答1:
Simply set the right margins of the paragraphs to keep text and image apart.
With WrapFormat == through, images are ignored while laying out text - that's by design.
It's up to you to set paragraph margins to keep text and images separated if that's what you want.
You can set the margin for a paragraph (as shown below) or better create a style and assign that style to all paragraphs on the frontpage:
Paragraph paragraph = section.AddParagraph("Some text ...");
paragraph.Format.RightIndent = "6cm";
See the DefineStyles routine in this sample for further information about styles: http://www.pdfsharp.net/wiki/HelloMigraDoc-sample.ashx
来源:https://stackoverflow.com/questions/9622530/migradoc-image-in-paragraph-line