简体   繁体   English

在MigraDoc的更多页面上划分大图像

[英]Divide big images on more pages in MigraDoc

Am new to MigraDoc. 是MigraDoc的新手。 I have an image that has width of about 9000px on HTML. 我有一张在HTML上宽度约为9000px的图像。 I want to draw that in PDF. 我想将其绘制为PDF。 Till now I just created a table, added column in it, then created one row for that table and then 到目前为止,我只是创建了一个表,在其中添加了列,然后为该表创建了一行,然后

TextFrame addressFrame = r2.Cells[0].AddTextFrame();
                addressFrame.Width = "16cm";
                addressFrame.Height = "22cm";
                addressFrame.Orientation = TextOrientation.Downward;
               // addressFrame.MarginLeft = "1cm";
                MigraDoc.DocumentObjectModel.Shapes.Image image1 = addressFrame.AddImage(Utility.GetAbsolutePath(p_strPic1));
                image1.Height = "25cm";
                image1.Width = "40cm";
                //image1.LockAspectRatio = true;

But it prints image in PDF only on one page, but I want that half pic on one page and then remaining on next page even if image is bigger than two pages, then it should expand to next page again. 但是它仅在一页上以PDF格式打印图像,但是我希望将一半的图片打印在一页上,然后即使图像大于两页也要保留在下一页上,然后应该再次扩展到下一页。

It is up to you to add page breaks as needed. 您可以根据需要添加分页符。 There is no automatic setting to split large images across several pages. 没有自动设置可将大图像拆分为多个页面。 And AFAIR TextFrames do not split across several pages either. AFAIR TextFrames也不会拆分成多个页面。

You can split the image before adding it to MigraDoc. 您可以先分割图像,然后再将其添加到MigraDoc。

But you can also draw the large image on several pages with portions of the image outside the visible area of each page. 但是,您也可以在几页上绘制较大的图像,而图像的某些部分则超出每一页的可见区域。 If the image comes from a file then it should be included in the PDF only once, so there should be no file size problem using the same image on several pages. 如果图像来自文件,则应仅将其包含在PDF中一次,因此在多页上使用同一图像不会有文件大小问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM