从 Windows 命令行打印 PDF

您所在的位置:网站首页 Cmd打印指定文件 从 Windows 命令行打印 PDF

从 Windows 命令行打印 PDF

#从 Windows 命令行打印 PDF | 来源: 网络整理| 查看: 265

从 Windows 命令行打印 PDF 2023-05-13 14:33:41 other 阅读:1893

您可以使用Windows命令行中的Adobe Acrobat Reader DC工具来打印PDF文件。以下是您可以执行的步骤:

安装Adobe Acrobat Reader DC:如果您尚未在计算机上安装Adobe Acrobat Reader DC,请使用浏览器访问Adobe官方网站,下载并安装此软件。

添加Acrobat Reader到系统环境变量:为了能够在Windows命令提示符中运行Acrobat Reader,您需要将其路径添加到系统环境变量中。按下Win+R键打开运行,输入sysdm.cpl打开系统属性窗口,点击高级选项卡,点击环境变量,找到Path变量,点击编辑,然后在末尾添加Acrobat Reader的安装路径(例如 C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader)。

打印PDF文件:现在,您可以在Windows命令提示符中执行以下命令来打印指定的PDF文件:

AcroRd32.exe /t "C:\Path\To\Your\File.pdf" "PrinterName"

其中,“C:\Path\To\Your\File.pdf”是您要打印的PDF文件的完整路径,“PrinterName”是您要使用的打印机的名称。

例如,要打印名为“example.pdf”的文件,可以使用以下命令:

AcroRd32.exe /t "C:\Users\Username\Documents\example.pdf" "MyPrinter"

这将启动Acrobat Reader并自动将指定的PDF文件发送到打印机进行打印。请注意,“/t”选项将Acrobat Reader设置为“传统打印模式”,这意味着直接将文件发送到打印机而不会打开Acrobat Reader界面。

以下是Python代码演示: 打开一个 PDF 文件 import os os.startfile("example.pdf", "print") 打印 PDF 文件 import win32api printer_name = "Microsoft Print to PDF" # 或者输入您想要使用的打印机名称 win32api.ShellExecute( 0, "print", "example.pdf", f'/d:"{printer_name}"', ".", 0 )

我正在尝试打印当前目录中的所有 pdf.当我在 cmd (singlepdf.sh) 中调用这个 bash 脚本时:'"C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe"'/t Gemeinde_348_BioID_842_alt.pdf 一切正常.

I'm trying to print all pdfs in current dir. When I call this bash script in cmd (singlepdf.sh): '"C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe"' /t Gemeinde_348_BioID_842_alt.pdf everything's working fine.

使用此内容调用 multiplepdfs.sh 时:

When calling multiplepdfs.sh with this content:

declare -a pdfs=(*.pdf) for pdf in ${pdfs[@]}; do echo -e " printing **$pdf** with AcroRd32.exe... " '"C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe"' /t $pdf sleep 3 done

回声显示文件在循环中被正确寻址 - 但随后我收到错误 "C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe": No such file or目录

The echo shows that files are addressed correctly in the loop - but then I get the error "C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe": No such file or directory

有人可以帮忙解决这个问题吗?

Can someone help out with this issue?

顺便说一句,我已经安装了 msys mingw

BTW, I have msys mingw installed

推荐答案

我知道这是一个老问题,但我最近遇到了同样的问题,但没有一个答案对我有用:

I know this is and old question, but i was faced with the same problem recently and none of the answers worked for me:

找不到旧的 Foxit Reader 版本 正如@pilkch 所说,2Printer 添加了一个报告页面 Adobe Reader 打开一个 gui

搜索了一些之后,我发现了这个:http://www.columbia.edu/~em36/pdftoprinter.html.

After searching a little more i found this: http://www.columbia.edu/~em36/pdftoprinter.html.

这是一个使用文件名调用的简单 exe,它会打印到默认打印机(或您指定的打印机).来自网站:

It's a simple exe that you call with the filename and it prints to the default printer (or one that you specify). From the site:

PDFtoPrinter 是一个用于从 Windows 命令行打印 PDF 文件的程序.该程序通常是为 Windows 命令行设计的,也适用于 vDos DOS 模拟器.

PDFtoPrinter is a program for printing PDF files from the Windows command line. The program is designed generally for the Windows command line and also for use with the vDos DOS emulator.

要将 PDF 文件打印到默认的 Windows 打印机,请使用以下命令:

To print a PDF file to the default Windows printer, use this command:

PDFtoPrinter.exe filename.pdf

要打印到特定打印机,请在引号中添加打印机名称:

To print to a specific printer, add the name of the printer in quotation marks:

PDFtoPrinter.exe filename.pdf "Name of Printer"

如果要打印到网络打印机,请使用出现在 Windows 打印对话框中的名称,如下所示(并注意名称开头的两个反斜杠和服务器名称后面的单个反斜杠):

If you want to print to a network printer, use the name that appears in Windows print dialogs, like this (and be careful to note the two backslashes at the start of the name and the single backslash after the servername):

PDFtoPrinter.exe filename.pdf "SERVERPrinterName"

这篇关于从 Windows 命令行打印 PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,WP2

admin_action_{$_REQUEST[‘action’]}

do_action( "admin_action_{$_REQUEST[‘action’]}" )动作钩子::在发送“Action”请求变量时激发。Action Hook: Fires when an ‘action’ request variable is sent.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$_REQUEST['action']引用从GET或POST请求派生的操作。源码(Source)更新版本源码位置使用被使用2.6.0 wp-admin/admin.php:...

日期:2020-09-02 17:44:16 浏览:1182 admin_footer-{$GLOBALS[‘hook_suffix’]}

do_action( "admin_footer-{$GLOBALS[‘hook_suffix’]}", string $hook_suffix )操作挂钩:在默认页脚脚本之后打印脚本或数据。Action Hook: Print scripts or data after the default footer scripts.目录锚点:#说明#参数#源码说明(Description)钩子名的动态部分,$GLOBALS['hook_suffix']引用当前页的全局钩子后缀。参数(Parameters)参数类...

日期:2020-09-02 17:44:20 浏览:1080 customize_save_{$this->id_data[‘base’]}

do_action( "customize_save_{$this-;id_data[‘base’]}", WP_Customize_Setting $this )动作钩子::在调用WP_Customize_Setting::save()方法时激发。Action Hook: Fires when the WP_Customize_Setting::save() method is called.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_data...

日期:2020-08-15 15:47:24 浏览:821 customize_value_{$this->id_data[‘base’]}

apply_filters( "customize_value_{$this-;id_data[‘base’]}", mixed $default )过滤器::过滤未作为主题模式或选项处理的自定义设置值。Filter Hook: Filter a Customize setting value not handled as a theme_mod or option.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_date['base'],指的是设置...

日期:2020-08-15 15:47:24 浏览:913 get_comment_author_url

过滤钩子:过滤评论作者的URL。Filter Hook: Filters the comment author’s URL.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/comment-template.php:32610...

日期:2020-08-10 23:06:14 浏览:942 network_admin_edit_{$_GET[‘action’]}

do_action( "network_admin_edit_{$_GET[‘action’]}" )操作挂钩:启动请求的处理程序操作。Action Hook: Fires the requested handler action.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$u GET['action']引用请求的操作的名称。源码(Source)更新版本源码位置使用被使用3.1.0 wp-admin/network/edit.php:3600...

日期:2020-08-02 09:56:09 浏览:891 network_sites_updated_message_{$_GET[‘updated’]}

apply_filters( "network_sites_updated_message_{$_GET[‘updated’]}", string $msg )筛选器挂钩:在网络管理中筛选特定的非默认站点更新消息。Filter Hook: Filters a specific, non-default site-updated message in the Network admin.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分$_GET['updated']引用了非默认的...

日期:2020-08-02 09:56:03 浏览:876 pre_wp_is_site_initialized

过滤器::过滤在访问数据库之前是否初始化站点的检查。Filter Hook: Filters the check for whether a site is initialized before the database is accessed.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/ms-site.php:93910...

日期:2020-07-29 10:15:38 浏览:841 WordPress 的SEO 教学:如何在网站中加入关键字(Meta Keywords)与Meta 描述(Meta Description)?

你想在WordPress 中添加关键字和meta 描述吗?关键字和meta 描述使你能够提高网站的SEO。在本文中,我们将向你展示如何在WordPress 中正确添加关键字和meta 描述。为什么要在WordPress 中添加关键字和Meta 描述?关键字和说明让搜寻引擎更了解您的帖子和页面的内容。关键词是人们寻找您发布的内容时,可能会搜索的重要词语或片语。而Meta Description则是对你的页面和文章的简要描述。如果你想要了解更多关于中继标签的资讯,可以参考Google的说明。Meta 关键字和描...

日期:2020-10-03 21:18:25 浏览:1767 谷歌的SEO是什么

SEO (Search Engine Optimization)中文是搜寻引擎最佳化,意思近于「关键字自然排序」、「网站排名优化」。简言之,SEO是以搜索引擎(如Google、Bing)为曝光媒体的行销手法。例如搜寻「wordpress教学」,会看到本站的「WordPress教学:12个课程…」排行Google第一:关键字:wordpress教学、wordpress课程…若搜寻「网站架设」,则会看到另一个网页排名第1:关键字:网站架设、架站…以上两个网页,每月从搜寻引擎导入自然流量,达2万4千:每月「有机搜...

日期:2020-10-30 17:23:57 浏览:1326


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3