简体   繁体   English

如何使用Mako SDK模拟PDF中的叠印?

[英]How do I simulate overprint in a PDF using the Mako SDK?

I'm using the Mako SDK and I want to output to SVG. 我正在使用Mako SDK,并且想输出到SVG。 Before I do so, I want to simulate overprint. 在此之前,我想模拟叠印。

I'm using the ISVGGenerator class, but I can't see any methods on it to control overprint simulation. 我正在使用ISVGGenerator类,但是看不到任何控制套印​​模拟的方法。 If I look at the IJawsRenderer class, I can't see any methods on it either. 如果我查看IJawsRenderer类,则也看不到任何方法。

How can I turn overprint simulation on? 如何打开套印模拟?

To use overprint simulation, you need to use a transform, rather than set a flag on a given output. 要使用套印模拟,您需要使用变换,而不是在给定的输出上设置标志。

This transform will then run over the node tree that you give it, updating and rendering to result in the DOM being modified so that it simulates overprint. 然后,此转换将在您提供给它的节点树上运行,进行更新和渲染以使DOM被修改,从而模拟叠印。

Mako provides a standard transform for this purpose. 为此,Mako提供了一个标准转换。 This code sets it up: 此代码将其设置:

// Setup the overprint simulation transform
IOverprintSimulationTransformPtr transform = IOverprintSimulationTransform::create(jawsMako);
transform->setSimulateBlackDeviceGrayTextOverprint(false);
transform->setResolution(300);

And you can apply this transform to the page using: 您可以使用以下方法将此转换应用于页面:

IPagePtr page = document->getPage(0);
transform->transformPage(page);

If you want to apply overprint simulation to a page for rendering, but don't want it to affect the original page DOM, you can clone the page first, using: 如果要将套印模拟应用于页面以进行渲染,但又不想影响原始页面DOM,则可以使用以下方法首先克隆页面:

IPage::clone()

And then apply the transform to the cloned page. 然后将转换应用于克隆的页面。 After rendering the cloned page, it can then be discarded. 呈现克隆的页面后,可以将其丢弃。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM