Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1307

Re: How to execute some part of a postscript procedure instantly

Newsgroups comp.lang.postscript
Date 2013-03-11 00:27 -0700
References <cd5e1ff4-5201-4c45-b8ed-b69837503eb3@googlegroups.com> <8ea637ed-9b26-42d8-9fa6-356d198a8568@googlegroups.com> <ad58e952-cd79-49dd-b103-82835b237a22@googlegroups.com> <9eaac949-e48e-4c76-b827-d29f96654df0@googlegroups.com> <0e239ba3-2da4-4474-b412-37cf7c5cfd1b@googlegroups.com>
Message-ID <e90564be-8a9c-4b02-8502-4792fee9466c@googlegroups.com> (permalink)
Subject Re: How to execute some part of a postscript procedure instantly
From Olle <olavi.sakari@gmail.com>

Show all headers | View raw


This was the solution I suggested:

%!PS-Adobe-3.0
%APL_DSC_Encoding: UTF8
%%Setting current point
0 0 moveto
gsave
gsave
newpath
0 124.48 moveto
360 124.48 lineto
360 0 lineto
0 0 lineto
closepath
clip

/iWidth 1013 def
/iHeight 675 def
/imageSourceIndex 0 def

/CreateDataArray
{
	% CMYK => 4 mul
	iHeight 4 mul {
		currentfile iWidth string readhexstring pop
	} repeat
} bind def

/imageDataArray
[
	CreateDataArray
0419F8FF0419F9FF0419F6FF0318EFFF0416... [lots of hexadecimal data]
... 951FEFF1D55FEFF1C51FEFF194BFEFF
] def

/ReadImageData
{
	imageDataArray imageSourceIndex get
	/imageSourceIndex imageSourceIndex 1 add iHeight 4 mul mod def
} bind def

<<
/PatternType 1
/PaintType 1 
/TilingType 2 
/BBox[ 0 0 29.13 19.41 ]
/XStep 29.13 
/YStep 19.41 
/PaintProc
{
%%Setting current point
0 0 moveto
gsave
[29.13 0 0 19.41 0 -0 ] concat
matrix currentmatrix

1 1 scale
/DeviceCMYK setcolorspace
<<
/ImageType 1
/Width iWidth
/Height iHeight
/BitsPerComponent 8
/Decode [1 0 1 0 1 0 1 0]
/ImageMatrix [iWidth 0 0 iHeight 0 0]
/DataSource //ReadImageData
>>
image

setmatrix
grestore
} bind 
>>
/GuidCDBF99D100DE4855B5D98E5F1642FC62 exch def
newpath
345.24 14.48 moveto
15.45 14.48 lineto
15.45 107.95 lineto
345.24 107.95 lineto
closepath
gsave currentdict dup
/GuidCDBF99D100DE4855B5D98E5F1642FC62 known { /GuidCDBF99D100DE4855B5D98E5F1642FC62 get [1 0 0 1 0 124.48 ]
makepattern /Pattern setcolorspace setcolor 15.449005 14.482000 329.795990 93.469002 rectfill } { error } ifelse
 grestore
newpath
grestore

/DeviceCMYK setcolorspace
1 0 0 1 setcolor
newpath
345.24 14.48 moveto
15.45 14.48 lineto
15.45 107.95 lineto
345.24 107.95 lineto
closepath
gsave stroke grestore
newpath
grestore
%%EOF


On Monday, March 11, 2013 9:12:08 AM UTC+2, Olle wrote:
> Md,
> 
> 
> 
> I told you last Thursday that "First, I _think_ you cannot have currentfile data here when it's part of a procedure.", and I still think you should use the other solution I presented, reading the currentfile data separately into a bunch of strings.
> 
> 
> 
> Thanks,
> 
> 
> 
> Olle
> 
> 
> 
> On Monday, March 11, 2013 7:39:17 AM UTC+2, luser- -droog wrote:
> 
> > On Sunday, March 10, 2013 10:56:10 PM UTC-5, alamr...@gmail.com wrote:
> 
> > 
> 
> > > 
> 
> > 
> 
> > > Hi luser,
> 
> > 
> 
> > > 
> 
> > 
> 
> > > You did not explain the reason for the limitcheck error. Is it related to the truncation of the lines to 80 characteres?
> 
> > 
> 
> > > 
> 
> > 
> 
> > 
> 
> > 
> 
> > I truncated the line just to remove the bulk so it would fit in a message here. I picked 80 chars because that's a typical line-width limit for usenet. For interchange with older software, 80 chars is a reasonable line-width limit to choose. I suppose fewer and fewer new programs will have difficulty with long lines, but you never know, you know?
> 
> > 
> 
> > 
> 
> > 
> 
> > I had just opened up the file before I had to leave for work, so I posted it in case somebody else could help you faster. :)

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to execute some part of a postscript procedure instantly alamraquib@gmail.com - 2013-03-09 11:43 -0800
  Re: How to execute some part of a postscript procedure instantly luser- -droog <mijoryx@yahoo.com> - 2013-03-09 18:17 -0800
    Re: How to execute some part of a postscript procedure instantly alamraquib@gmail.com - 2013-03-09 21:54 -0800
      Re: How to execute some part of a postscript procedure instantly luser- -droog <mijoryx@yahoo.com> - 2013-03-09 22:27 -0800
        Re: How to execute some part of a postscript procedure instantly alamraquib@gmail.com - 2013-03-10 10:05 -0700
  Re: How to execute some part of a postscript procedure instantly luser- -droog <mijoryx@yahoo.com> - 2013-03-10 13:59 -0700
    Re: How to execute some part of a postscript procedure instantly alamraquib@gmail.com - 2013-03-10 20:56 -0700
      Re: How to execute some part of a postscript procedure instantly luser- -droog <mijoryx@yahoo.com> - 2013-03-10 21:47 -0700
      Re: How to execute some part of a postscript procedure instantly luser- -droog <mijoryx@yahoo.com> - 2013-03-10 22:39 -0700
        Re: How to execute some part of a postscript procedure instantly Olle <olavi.sakari@gmail.com> - 2013-03-11 00:12 -0700
          Re: How to execute some part of a postscript procedure instantly Olle <olavi.sakari@gmail.com> - 2013-03-11 00:27 -0700
            Re: How to execute some part of a postscript procedure instantly luser- -droog <mijoryx@yahoo.com> - 2013-03-17 01:56 -0700

csiph-web