ghostscript

How to change page orientation of PDF? (Ghostscript or PostScript solution needed)

我们两清 提交于 2019-11-30 08:08:52
Given a PDF document, how do I change individual page orientation? I'm using latest version of Ghostscript. Why do you require usage of Ghostscript? Would it be acceptable to use another Free, Open Source Software tool running on the commandline, such as pdftk ? Anyway, here is how to rotate pages with Ghostscript. However, this may not work for your intentions, because you cannot force a certain orientation for an individual page only. It relies on an internal Ghostscript algorithm that tries to rotate pages automatically, depending on the flow of text inside the PDFs: * -dAutoRotatePages=

Converting searchable PDF to a non-searchable PDF

不想你离开。 提交于 2019-11-30 07:01:03
问题 I have a PDF which is searchable and I need to convert it into a non-searchable one. I tried using Ghostscript and change it to JPEG and then back to PDF which does the trick but the file size is way too large and not acceptable. I tried using Ghostscript to convert the PDF to PS first and then PDF which does the trick as well but the quality is not good enough. gswin32.exe -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite -r1000 -sOutputFile=out.ps in.pdf gswin32.exe -q -dNOPAUSE -dBATCH -dSAFER

Converting a multiple-page PDF to a single image

旧街凉风 提交于 2019-11-30 06:54:46
I'm attempting to convert a PDF into a single image using GhostScript. Only the first page is converted, while my intention is to generate a horrendously tall PNG/JPG image with all the pages concatenated together. These are the parameters I'm currently passing to the GhostScript DLL (via a .NET application): pdf2img \ -dNOPAUSE \ -dBATCH \ -dSAFER \ -sDEVICE=png256 \ -dGraphicsAlphaBits=4 \ -dTextAlphaBits=4 \ -dDOINTERPOLATE \ -dAlignToPixels=1 \ -r300x300 \ -sOutputFile=GLOSS.png \ GLOSS.pdf Is it possible to concatenate all the pages together via GhostScript? Or should I resort to an

Ghostscript: PDF total pages

删除回忆录丶 提交于 2019-11-30 06:47:18
问题 I'm using Ghostscript library API (wrapping from C#) to print PDF documents from my application. With the ' -dFirstPage ' and ' -dLastPage ' parameters I'm able to select an range of pages to be printed, but how about the total number of a PDF's pages? It is not very nice to allow a user to select a page interval from 2 to 10 when, let me say, the PDF document has only 4 pages. Consider that I'm using Ghostscript library through the gsapi_init_with_args API library call. 回答1: Ghostscript can

Convert: Postscript delegate failed

不想你离开。 提交于 2019-11-30 05:42:56
I am trying to convert a PDF to JPEG: $ convert pdf-test.pdf pdf-test.pdf.jpg However, I am getting this error: convert: Postscript delegate failed `pdf-test.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/664. convert: missing an image filename `pdf-test.pdf.jpg' @ error/convert.c/ConvertImageCommand/3015. Currently I am using this version of GS and ImageMagick on Mac OS X Lion: $ gs -v GPL Ghostscript 9.02 (2011-03-30) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. $ convert -version Version: ImageMagick 6.7.1-1 2011-07-21 Q16 http://www.imagemagick.org Copyright:

How to adjust BoundingBox of an EPS file?

假装没事ソ 提交于 2019-11-30 05:37:59
问题 I want to crop main area of a PS or PDF file to create an EPS file without white space. Commands of ghostrcipt , ps2pdf , epstools can crop the main drawing out of the document file. The problem is that they only crop in its original form, but I want to create an EPS file with BoundingBox 0 0 x y ; cropped and moved to the bottom left corner. The difference i when we want to insert the resulting EPS file inside a PS document. When having BoundingBox x0 y0 x y , the PS document inserts the EPS

Remove all text from PDF file

北城余情 提交于 2019-11-30 05:20:46
I am using Ghostscript to convert source PDF file into array of PNG images. Before I convert PDF page into PNG image I would need to extract (delete) all text from PDF so that converted page image would contain all other elements, excluding text. Can I achieve this with Ghostscript or will I need to look into different tools? I would also be interested in a tool that can read-save my source PDF removing all the text. Since my previous answer, development has continued, and a new option is available now, which justifies a new answer. The most recent versions of Ghostscript support 3 new

Converting a multi page pdf to multiple pages using a single command

依然范特西╮ 提交于 2019-11-30 04:27:28
I want to convert multi page pdfs into single page images efficiently. I already know how to do this one page at a time with imagemagick. For example, convert x.pdf[2] x3.jpg will give me the 3rd page of the pdf as an image. So if I figure out how many pages are in the pdf using identify then I can loop through and convert all pages in the pdf to images. This method can however take a while. For example a 15 page pdf could take anywhere between 15-30 seconds. According to answers that I have seen elsewhere (also on the imagemagick forums) the following imagemagick command should split a pdf

How to crop a section of a PDF file to PNG using Ghostscript

烂漫一生 提交于 2019-11-30 04:05:00
I need to crop a certain section in my PDF file to PNG (this will be automated using Ghostscript with PHP). This is what i do now which basically turns the first page of a PDF to PNG: gs -q -dNOPAUSE -dBATCH \ -sDEVICE=pngalpha -dEPSCrop \ -sOutputFile=output.png input.pdf Specifically, i'm trying to crop this top left card to a PNG. I'm also open for more suggestions on how to accomplish this. First, determine the bounding box of your first PDF page: gs \ -q \ -dBATCH \ -dNOPAUSE \ -sDEVICE=bbox \ -dLastPage=1 \ stackoverflowQuestion.pdf \ 2>&1 \ | grep %%BoundingBox The resulting output will

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

℡╲_俬逩灬. 提交于 2019-11-30 03:02:37
前言 首先介绍下在本文出现的几个比较重要的概念: 函数计算(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 用户可以使用 homebrew 进行安装: brew cask