调整PDF页面和文本换行? [英] Resize PDF page and wrap text?

查看:334
本文介绍了调整PDF页面和文本换行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能改变一个PDF文档内的页面的大小,而不调整其所有的内容?我希望所有文字,根据新的大小包裹的内容。

Is it possible to change the size of a page inside a PDF document without resizing all of its content? I want all text to wrap their content according to the new size.

我一直没能找到有关此的任何信息。眼看PDF库如何写文字的时候工作,我想这是不可能的,但也许有办法解决它。

I haven't been able to find any info regarding this. Seeing how PDF libraries work when writing to text, I guess it's not possible, but maybe there is a way around it.

我主要是寻找一些净code,PDFSharp,iTextSharp的,PDF小丑,或任何其他.NET库是好的,如果一些工具已经允许这一点,我有兴趣为好。当然,一些Java的iText code可被罚款也是如此。

I'm mainly looking for some .Net code, PDFSharp, iTextSharp, PDF Clown, or any other .Net library is fine, if some tool already allows this I would be interested as well. Of course, some Java iText code may be fine as well.

推荐答案

PDF文档的内部没有句或段落的概念,所以你要找的是不是真的有可能达不到提取文本,猜测这些概念,创造一个全新的文件。库如iTextSharp的和PDF小丑都使处理文本更容易抽象,但最终都归结到绘制出的字符或文本行的PDF命令。我们认为,作为一款什么是只是一堆的PDF中的文字垂直间隔的线路。库中执行计算如何打开段落成文本的那些线的繁重而一旦出现这种情况,没有更多的段落。以流的文字,我们需要这些概念,所以你可以看到为什么这是行不通的。

The internals of a PDF document don't have a concept of "sentences" or "paragraphs" so what you are looking for isn't really possible short of extracting the text, guessing at those concepts and creating a brand new document. Libraries such as iTextSharp and PDF Clown have abstractions that make working with text easier but ultimately they all come down to PDF commands that draw out characters or lines of text. What we think of as a paragraph is just a bunch of vertically-spaced lines of text within the PDF. The libraries perform the heavy lifting of calculating how to turn "paragraphs" into those lines of text and once that happens there is no more "paragraph". In order to "flow" text we would need these concepts so you can see why this wouldn't work.

目前的也许的有些库提供这一点,但我并没有看起来他们最终他们将被猜测了。

There might be some libraries that offer this but I haven't seem them and ultimately they would be guessing, too.

这篇关于调整PDF页面和文本换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆