如何在 C# 中使用 itextsharp 或 pdfsharp 仅复制 pdf 文件的正文

发布于 2024-08-13 10:25:39 字数 397 浏览 7 评论 0原文

我仍在等待大家的回复。我真的需要你的支持.......plz

我正在开发一个名为pdf恢复的项目。我想使用 itextsharp C# lib 将文件正文复制到另一个 pdf 文件中。

我想在获得正文后立即解析整个文件,即根据 pdf 参考“ 1 0 obj<<....>>endobj ”。然后将全文复制到另一个 pdf 文件。

我不想阅读标题、外部参照表等。

我正在使用 itextsharp lib 来创建文件。如果 pdfsharp 提供了这个,我将转向那个。 还提供一些有关这两个库的提示。 谢谢。 :)

I am still waiting for the reply from you all. I really need your support.......plz

I am developing a project called pdf recovery. In that i want to just copy the body of file into another pdf file using itextsharp C# lib.

i want to parse entire file as soon as i get body i.e. " 1 0 obj<<....>>endobj " according to pdf reference. then copy full body to another pdf file.

i dont to want to read header,xref table..etc.

I am using itextsharp lib for creating a file. if pdfsharp provides this i will move to that one. Also give some tips about both lib.
Thnx. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

唠甜嗑 2024-08-20 10:25:39

如果您使用页面标记(例如 < 中的示例) a href="http://1t3xt.info/examples/browse/?page=example&id=27" rel="nofollow noreferrer">http://1t3xt.info/examples/browse/?page=example&id =27 - 这是针对Java版本的,但是将其适应C#应该不会有任何问题)它只会复制页面内容,并创建一个新的“标题”(我假设你的意思是元数据) 和外部参照表。
使用此机制将自动为您复制所有必需的资源(例如字体、位图……)。如果您要手动执行此操作,则您也必须执行此操作,这会变得有点混乱。
哦,不需要解析任何东西。 iTextSharp 将为您完成所有解析。

If you use the page stamper (like in the example at http://1t3xt.info/examples/browse/?page=example&id=27 - this is for the Java version, but you should not have any problems adapting that to C#) it will only copy the page content, and will create a new "header" (I assume you mean the meta data) and xref table.
Using this mechanism will copy all required resources (e.g. fonts, bitmaps, ...) automatically for you. If you would do it manually, you would have to do that too, and that gets a bit messy.
Oh, and there is no need to parse anything. iTextSharp will do all the parsing for you.

策马西风 2024-08-20 10:25:39

您是否尝试过在 Itext/ISharp 邮件列表上询问?

Have you tried asking on the Itext/ISharp mailing list?

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