如何将多个不同大小的PostScript文件转换为单个PDF? [英] How to convert multiple, different-sized PostScript files to a single PDF?

查看:154
本文介绍了如何将多个不同大小的PostScript文件转换为单个PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用与此类似的命令:

I'm using a command similar to this:

gswin32c.exe -dNOPAUSE -dBATCH -q -dSAFER -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile="path/output.pdf" <PSfiles>

这给了我一个pdf文档,每个PS文档都以页面的形式表示.但是,页面大小翻译得不好.原始PS文件大小各异,每个生成的pdf页面均被截取为相同大小,看起来像是A4横向.

This gives me a single pdf document with each PS document represented as a page. However, the page sizes do not translate well. The original PS files are all different sizes and each resulting pdf page is cutoff to the same size, which looks like landscape A4.

当我使用完全相同的命令转换单个PS文件时,将保留页面大小.如此看来,由于所有PS文件都被发送到相同的pdf,因此它们都必须具有相同的页面大小,并且我丢失了内容.无论如何,仍然可以使用单个命令来保留文档大小吗?

When I convert a single PS file with the exact same command, the page size is preserved. So it seems like since all the PS files are being sent to the same pdf, they must all have the same page size and I lose content. Is there anyway to preserve the document sizes while still using a single command?

更新:我最初使用的是GS 8.63,但是我下载了9.06并遇到了同样的问题. 此外,我将问题缩小了范围.似乎有一个导致问题的特定PS文件(称为问题文件.ps),因为只要排除问题文件我就可以成功运行该命令.而且,如果它是命令行中包含的最后一个文件,则只会引起问题.我无法发布整个文件,但是我应该查看任何潜在的问题区域吗?

Update: I was originally using GS 8.63, but I downloaded 9.06 and have the same issue. Additionally, I've narrowed the problem down. It seems like there is one specific PS file (call it problemFile.ps) that causes the problem, as I can run the command successfully as long as I disclude problemFile.ps. And it only causes a problem if it is the last file included on the command line. I can't post the entire file, but are there any potential problem areas I should look at?

Update2:好的,我说一个特定的问题文件是错误的.似乎命令行中包含的最后一个文件的页面大小设置了所有结果页面的最大页面大小.

Update2: Okay I was wrong in saying there is one specifc problem file. It appears that the page size of the last file included on the command line sets the maximum page size for all the resultant pages.

推荐答案

只要每个PostScript文件(或实际上每个页面)实际请求的媒体大小不同,则生成的PDF文件将接受这些请求.我知道这至少可以正常工作,我已经对其进行了测试.

As long as each PostScript file (or indeed each page) actually requests a different media size then the resulting PDF file will honour the requests. I know this at least used to work, I've tested it.

不过,您可能需要重新考虑命令行中的某些内容:

However there are some things in your command line which you might want to reconsider:

1)在调查GS问题时,不要使用-q,这样可以防止Ghostscript告诉您潜在的有用信息.

1) When investigating problems with GS, don't use -q, this will prevent Ghostscript telling you potentially useful things.

2)不要使用-dPDFSETTINGS,除非您已阅读相关文档并了解每个参数设置的含义.

2) DON'T use -dPDFSETTINGS unless you have read the relevant documentation and understand the implications of each parameter setting.

3)您可能要关闭AutoRotatePages,或至少将其设置为/PageByPage

3) You may want to turn off AutoRotatePages, or at least set it to /PageByPage

我的猜测是您的PostScript文件不要求媒体大小,因此使用默认媒体.当然,我不能不看示例就知道.

My guess is that your PostScript files don't request a media size and therefore use the default media. Of course I can't tell without seeing an example.

注意,您也不会说您使用的是哪个版本的Ghostscript.

NB you also don't say what version of Ghostscript you are using.

这篇关于如何将多个不同大小的PostScript文件转换为单个PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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