在网上打开一个大的 pdf 文件 [英] opening a large pdf files on web

查看:30
本文介绍了在网上打开一个大的 pdf 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 27MB 的 pdf 文件,它托管在网络中.当我尝试打开它时,打开它需要一些时间.那么有什么方法可以让我快速查看这个大的 pdf 文件.我想有一些设置,我们可以在下载一些页面后查看一次文件的页面.对此的任何解决方案将不胜感激

I have a 27MB pdf file which is hosted in web. When I try to open it, it takes times to open it. So Is there any way where I can view this large pdf file a bit fast. I guess there are some settings where we can view the pages of the file once after some pages are downloaded. ANy solution to this would be highly appreciated

推荐答案

您需要对 PDF 做的是使它们经过网络优化".技术上更正确的术语是使它们线性化":

What you need to do to your PDF is to make them "web optimized". The technically more correct term is to make them "linearized":

  • Acrobat + Distiller 和许多其他工具都可以做到这一点.
  • Ghostscript 还附带了一个名为 pdfopt.ps 的附加 PostScript 编写的辅助实用程序,可以执行此操作.只需运行:
    gs -q -dNODISPLAY -P- -dSAFER -dDELAYSAFER --/path/to/pdfopt.ps input.pdf optimization.pdf,或者如果您使用的是 Windows:
    gswin32.exe -q -dNODISPLAY -P- -dSAFER -dDELAYSAFER -- c:/path/to/pdfopt.ps input.pdf optimization.pdf
  • Acrobat + Distiller and a lot of other tools can do that.
  • Ghostscript also ships an additional PostScript-written helper utility named pdfopt.ps which can do this. Simply run:
    gs -q -dNODISPLAY -P- -dSAFER -dDELAYSAFER -- /path/to/pdfopt.ps input.pdf optimized.pdf, or if you are on Windows:
    gswin32.exe -q -dNODISPLAY -P- -dSAFER -dDELAYSAFER -- c:/path/to/pdfopt.ps input.pdf optimized.pdf

通常pdfopt.ps 应该与您的Ghostscript 一起安装在安装路径的lib/ 子目录中.如果没有,你可以 从 Ghostscript Git 存储库下载 pdfopt.ps.

Normally pdfopt.ps should be installed together with your Ghostscript in the installation path's lib/ subdirectory. If not, you can download pdfopt.ps from the Ghostscript Git repository.

线性化在内部重新组织 PDF,以便将其内部 PDF 对象 ToC(在技术术语中:其xref 表")(的副本)放在靠近开头的位置文件(而不是它的结尾),加上一些更多的变化.

Linearization re-organizes the PDF internally, so that (a copy of) its internal ToC of PDF objects (in technical terms: its "xref table") is put close to the beginning of the file (instead of its end), plus some more changes.

这样,符合规范的 PDF 阅读器将能够在加载文件的其余部分之前开始呈现第一页.如果您使用基于 HTTP 的协议通过 Web 访问 PDF,甚至可以跳到最后一页并在下载中间页面之前查看它.但是,Web 服务器需要支持 HTTP字节范围"请求(否则即使对于线性化的 PDF 也不起作用).

That way, a spec-conforming PDF reader will be able to start rendering the first page before the rest of the file has been loaded. It will even be possible to jump to the last page and view it before the middle pages are downloaded, if you are accessing the PDF over the web using HTTP-based protocols. But then, the web server is required to support the HTTP "byte range" requests (otherwise this will not work even for linearized PDFs).

您可以在官方 PDF-1.7 ISO 标准规范中阅读有关 PDF 线性化的更多详细信息,可在 Adob​​e 网站上获取

You can read some more details about PDF linearizations in the official PDF-1.7 ISO standard spec, available on the Adobe website

  • 在其(规范性)附件 F 中,线性化 PDF",从第 683 页开始,以及
  • 在其(信息性)附件 G,线性化 PDF 访问策略",从第 703 页开始.
  • in its (normative) Annex F, "Linearized PDF", starting on page 683, and
  • in its (informative) Annex G, "Linearized PDF Access Strategies", starting on page 703.

线性化 PDF 的示例 可以在这里找到

An example of a linearized PDF can be found here

自 Ghostscript 9.07 版以来,可以通过向命令行添加以下开关来直接生成线性化(网络优化")PDF 输出(无需上述两步法):

Since release 9.07 of Ghostscript, linearized ("web optimized") PDF output can be generated directly (without the 2-step approach outlined above) by adding the following switch to the commandline:

-dFastWebView=true

由于 pdfopt.ps 文件现在是多余的,它已从当前的 Ghostscript 源代码库中删除.

Since the pdfopt.ps file is now redundant, it has been removed from the current Ghostscript source repository.

这篇关于在网上打开一个大的 pdf 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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