ghostscript

ImageMagick: Different PDF render results when exec() in PHP?

I'm using ImageMagick to render PDFs as master JPGs as an intermediate step before making thumbnail images of various sizes, and I'm getting different results when I execute the command in PHP using exec() than I get when I run it on the command line directly. This is the command I'm using: exec("/opt/local/bin/convert -geometry 1000x1...

Weird problem, with ghostscript and pdf files.

Hello, am using ghostscript to create pdf file from postscript file. My PS file, doesn't have orientation instructions, so when I want to create landscape pdf file, I'm using ghostscript to rotate the page. The problem is, that ghostscript rotates only the first page, and when my pdf file is more than 1 page, the others, are not rotated ...

Create pdf file with ghostscript

Hello, I'm using SCO Unix, with old version of ghostscript (7.7). When I convert the postscript source file to pdf otput file, It's content is visible on the SCO machine. But when I copy the pdf file into windows, and open it with adobe acrobat, all I can see is a blank page. Does anybody have a solution to this? ...

What "thread safe" really means...In Practical terms

Dear all, please bear with my newbie questions.. I was trying to convert PDF to PNG using ghostscript, with ASP.NET and C#. However, I also read that ghostscript is not thread safe. So my questions are: 1) What exactly does "ghostscript is not thread safe" mean in practical terms? What impact does it have if I use it in a live ASP.NET(...

using ghostscript in server mode to convert pdfs to pngs

while i am able to convert a specific page of a PDF to a PNG like so: gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 -sOutputFile=gymnastics-20.png -dFirstPage=20 -dLastPage=20 gymnastics.pdf i am wondering if i can somehow use ghostscript's JOBSERVER mode to process several conversions without having to incur the ...

Can Ghostscript to start numbering pages from zero?

I am using Ghostscript to convert a multi-page pdf to individual jpg files and can get it to output the files numbered like page_%03d.jpg but it always starts at page_001.jpg and i need it to start numbering the output files starting from page_000.jpg. Is there a setting i can use to get Ghostscript to start at zero or am i going to hav...

Using Ghostscript in a Webapplication (PDF Thumbnails)

Hello, i am using the ghostscriptsharp wrapper for c# and ghostscript. I want to generate thumbnails out of pdf-files. Further Information on the sample-code are given here. There are different Methods imported form the ghostscript-c-dll "gsdll32.dll". [DllImport("gsdll32.dll", EntryPoint = "gsapi_new_instance")] private static exte...

Imagemagick PDF to JPG conversion failing

I'm trying to convert the first page of a PDF to a JPG. I'm pretty sure I got this to work with certain PDFs, but is it really possible that certain PDFs are made incorrectly and cannot be converted? I tried running this first: $ convert 10-03-26.pdf[1] test.jpg And I got the follow: Error: /syntaxerror in readxref Operand stack: E...

Ghostscript for Linux

i am working with Ghostscript for Linux .wha are the differences? ...

How to print PDF on default network printer using GhostScript (gswin32c.exe) shell command

I'd like to print PDF file(s) on windows' network printer via GhostScript. (I dont want to use Adobe Reader) I've read gswin32c.exe which can do the job. I experimented with many commands and coudn't find the way how to force gs to print PDF on my (windows default) network drive. I don't need point exact network printer- default c...

How to shift PDF page using perl (CAM::PDF, PDF::API2)?

Hi all, I have a PDF document which I need to shift the pages to the right several inches. I.e like putting a margin on the left hand side of the page. Can either CAM::PDF or PDF::API2 do it? Or is there anyone have experience with it? Thanks. ...

Hooks in ghostscript

Anyone know the right places to hook into ghostscript, so that when interpreting a ps file, I can get logs of all calls of the form: draw_character(float x, float y, string font_name, int char_id); ? Basically I want to take a postscript file, and get a list of where all characters are drawn to the screen. Thanks! ...

Obey the MediaBox/CropBox in PDF when using ghostscript to render a PDF to a png

I've been using ghostscript to convert my single figure plots rendered in PDF to png: gswin32c -sDEVICE=png16m -r300x300 -sOutputFile=junk.png -dBATCH -dNOPAUSE Figure_001-a.pdf This works in the sense I get a png out and it contians the plot. But it contains a huge amount of white space as well (an example source image: http://cdsweb...

How to get Ghostscript to use embedded fonts in PDF

gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf I'm using (trying anyway) to use Ghostscript to reduce my PDF file size. The command above looks like it works, it reduces file size greatly, but then several of the fields are garbled. As for as I can track it down, ...

Can GhostScript run in Medium Trust?

I am using GhostScript to generate some thumbnails of PDF pages in an ASP.NET application. I have it wrapped in this library called GhostScriptSharp that just uses DllImport to call methods in the GhostScript DLL. It looks like this wont work on a medium trust hosting environment, either because of the fact that it is calling unmanaged...

Convert large raster graphics image(bitmap, PNG, JPEG, etc) to non-vector postscript

How to convert an large image and embed it into postscript? I used to convert the bitmap into HEX codes and render with colorimage. It works for small icons but I hit a /limitcheck error in ghostscript when I try to embed little larger images. It seem there is a memory limit for bitmap in ghostscript. I am looking a solution which can ...

Dynamically generated PDF files working in most readers except Adobe Reader

I'm trying to dynamically generate PDFs from user input, where I basically print the user input and overlay it on an existing PDF that I did not create. It works, with one major exception. Adobe Reader doesn't read it properly, on Windows or on Linux. QuickOffice on my phone doesn't read it either. So I thought I'd trace the path of me ...

Using GhostScript to get page size

Is it possible to get the page size (from e.g. a PDF document page) using GhostScript? I have seen the "bbox" device, but it returns the bounding box (it differs per page), not the TrimBox (or CropBox) of the PDF pages. (See http://www.prepressure.com/pdf/basics/page_boxes for info about page boxes.) Any other possibility? ...

Can I use/include gsdll32.dll redmonnt.dll (no modifications) in a commercial application for my client?

I am not a license expert; however, after a lot of research, I am still struggling to answer the following questions and would like to know if my assumptions are right! Is it legal to include gsdll32.dll and redmonnt.dll in a commercial product? Should I release any source code of the commercial app where I am using this library? Is th...

PDF Manipulations

I'm looking for a solution that will allow me to do the following to PDF documents: Insert PDF pages into existing PDF documents Delete PDF pages from existing PDF documents Change the orientation of certain PDF pages Any solutions I should be looking at? My output needs to be PDF. ...