本文介绍了使用命令行打印特定的 PDF 页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 平台上工作.

可以在特定页面打开 PDF 文件:

AcroRd32.exe/A "page=3" "file.pdf"

是否有类似的打印特定页面的解决方案?类似的东西:

AcroRd32.exe/P "page=3" "file.pdf"
解决方案

是否有类似的打印特定页面的解决方案?

类似于:

AcroRd32.exe/P "page=3" "file.pdf"

没有.没有打印特定页面的选项.

您可以做的是将 /p 选项与 VBS(或类似)脚本一起使用来操作打印"对话框并选择要打印的所需页面:

AcroRd32.exe/p pathname — 执行 Adob​​e Reader 并显示打印对话框.

有关可能的命令行选项的列表,请参见下文.

如何在 Windows 上通过 Acrobat 和 Adob​​e Reader 使用命令行?

这些是不受支持的命令行,但对一些开发人员有用.

除了下面列出的内容之外,没有关于这些命令的文档.您可以使用 Acrobat 和 Adob​​e Reader 从命令行显示和打印 PDF 文件.

注意:以下所有示例均使用 Adob​​e Reader,但也适用于 Acrobat.

如果您使用的是 Acrobat,请在命令行中用 Acrobat.exe 代替 AcroRd32.exe.

AcroRd32.exe pathname — 执行 Adob​​e Reader 并显示文件,必须提供其完整路径.

命令行的其他选项是:

  • /n

    启动一个单独的 Acrobat 或 Adob​​e Reader 实例,即使是目前开放.

  • /s

    打开 Acrobat 或 Adob​​e Reader,抑制启动画面.

  • /o

    打开 Acrobat 或 Adob​​e Reader,取消打开文件对话框.

  • /h

    在最小化的窗口中打开 Acrobat 或 Adob​​e Reader.

AcroRd32.exe/p pathname — 执行 Adob​​e Reader 并显示打印对话框.

AcroRd32.exe/t path "printername" "drivername" "portname" —启动 Adob​​e Reader 并打印一个文件,其 path 必须是完整的指定,同时取消打印对话框.

/t 选项的四个参数求值为 path, printername,drivernameportname(所有字符串).

  • printername — 打印机的名称.

  • drivername — 打印机驱动程序的名称,显示在打印机的属性中.

  • portname — 打印机的端口.portname 不能包含任何 / 字符;如果是,输出将路由到默认端口打印机.

来源 Acrobat 开发人员常见问题解答

I am working in Windows platform.

It is possible to open a PDF file at a specific page:

AcroRd32.exe /A "page=3" "file.pdf"

Is there a similar solution for printing a specific page? Something like:

AcroRd32.exe /P "page=3" "file.pdf"
解决方案

Is there a similar solution for printing a specific page?

AcroRd32.exe /P "page=3" "file.pdf"

No. There is no option to print a specific page.

What you could do is use the /p option together with a VBS (or similar) script to manipulate the Print dialog and select the required page to print:

AcroRd32.exe /p pathname — Executes Adobe Reader and displays the Print dialog box.

See below for a list of the possible command line options.


How Do I Use Command Lines with Acrobat and Adobe Reader on Windows?

Source Acrobat Developer FAQ

这篇关于使用命令行打印特定的 PDF 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 02:20
查看更多