ghostscript

Thumbnail generation with Ghostscript rotates my device size definition for landscape pdf pages

末鹿安然 提交于 2020-01-13 19:44:22
问题 I want to use GS to generate thumbnails from pdf files. The thumbnail must fit a 90x120 pixel rectangle The image should not be rotated The image should be resized to fit the rectangle with keeping aspect ratio I use the following command: gswin32 -dPDFFitPage -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 -dDEVICEWIDTH=90 -dDEVICEHEIGHT=120 -dORIENT1=true -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=output.%d.jpg input

Convert PDF to CMYK but ignore black?

大城市里の小女人 提交于 2020-01-13 19:01:17
问题 I am converting an RGB PDF to CMYK using the following command: /usr/local/bin/gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \ -sColorConversionStrategy=CMYK -sColorConversionStrategyForImages=CMYK \ -dProcessColorModel=/DeviceCMYK -dEncodeColorImages=false \ -dEncodeGrayImages=false -dEncodeMonoImages=false -sOutputFile=CMYK.PDF RGB.PDF The resulting file is 100% CMYK, however anything that was 100% black in the RGB PDF is now: C: 72% M: 68% Y: 67% K: 89% The result is that black

How can I convert .eps file to .pdf in Mathematica?

你离开我真会死。 提交于 2020-01-13 06:14:50
问题 How can I convert .eps to .pdf inside Mathematica (perhaps using GhostScript?)? 回答1: After installing GhostScript and setting appropriate environment variables (for Windows you should add gs\bin and gs\lib to the PATH , where gs is the top-level Ghostscript directory) you can use Jens Nöckel's method for converting .eps to .pdf (all the glyphs will be outlined): gsEPS2PDF[epsPath_String, pdfPath_String] := Run["gswin64c.exe -sDEVICE=pdfwrite -dNOCACHE -sOutputFile=\"" <> pdfPath <> "\" -q

How can I convert .eps file to .pdf in Mathematica?

£可爱£侵袭症+ 提交于 2020-01-13 06:14:06
问题 How can I convert .eps to .pdf inside Mathematica (perhaps using GhostScript?)? 回答1: After installing GhostScript and setting appropriate environment variables (for Windows you should add gs\bin and gs\lib to the PATH , where gs is the top-level Ghostscript directory) you can use Jens Nöckel's method for converting .eps to .pdf (all the glyphs will be outlined): gsEPS2PDF[epsPath_String, pdfPath_String] := Run["gswin64c.exe -sDEVICE=pdfwrite -dNOCACHE -sOutputFile=\"" <> pdfPath <> "\" -q

Ghostscript to merge PDFs compresses the result

喜欢而已 提交于 2020-01-10 06:26:26
问题 I found this neat command to merge multiple PDF into one, using Ghostscript: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf The resulting size is smaller than the combined size of the 2 PDFs. Running the command with a single file as input still results to a smaller size output file. Is there an option on Ghostscript to just copy the pages as they appear on merging without doing any compression? If not, is it possible that the Ghostscript compression is so good

How to install, test, convert, resize PDF using ImageMagick, Ghostscript, Windows Vista/7 x64

北战南征 提交于 2020-01-09 09:54:09
问题 I'm having trouble with getting ImageMagick and Ghostscript to work together - everything seems difficult, from installation, to testing, to actually using the software. Does anyone have any tips? 回答1: I've just spent the last three hours getting ImageMagick to play nicely with PHP for a PDF to JPG convert. Instead of documenting it myself locally, I figured I'd write it up here, with all the buzzwords and things I screwed up, so the next noob can save some time. Tested on two OSs,Windows 7

How to install, test, convert, resize PDF using ImageMagick, Ghostscript, Windows Vista/7 x64

三世轮回 提交于 2020-01-09 09:53:26
问题 I'm having trouble with getting ImageMagick and Ghostscript to work together - everything seems difficult, from installation, to testing, to actually using the software. Does anyone have any tips? 回答1: I've just spent the last three hours getting ImageMagick to play nicely with PHP for a PDF to JPG convert. Instead of documenting it myself locally, I figured I'd write it up here, with all the buzzwords and things I screwed up, so the next noob can save some time. Tested on two OSs,Windows 7

How can I shift page images in PDF files more to the left or to the right?

心已入冬 提交于 2020-01-09 05:06:12
问题 We have a bunch of scanned pages (about 600) for which every PDF viewer displays the image with zero margin on the right edge, but about 2 inch margin on the left. (Presumably while scanning, there was a wrong setting used...) We want to print these pages, preferably as a booklet. Is there a way to permanently shift all page images towards the center and have the PDF display these pages also in a more pleasing way? Can Ghostscript do that? Can one do this with some other method, such as

轻松搭建基于 Serverless 的文档图片在线转换服务

十年热恋 提交于 2020-01-08 14:23:44
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 函数计算(Function Compute) : 函数计算 是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。函数计算更多信息 参考 。 1 核心优势 异构服务:支持多种运行环境 用于媒体文件转换的库或者二进制往往和业务的运行环境不同,对计算资源的需求也有较大的差异。 函数计算支持多种运行环境,支持为独立的转换函数定制算力单位,根据请求量自动伸缩,让核心业务和支持业务做到较好的分离。 灵活触发:支持多种触发方式 函数计算既可以通过集成事件源服务(OSS、API 网关、日志服务和表格存储)产生事件来触发函数执行,也可以通过 HTTP 触发器使用 HTTP 请求触发函数执行,还支持 API/SDK 直接调用函数。 弹性伸缩: 轻松应对负载的波峰波谷 函数计算提供跨可用区的容灾能力,根据请求量自动进行毫秒级弹性扩容,快速调度计算资源,轻松应对业务洪峰。 预留实例功能彻底消除实例冷启动带来的延时毛刺,为在线应用迁移至函数计算扫清障碍! 工程效率:搭建速度快,运维代价小 使用函数计算,开发者无需管理服务器等基础设施,只需编写并上传代码,函数计算准备好计算资源,弹性可靠地运行任务

开发函数计算的正确姿势——借助 Ghostscript 将 PDF 转换成 JPG

余生颓废 提交于 2020-01-07 19:41:26
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前言 首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute) :函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。函数计算更多信息 参考 。 Fun :Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API 网关、日志服务等资源。它通过一个资源配置文件(template.yml),协助您进行开发、构建、部署操作。Fun 的更多文档 参考 。 Ghostscript :Ghostscript 是一套建基于Adobe、PostScript及可移植文档格式(PDF)的页面描述语言等而编译成的自由软件。参见维基百科 词条 备注: 本文介绍的技巧需要 Fun 版本大于等于 3.0.0-beta.7 。 依赖工具 本项目是在 MacOS 下开发的,涉及到的工具是平台无关的,对于 Linux 和 Windows 桌面系统应该也同样适用。在开始本例之前请确保如下工具已经正确的安装,更新到最新版本,并进行正确的配置。 Docker Fun Fun 工具依赖于 docker 来模拟本地环境。 对于 MacOS