matlab - Ghostscript postscript pswrite is encoding text -
matlab - Ghostscript postscript pswrite is encoding text -
why ghostscript pswrite encoding text in output? consider next mwe:
%!ps-adobe-3.0 %%title: mwe.ps %%pages: 001 %%boundingbox: 0 0 595 842 %%endcomments %%page: 1 1 %%pageboundingbox: 0 0 595 842 0 0 1 setrgbcolor 0 0 595 842 rectfill 1 0 0 setrgbcolor 247 371 100 100 rectfill /times-roman findfont 72 scalefont setfont newpath 247 300 moveto (chris) show showpage
saving mwe file , viewing in gsview display bluish page reddish square , name underneath. run file through ghostscript 9.06 next command line:
"c:\program files\gs\gs9.06\bin\gswin64c.exe" ^ -dsafer -dbatch -dnopause ^ -sdevice=pswrite -spapersize=a4 -r72 -soutputfile=mwe_gs.ps mwe.ps
see ghostscript output below. can please explain happening here. whilst 2 rectfill commands still apparent, text (chris) has been encoded , no longer distinguishable.
is there alternative postscript device retain text please?
<snip> %%page: 1 1 %%pageboundingbox: 0 0 595 842 %%beginpagesetup gs_pswrite_2_0_1001 begin 595 842 /a4 setpagesize /pagesave save store 197 dict begin 1 1 scale %%endpagesetup gsave mark 255 0 r6 0 0 595 842 rf 255 0 r3 247 371 100 100 rf q q 0 0 595 0 0 842 ^ y 255 0 r3 249 299 43 50 /5d $c ,6cw56m1g"zornkwr*rb:!c2;9rlwth="2^^[(q"h>cg<omz2l^=qc[xbo:8_[?kji-8^"n#3q* jhl~> , 289 300 41 49 /0p $c 4r?0p$m<ekk3,0>s8w-!s8w-!s8w,u]<1iri=*p=<t0>_@<)>is8k6,ati'$~> , 325 300 30 33 /5i $c 49s"pc4+rhs8w-!s8w)oqdd:sarzq[4+k%):]~> , 349 300 24 49 /0t $c 4q%ms%;pqcs8w-!s8w%1_qkn/k?*syfsgd:5q~> , 377 299 23 34 /5m $c -tqr7$&o'!k+d:xribr9;$mr4#squi.t@,dx=y&llg+f`d^hc#%$"]~> , cleartomark end end pagesave restore showpage %%pagetrailer %%trailer %%pages: 1 %%eof
note: might seem odd activity i'm exploring thought of using ghostscript 'clean up' postscript output matlab application..
the 'text' has been converted images, not vector paths. serious limitation of pswrite device, , 1 of reasons deprecated, should utilize ps2write device instead. reason pswrite device still included @ epswrite uses (which why pswrite , epswrite output looks same). @ point there eps2write device , pswrite binned.
ps2write output is, default, compressed. if want uncompressed output, utilize -dcompresspages=false switch on command line.
if want location of text might consider txtwrite device. default implementation of creates plain text representation of input, can have output faked xml instead includes things origin of text.
matlab ghostscript postscript
Comments
Post a Comment