Tile PDF pages vertically with iTextSharp

时间秒杀一切 提交于 2019-11-28 11:21:59

问题


I want to tile pages vertically with iTextSharp

Something like this:

---------
| L  |  R | 
---------

This is 1 page as far as PDF is concerned.

I need to split the page vertically into 2 parts page R and page L so that left part of page comes first and followed by right side of page.

Something like this: page 1:

-----
| L |
-----

page 2:

-----
| R  |
-----

回答1:


I changed your question because splitting a PDF has a different meaning to many of us. For instance: you can split a PDF with 10 pages into two PDF with 5 pages.

You don't want to split a PDF, you want to tile a PDF. This is explained in chapter 6 of my book: http://www.manning.com/lowagie2/samplechapter6.pdf See section 6.2.3 "N-up copying and tiling PDF documents".

In case you aren't familiar with Java, you can always download the C# version of the examples here: http://sourceforge.net/p/itextsharp/code/HEAD/tree/book/iTextExamplesWeb/iTextExamplesWeb/iTextInAction2Ed/

For instance: http://sourceforge.net/p/itextsharp/code/HEAD/tree/book/iTextExamplesWeb/iTextExamplesWeb/iTextInAction2Ed/Chapter06/TilingHero.cs

You'll need to adapt this example as it tiles an A0 page into 16 A4 pages, but that's a matter of simple math. That would be off topic on a developers' forum ;-)



来源:https://stackoverflow.com/questions/14586984/tile-pdf-pages-vertically-with-itextsharp

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