Questions tagged [postscript]

PostScript is a Turing-complete page description programming language, designed and developed by Adobe. There are three major releases: PostScript Level 1, released in 1984. PostScript Level 2 (1991) contained several important improvements. PostScript 3 (1997) is the latest version.

Filter by
Sorted by
Tagged with
85 votes
10 answers
82k views

Is there a way to change effective process name in Python?

Can I change effective process name of a Python script? I want to show a different name instead of the real name of the process when I get the system process list. In C I can set strcpy(argv[0],"...
Emilio's user avatar
  • 3,901
12 votes
2 answers
7k views

How can I remove all images from a PDF?

I want to remove all images from a PDF file. The page layouts should not change. All images should be replaced by empty space. How can this be achieved with the help of Ghostscript and the ...
Kurt Pfeifle's user avatar
  • 86.9k
54 votes
8 answers
48k views

Matplotlib Plots Lose Transparency When Saving as .ps/.eps

I'm having an issue with attempting to save some plots with transparent ellipsoids on them if I attempt to save them with .ps/.eps extensions. Here's the plot saved as a .png: If I choose to save ...
astromax's user avatar
  • 6,011
10 votes
4 answers
14k views

Is it possible in Ghostscript to add watermark to every page in PDF

I convert PDF -> many JPEG and many JPEG -> many PDF using ghostscript. I need to add watermark text on every converted JPEG (PDF) page. Is it possible using only Ghostscript and PostScript? The only ...
radistao's user avatar
  • 14.9k
68 votes
11 answers
68k views

overlay one pdf or ps file on top of another

I have two pdf or postscript files (I can work with either one). What I want to do is merge each page on top of the other so that page1 of document A will be combined with page 1 of document B to ...
JohnnyLambada's user avatar
20 votes
6 answers
42k views

How to create a virtual printer in Windows?

I want to create a virtual printer driver for Windows. How and where can I start properly? The WDK has some printing drivers examples that do not seems a good introductory. MSDN also doesn't seems to ...
Terminus's user avatar
  • 902
8 votes
6 answers
33k views

How to merge two postscript files together?

I am trying to merge two or more postscript files into one. I tried concatenation but it does not work as each postscript file may have different resource header. Have anyone done this before? Are ...
Syd's user avatar
  • 1,526
5 votes
3 answers
29k views

Print PDF document with python's win32print module?

I'm trying to print a PDF document with the win32print module. Apparently this module can only accept PCL or raw text. Is that correct? If so, is there a module available to convert a PDF document ...
slypete's user avatar
  • 5,558
73 votes
4 answers
105k views

How to get pid given the process name

Hi I have searched various forums and here as well, I could find some answers for Linux and Mac but not able to find solution for Unix and specially Korn Shell. How to get process name (command name) ...
gahlot.jaggs's user avatar
  • 1,083
38 votes
15 answers
36k views

How to add page numbers to Postscript/PDF

If you've got a large document (500 pages+) in Postscript and want to add page numbers, does anyone know how to do this?
Brian M. Hunt's user avatar
26 votes
8 answers
23k views

How to change argv0 in bash so command shows up with different name in ps?

In a C program I can write argv[0] and the new name shows up in a ps listing. How can I do this in bash?
bstpierre's user avatar
  • 30.1k
17 votes
5 answers
45k views

how do I get the process list in Python?

How do I get a process list of all running processes from Python, on Unix, containing then name of the command/process and process id, so I can filter and kill processes.
Johan Carlsson's user avatar
9 votes
4 answers
8k views

How to use non-ASCII characters in Matlab figures (for use in LaTeX doc)?

I am using including Matlab-drawn figures into LaTeX. My usual workflow is as following: Script in matlab creates figure(s), I tweak what I find needs to be tweaked in visual figure editor, Figure is ...
triazotan's user avatar
  • 2,192
5 votes
2 answers
3k views

How do Bezier Patches work in the Utah Teapot?

I prematurely posted a code golf challenge to draw the Utah Teapot using this dataset (just the teapot). (Revised and Posted teapot challenge) But when I looked deeper at the data in order to whip up ...
luser droog's user avatar
47 votes
2 answers
17k views

How to make stroke width immune to the current transformation matrix

In SVG (and Canvas, Quartz, Postscript, ...), the transformation matrix affects both the path coordinates and the line width. Is there a way to make an adjustment so the line width is not affected? ...
xan's user avatar
  • 7,521
27 votes
7 answers
9k views

Why does ps o/p list the grep process after the pipe?

When I do $ ps -ef | grep cron I get root 1036 1 0 Jul28 ? 00:00:00 cron abc 21025 14334 0 19:15 pts/2 00:00:00 grep --color=auto cron My question is why do I see the ...
Ankur Agarwal's user avatar
20 votes
3 answers
116k views

Check if program is running with bash shell script?

This is an example of a bash script which checks for some running process (daemon or service) and does specific actions (reload, sends mail) if there is no such process running. check_process(){ ...
Charlie Epps's user avatar
  • 3,605
15 votes
4 answers
15k views

Can transparency be used with PostScript/EPS?

I am trying to save an R plot as an EPS file but I have a problem with the following component of the plot - the gray transparent polygon (transparent black = gray effect): polygon(x.polygon, y....
Oposum's user avatar
  • 1,155
12 votes
8 answers
26k views

ps: Clean way to only get parent processes?

I use ps ef and ps rf a lot. Here is a sample output for ps rf: PID TTY STAT TIME COMMAND 3476 pts/0 S 0:00 su ... 3477 pts/0 S 0:02 \_ bash 8062 pts/0 T 1:16 ...
shkschneider's user avatar
  • 17.8k
10 votes
6 answers
12k views

Generating a CSV list from Linux 'ps'

Suppose I have a ps command that looks like this: ps -Ao args:80,time,user --sort time It will give me a "space" separated set of rows. A row might look like this paulnath -bash 00:00:00 I would ...
Paul Nathan's user avatar
  • 39.6k
10 votes
1 answer
19k views

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. ...
Sheldon Ross's user avatar
  • 5,384
7 votes
5 answers
9k views

What are PostScript dictionaries, and how can they be accessed (via Ghostscript)?

I usually look at ghostscript as a command line tool; however, I never cease to be amazed at the sheer amount of settings and options present there - which is due to the fact that ghostscript is a ...
sdaau's user avatar
  • 37.1k
6 votes
3 answers
3k views

How include img in postscript

I want to add image to my postscript code %!PS-Adobe-3.0 /Times-Roman findfont 12 scalefont setfont 50 700 moveto (text) show showpage but i dont have idea to do that. Someone help?
badzz124's user avatar
3 votes
3 answers
6k views

How can I make a program overlay text on a postscript file?

I have some graphs in postscript format, generated by gnuplot. I need to place some identifying information on the graph. How can I script some instructions to do that? I want to write a number at the ...
rup's user avatar
  • 961
0 votes
3 answers
614 views

How to modify this plaintext-to-PDF-converting PostScript from 1992 to actually specify a page size?

I'm trying to convert a plaintext document to PDF. The only method which has come anywhere close to actually working is installing "GhostScript" and then using the following PostScript script, dug up ...
user avatar
95 votes
12 answers
233k views

How to check if ZooKeeper is running or up from command prompt?

I exploring a few options to setup kafka and I knew that the Zookeeper has to be up and running to initiate a kafka. I would like to know how can I find the below. 1) hostname and port for my ...
Suren Baskaran's user avatar
18 votes
9 answers
6k views

How can I merge PDF files (or PS if not possible) such that every file will begin in a odd page?

I am working on a UNIX system and I'd like to merge thousands of PDF files into one file in order to print it. I don't know how many pages they are in advance. I'd like to print it double sided, such ...
RanZilber's user avatar
  • 1,850
13 votes
4 answers
6k views

How to determine string height in PostScript?

I need to determine the height of a string (in given scale and font) in postscript. /Helvetic-Oblique findfont 10 scalefont setfont 10 10 1 0 360 arc fill 10 10 moveto (test) dup stringwidth pop 2 ...
willem's user avatar
  • 2,617
9 votes
3 answers
13k views

Intercepting data sent to a Windows printer (using RedMon)

I need to intercept data being sent to a ESC/POS printer on Windows and analyze it. So I wanted to get the data in plain text, so that I can extract and make sense of information being sent to the ...
mabicha's user avatar
  • 337
7 votes
3 answers
6k views

Overlay two postscript files (command line approach)?

I'm aware that similar questions have been answered here before: postscript - overlay one pdf or ps file on top of another - Stack Overflow overlay - Overlaying or merging multiple .ps files - Stack ...
sdaau's user avatar
  • 37.1k
7 votes
3 answers
8k views

How can I add a footer to the bottom of each page of a postscript or pdf file in linux?

So I'd like to add a "footer" (an attribution) to the bottom of every page of a pdf file I am generating via postscript with groff in linux. I am converting the file from ps to pdf myself, with the ...
cwd's user avatar
  • 53.1k
6 votes
3 answers
4k views

Postscript: concatenate two strings?

How do I concatenate two strings in Postscript? (foo) (bar) ??? -> (foobar)
Mark Harrison's user avatar
3 votes
1 answer
720 views

Conversion from ttf to type 2 CID font (type 42 base font)

I have ttf font files for Indian languages such as Tamil, Telugu, Malayalam, etc. In order to access ttf files through a postscript program, I have to convert them to Type 2 CIDfont (Type 42 base font)...
Marmayogi's user avatar
  • 153
3 votes
3 answers
3k views

Send Postscript Document to Printer using VC++

I have a postscript file. How can I send it to a printer using Visual C++? This seems like it should be simple.
chowey's user avatar
  • 9,188
3 votes
1 answer
5k views

grepping output of ps, exclude the word grep [duplicate]

I'm using ps to find the pid of a process created to execute the command "sleep 1234 &" I grep the result to match only "sleep 1234". ps -A -f | grep "sleep 1234" however, this matches also the ...
Yakov Dan's user avatar
  • 2,367
2 votes
4 answers
4k views

Check number of running scripts using ps

I'm writing a script (show_volume.sh) which may be called several times in short intervals. I need a way to determine whether there is more than just one running instance of this script. I figured I ...
helios35's user avatar
  • 1,577
2 votes
2 answers
1k views

PDF crop even-odd pages with PHP + GhostScript

I am working in a routine for crop PDF's and import them into a PDF template. I am using GhostScript, invoked with exec() from a PHP script, and FPDI. All running server-side. So far, I am able to ...
Laura's user avatar
  • 193
1 vote
2 answers
575 views

Create a tiff with only text and no images from a postscript file with ghostscript

Is it possible to create a tiff file from a postscript-file (created from a pdf-document with readable text and images) into a tiff file without the images and only the text? Like add a maxbuffer so ...
Joe's user avatar
  • 2,675
52 votes
2 answers
80k views

How to make adb shell ps list all processes in Android O?

adb shell ps not working in O android release adb shell ps command in Android O release is listing only ps process information, but it is not listing all the processes information of all the process ...
be_good_do_good's user avatar
36 votes
7 answers
41k views

Convert: Postscript delegate failed

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/...
Charlie Kee's user avatar
  • 1,161
27 votes
2 answers
62k views

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

Given a PDF document, how do I change individual page orientation? I'm using latest version of Ghostscript.
StackOverflowNewbie's user avatar
26 votes
5 answers
107k views

Find the pid of a java process under Linux

I have a Java program running on a Linux computer, and want to find the process ID (pid) of its process. I know the ps command can provide this information, but its output is confusing because it has ...
Shweta B. Patil's user avatar
15 votes
2 answers
2k views

How do you keep the `roll` operator straight?

In postscript, the roll operator is very general and difficult to visualize. How do you make sure you're rolling in the right direction? I want to get a solid handle on roll because I want to be able ...
luser droog's user avatar
13 votes
2 answers
21k views

ps aux | grep returns pid for itself too

I am using this command to get the process ID of another command: ps aux | grep 7000.conf | awk '{print $2}' This will return two PIDs: 7731 22125 I only want the first one. The second is the PID ...
BryanK's user avatar
  • 1,211
11 votes
4 answers
41k views

ps utility in linux (procps), how to check which CPU is used

It is about procps package, utility ps for linux. Can it print the number of last used CPU for each process (thread)? Update: Not a CPU Time (10 seconds), but a CPU NUMBER (CPU0,CPU5,CPU123)
osgx's user avatar
  • 90.5k
11 votes
4 answers
45k views

Find the Process run by nohup command

I run a server executable in Centos using the following command "nohup server &". Now I need to kill the process "server". But I tried "ps -a" command to get the PID but I couldnt get the process. ...
2vision2's user avatar
  • 4,943
11 votes
3 answers
3k views

How can you get the height metric of a string in PostScript?

You can obtain the width of a string in the current font with stringwidth and although this actually pushes offset coordinates on the stack, the y-value always seems to be useless. Is there a way to ...
dreamlax's user avatar
  • 94k
10 votes
4 answers
14k views

Java printing directly to a Postscript network printer

I've got Postscript code/data (?) in memory (in a Java Tomcat webapp) that I'd like to send directly to a networked PS printer. Is there an easy way (i.e. just popping open a port and sending the ...
David Jaquay's user avatar
  • 1,032
10 votes
7 answers
10k views

return code of system()

#include <stdlib.h> #include <string.h> #include <stdio.h> int main() { int res = system("ps ax -o pid -o command | grep sudoku | grep gnome > /dev/null"); printf("res = %d \n",...
hari's user avatar
  • 9,439
9 votes
2 answers
900 views

Setting argv[0] in Haskell?

Is there a way to set argv[0] in a Haskell program (say, one compiled with ghc)? I found the getProgName and withProgName functions in System.Environment, but it doesn't seem to change what ps ...
ErikR's user avatar
  • 51.6k