如果您的页面是 migradoc (pdfsharp) 中的横向页面,则图像位置不起作用
我有以下代码,可以很好地将图像放置在页面的左下角(纵向模式)。一旦我将页面更改为横向模式,图像就会从屏幕上消失。
我如何在横向模式下布局它,以便它显示在屏幕的左下角。这是代码:
Section section = document.AddSection();
Image image2 = section.AddImage("../../back.png");
image2.RelativeHorizontal = RelativeHorizontal.Page;
image2.RelativeVertical = RelativeVertical.Page;
image2.Left = ShapePosition.Left;
image2.Top = ShapePosition.Bottom;
image2.WrapFormat.Style = WrapStyle.Through;
如果我更改:
image2.Top = ShapePosition.Bottom;
它
image2.Top = ShapePosition.Top;
在左上角显示正常,但在左下角不起作用。我可以通过使用来解决这个问题
image2.Top = 550
,但我认为 ShapePosition.Bottom 可以在横向模式下工作。
i have the following code that works fine to put an image in the bottom left of the page (in portrait mode). once i change the page to landscape mode, the image goes off the screen.
how would i lay this out in landscape mode so it shows up on the bottom left of the screen. here is the code:
Section section = document.AddSection();
Image image2 = section.AddImage("../../back.png");
image2.RelativeHorizontal = RelativeHorizontal.Page;
image2.RelativeVertical = RelativeVertical.Page;
image2.Left = ShapePosition.Left;
image2.Top = ShapePosition.Bottom;
image2.WrapFormat.Style = WrapStyle.Through;
if i change:
image2.Top = ShapePosition.Bottom;
to
image2.Top = ShapePosition.Top;
it shows up fine on the top left, but doesn't work on the bottom left. I can work around this by having
image2.Top = 550
but i would have thought ShapePosition.Bottom would work in landscape mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来像是一个错误。
我已将其放入我们的错误列表中,但我现在没有时间对其进行调查。
您找到了解决方法,这对您来说很好。
Sounds like a bug.
I've put it on our error list, but I don't have time now to investigate it.
Good for you that you found a workaround.