如果您的页面是 migradoc (pdfsharp) 中的横向页面,则图像位置不起作用

发布于 2024-09-29 02:57:59 字数 739 浏览 0 评论 0原文

我有以下代码,可以很好地将图像放置在页面的左下角(纵向模式)。一旦我将页面更改为横向模式,图像就会从屏幕上消失。

我如何在横向模式下布局它,以便它显示在屏幕的左下角。这是代码:

   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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无名指的心愿 2024-10-06 02:57:59

听起来像是一个错误。

我已将其放入我们的错误列表中,但我现在没有时间对其进行调查。

您找到了解决方法,这对您来说很好。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文