如何在Adobe Acrobat Reader中反转PDF文件中的颜色以简化夜间阅读

00_lead_image_inverted colors

The PDF format is meant to ensure the formatting of a document is preserved when viewed on different operating systems and devices. If you’re viewing a document on a PC in a dark room, you might want to change the color scheme so the screen is not so bright.

PDF格式旨在确保在不同的操作系统和设备上查看时保留文档的格式。 如果要在暗室中的PC上查看文档,则可能需要更改配色方案,以使屏幕不太亮。

Adobe Acrobat Reader has a special setting just for this purpose, and we’ll show you how to select different color schemes that are more suited for reading in the dark. For example, the Apple Watch User Guide displays with a white background and black and light gray text. But, we’ll change that to look like the image above.

为此,Adobe Acrobat Reader具有特殊的设置,我们将向您展示如何选择更适合在黑暗中阅读的不同配色方案。 例如,《 Apple Watch用户指南》显示带有白色背景以及黑色和浅灰色文本。 但是,我们将其更改为上面的图像。

01_normal_colors_in_pdf_file

To change the color scheme, select “Preferences” from the “Edit” menu.

要更改配色方案,请从“编辑”菜单中选择“首选项”。

02_selecting_edit_preferences

On the Preferences dialog box, click “Accessibility” in the list of options on the left.

在“首选项”对话框中,单击左侧选项列表中的“可访问性”。

03_clicking_accessibility

In the Document Colors Options section, check the “Replace Document Colors” box. Then, select the “Use High-Contrast colors” option and select a color scheme from the “High-contrast color combination” drop-down list.

在“文档颜色选项”部分中,选中“替换文档颜色”框。 然后,选择“使用高对比度颜色”选项,然后从“高对比度颜色组合”下拉列表中选择一种配色方案。

04_use_high_contrast_colors

Click “OK” to save your changes and close “Preferences” dialog box.

单击“确定”保存更改并关闭“首选项”对话框。

05_clicking_ok

The color scheme changes in the document area. Notice that the Apple logo in our document is not very visible in the Apple Watch User Guide because it was already a dark color. You may find that some darker elements in some documents may be hidden when you invert the colors, depending on what color scheme you select.

配色方案在文档区域中更改。 请注意,我们文档中的Apple徽标在Apple Watch用户指南中不是很明显,因为它已经是深色。 您可能会发现,当您反转颜色时,某些文档中的某些较暗元素可能会被隐藏,具体取决于您选择的颜色方案。

06_inverted colors

This setting affects all documents you open in Adobe Acrobat Reader, so if you’re reading a document on your PC in a room with plenty of light and you want to display in the default color scheme, uncheck the “Replace Document Colors” box on the Preferences dialog box as described earlier in this article.

此设置会影响您在Adobe Acrobat Reader中打开的所有文档,因此,如果您在光线充足的房间中在PC上阅读文档,并且希望以默认配色显示,请取消选中“替换文档颜色”框。本文前面所述的“首选项”对话框。

翻译自: https://www.howtogeek.com/258313/how-to-invert-the-colors-in-a-pdf-file-in-adobe-acrobat-reader-for-easier-nighttime-reading/

以下是在程序使用Adobe Acrobat SDK将pdf文件发送到打印机进行打印的示例代码: ``` #include "stdafx.h" #include "Acrodist.h" void PrintPDF(const CString& filePath) { // Initialize Acrobat SDK CoInitialize(NULL); CAcroDistiller* pDistiller = NULL; HRESULT hr = CoCreateInstance(__uuidof(AcroDistiller), NULL, CLSCTX_INPROC_SERVER, __uuidof(CAcroDistiller), (void**)&pDistiller); if (FAILED(hr)) { MessageBox(NULL, _T("Failed to initialize Acrobat SDK."), _T("Error"), MB_OK | MB_ICONERROR); return; } // Set the job options VARIANT varJobOptions; VariantInit(&varJobOptions); varJobOptions.vt = VT_BSTR; varJobOptions.bstrVal = SysAllocString(L"DefaultJobOptions"); // Create the job options object IDispatch* pJobOptions = NULL; hr = pDistiller->CreateJobOptions(&pJobOptions); if (FAILED(hr)) { MessageBox(NULL, _T("Failed to create job options object."), _T("Error"), MB_OK | MB_ICONERROR); pDistiller->Release(); return; } // Set the job options object hr = pDistiller->SetJobOptions(varJobOptions, pJobOptions); if (FAILED(hr)) { MessageBox(NULL, _T("Failed to set job options object."), _T("Error"), MB_OK | MB_ICONERROR); pJobOptions->Release(); pDistiller->Release(); return; } // Create the job IDispatch* pJob = NULL; hr = pDistiller->CreateJob(filePath.AllocSysString(), NULL, NULL, &pJob); if (FAILED(hr)) { MessageBox(NULL, _T("Failed to create job."), _T("Error"), MB_OK | MB_ICONERROR); pJobOptions->Release(); pDistiller->Release(); return; } // Set the job options for the job hr = pJob->SetJobOption(_T("Print"), _T("True")); if (FAILED(hr)) { MessageBox(NULL, _T("Failed to set job option for printing."), _T("Error"), MB_OK | MB_ICONERROR); pJob->Release(); pJobOptions->Release(); pDistiller->Release(); return; } // Start the job hr = pJob->Start(); if (FAILED(hr)) { MessageBox(NULL, _T("Failed to start job."), _T("Error"), MB_OK | MB_ICONERROR); pJob->Release(); pJobOptions->Release(); pDistiller->Release(); return; } // Wait for the job to complete VARIANT varComplete; VariantInit(&varComplete); varComplete.vt = VT_BOOL; varComplete.boolVal = VARIANT_FALSE; while (varComplete.boolVal == VARIANT_FALSE) { hr = pJob->GetJobOption(_T("Complete"), &varComplete); if (FAILED(hr)) { MessageBox(NULL, _T("Failed to get job option for completion."), _T("Error"), MB_OK | MB_ICONERROR); pJob->Release(); pJobOptions->Release(); pDistiller->Release(); return; } } // Release the job and job options objects pJob->Release(); pJobOptions->Release(); // Release the distiller object pDistiller->Release(); // Uninitialize Acrobat SDK CoUninitialize(); } ``` 该函数接受一个文件路径参数,并使用该路径创建一个Acrobat Distiller作业。然后,它设置打印作业选项,并将作业设置为打印。最后,它启动作业并等待作业完成。如果作业成功完成,则PDF文件将被发送到默认打印机进行打印。如果出现任何错误,则会显示一个错误消息框。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值