如何使用设备tiffsep1和其他分离色将半色调(sethalftone)设置为每种分离色? [英] How can I set halftone (sethalftone) to each separation color with device tiffsep1 and other separation ones?

查看:126
本文介绍了如何使用设备tiffsep1和其他分离色将半色调(sethalftone)设置为每种分离色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该代码有效,但注释的代码将创建错误.例如,不能通过将-sDEVICE更改为tiffgray来解决该错误.

String[] ARGS = new String[] {
                "",
                "-sDEVICE=tiffsep1",
                "-r1200",
                "-o out.tiff",
                "SOSample.pdf",
                //"-c",
                //"<< /HalftoneType 1 /Frequency 300 /Angle 45 /SpotFunction {180 mul cos exch 180 mul cos add 2 div} >> sethalftone",
                //"-f"
            };

如何用ghostscript定义sethalftone,如何为tiffsep1的每种颜色设置它?我对一种颜色有何疑问?如何进行分离?

我正在使用:

        [DllImport("gsdll64.dll", EntryPoint = "gsapi_init_with_args")]
        public static extern int INSTANCEStart(IntPtr instance, int argc, string[] argv);

以此类推.

我正在使用 Ghostscript 9.52 .

可能有帮助的事情(\"):

"-c",
"\"<</Orientation 1>> setpagedevice\"",

解决方案

您需要使用sethalftone PostScript运算符来更改半色调.显然,这将涉及编写一些PostScript.

不仅如此,您还需要设置默认的半色调,或者在页面的开头设置半色调,因为Ghostscript中的当前PDF解释器会在PDF文件的每一页的开始处进行初始化. /p>

对于所有这些,您将需要一份《 PostScript语言参考手册》的副本,您可以从Adobe网站上的某个地方获得该副本.他们一直在移动东西,所以我不会尝试发布链接,只是在google上找到手册的名称.您需要第三版.

因此,您需要编写一个BeginPage过程,您将在第6章的设备控制下的第427页起找到该过程.

BeginPage过程将需要设置一个半色调,您将发现第480页第7.4节中介绍的半色调.您可能想使用2型或4型半色调字典.

组装完成后,您需要先将其传递给Ghostscript,然后再处理PDF文件.最简单的方法是将PostScript程序放入文件(例如setup.ps)中,然后将该文件名放在PDF文件名之前的命令行中.

例如:

gs -r1200 -sDEVICE = tiffsep1 -o out%d.tif setup.ps sample.pdf

请注意,PDF文件本身可以包含半色调规范(在PDF 2.0中已弃用),并且Ghostscript将采用PDF文件中的任何半色调.

最后;这是一个不寻常的请求,并且鉴于您正在编写链接到Ghostscript DLL的代码,因此我认为您可能会在商业上使用Ghostscript.您应该查看AGPL以确保您遵守许可条款.如果您打算分发您的应用程序,则几乎可以肯定需要商业许可证.

The code works but the commented code will create an error. The error are not solved by changing -sDEVICE to tiffgray, for example.

String[] ARGS = new String[] {
                "",
                "-sDEVICE=tiffsep1",
                "-r1200",
                "-o out.tiff",
                "SOSample.pdf",
                //"-c",
                //"<< /HalftoneType 1 /Frequency 300 /Angle 45 /SpotFunction {180 mul cos exch 180 mul cos add 2 div} >> sethalftone",
                //"-f"
            };

How can I define sethalftone with ghostscript and how can I set it for each color of tiffsep1? What am I doing wrong with one color and how to make it for separations?

I'm using:

        [DllImport("gsdll64.dll", EntryPoint = "gsapi_init_with_args")]
        public static extern int INSTANCEStart(IntPtr instance, int argc, string[] argv);

and so on.

I'm working with Ghostscript 9.52.

Something that could help (\"):

"-c",
"\"<</Orientation 1>> setpagedevice\"",

解决方案

You need to use the sethalftone PostScript operator in order to change the halftone. Obviously this will involve writing some PostScript.

Not only that, but you really need to set the default halftone, or set the halftone at the start of the page, because the current PDF interpreter in Ghostscript does an initgraphics at the start of every page of a PDF file.

For all of this you are going to need a copy of the PostScript Language Reference Manual, which you can get from somewhere on the Adobe web site. They keep moving stuff around so I'm not going to try and post a link, just google for the name of the manual. You want the third edition.

So you need to write a BeginPage procedure, which you will find covered in Chapter 6 under device control, pages 427 onwards.

The BeginPage procedure will need to set a halftone, and you will find halftones covered in Section 7.4, page 480 onwards. You will presumably want to use either a type 2 or type 4 halftone dictionary.

When you've assembled that, you then need to pass it to Ghostscript before you process the PDF file. The simplest method is to put the PostScript program in a file (called eg setup.ps) and then put that filename on the command line immediately before the PDF filename.

Eg:

gs -r1200 -sDEVICE=tiffsep1 -o out%d.tif setup.ps sample.pdf

Note that PDF files can contain a halftone specification themselves (this is deprecated in PDF 2.0) and Ghostscript will honour any halftone in a PDF file.

Finally; this is an unusual request and, given that you are writing code to link to the Ghostscript DLL, makes me think you may be using Ghostscript commercially. You should review the AGPL to ensure you are complying with the terms of the license. If you plan on distributing your application you will almost certainly need a commercial license.

这篇关于如何使用设备tiffsep1和其他分离色将半色调(sethalftone)设置为每种分离色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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