0

What I am trying to do is combine two postscript files into a pdf. I have already tried using ghostscript to combine them however the issue with that is ghostscript produces a pdf with one ps file on one page and the other on page two which is not what i wish to accomplish

    %!PS-Adobe-3.0
%%Pages: 1
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
%%Page: 1 1
save
6 dict begin currentpagedevice/PageSize get dup 0 get
 0 sub 0 sub/w exch
 def 1 get 0 sub 0 sub/h exch
 def/x 87 def/y 87 def 0 0/b y h mul x
 w mul gt def b{w y}{h x}ifelse div/c x h mul y w mul gt def c{w x}{h y}ifelse
 div gt{h add translate -90 rotate b{w y h x w mul y div sub 2 div 0}{h
 x 0 w y h mul x div sub 2 div}}{translate c{w x 0 h y w mul x div sub 2 div}{h
 y w x h mul y div sub 2 div 0}}ifelse ifelse translate div dup scale
end 9 dict begin
{/T currentfile/ASCII85Decode filter def/DeviceGray setcolorspace
/F T/LZWDecode filter def
<</ImageType 1/Width 87/Height 87/BitsPerComponent
1/ImageMatrix[1 0 0 -1 0 87]/Decode
[0 1]/DataSource F>> image
 F closefile T closefile}
%%BeginData:;
exec
J3Vsg3$\8+#CjR`&3*WA'+TR\@<!\`;@aOp`$+XV`%h8\!!!K[!9Aet#*;BOP%d==7jS.,hsVBYnDH
N[+5cZ=UtTfLSkWhgRG8\?,WGcN^j5#cP]3KsWRSLmE;_bp<GM2!Q!1FiRE6!+E91]DA$X`8iQFZYB
0mS8-o5Xu!f_0094V'pA:@g3R,3i_$'Yp\)8e-_&1fqhs%"+h!UL4I6R@tNA[6Bt^^UAX[:aRMSIU!
416=^MmJq2-+0!fVFnDer\kkA9UY#Q*n/l#Ih/>7,IEq;.)e7/q%Q&SL"j'""q7'ad9:Z00;\?qF/.
8a*mIt,hY3"qji0!BA*e-tRs6.F-k:_SnL*&QCrBB*lce!!;K8Fj4Hp6d?"Tg3Y4:8BLi#B-/VXSPS
#XP\B&qLYW4;Koo&C`>f_omCk&%aL+C?WTr*(:Q0YB"7Y0@*i?(aUW\?B(Z"l6;3X;8O\%8-n:/*6;
f^!W~>
%%EndData
end restore showpage
%%Trailer
%%EOF

Here is the second file

The file is to big here is a link to it http://pastebin.com/R0Kgarem

Not sure how I would go about solving this problem. I need the 2 ps files under each other without any white space.

SuNnY_sYeD
  • 513
  • 1
  • 6
  • 19
  • What do you mean by "under each other without any white space"? Like if you print twice on the same paper so that both images overly, or like when you put one at the top of the page and one at the bottom? Your question might be a duplicate of this one: http://stackoverflow.com/questions/9820646/overlay-two-postscript-files-command-line-approach – Thomas W Dec 20 '12 at 06:27
  • Goddam that's a lot of setup for ... a receipt ... for a big mac? And you want to superimpose a bitmap? Or does the receipt go on top of the bitmap? "under each other" isn't clear enough. – luser droog Dec 20 '12 at 06:31
  • what I want to do is place a bitmap at the bottom of the receipt without having any whitespace between them and without it being being on the next page. I think i might have figured out the problem which is that the receipt ps file has the white space at the bottom of it because when I use ghostscript to find the bbox it is much smaller then the one specified in the ps file for the receipt. How can I use the bbox to determine the crop area for the receipt ps file. I need this to be done during run time because the height of the receipt could potentially change. Any idea? – SuNnY_sYeD Dec 20 '12 at 17:07

1 Answers1

1

Assuming you mean one toward the top of the page and the other toward the bottom of the page (a 2-up), you just need to prevent the first file from executing showpage (by redefining, or editing to remove the word showpage), and then translate (0 -y translate, where y is the height of the first image) before executing the second file. This assumes the first image is already positioned at the top of the page, otherwise you need to translate it to the correct position first.

luser droog
  • 18,988
  • 3
  • 53
  • 105
  • I tried this and couldn't get it to work. I want one at the top, which it already is, and one right under it so the receipt on top and qrcode right underneath it. – SuNnY_sYeD Dec 20 '12 at 17:12