Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #3192 > unrolled thread
| Started by | jdaw1 <jdawiseman@gmail.com> |
|---|---|
| First post | 2017-11-15 15:04 -0800 |
| Last post | 2017-11-17 00:35 -0800 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.lang.postscript
Page number of page currently being painted jdaw1 <jdawiseman@gmail.com> - 2017-11-15 15:04 -0800
Re: Page number of page currently being painted luser droog <luser.droog@gmail.com> - 2017-11-15 19:08 -0800
Re: Page number of page currently being painted ken <ken@spamcop.net> - 2017-11-16 07:55 +0000
Re: Page number of page currently being painted jdaw1 <jdawiseman@gmail.com> - 2017-11-16 15:56 -0800
Re: Page number of page currently being painted jdaw1 <jdawiseman@gmail.com> - 2017-11-17 00:35 -0800
| From | jdaw1 <jdawiseman@gmail.com> |
|---|---|
| Date | 2017-11-15 15:04 -0800 |
| Subject | Page number of page currently being painted |
| Message-ID | <b3557aa7-a1ff-4e62-9f04-e283c1d66389@googlegroups.com> |
Word produces RGB colours, even though CMYK can be wanted. So a pre-amble has been written that takes a look-up table, RGB➝CMYK, and changes the meaning of setrgbcolor to do the obvious. This was ‘discussed’ in http://groups.google.com/forum/#!topic/comp.lang.postscript/6JW6VamdVlw The pre-amble’s new setrgbcolor reports when an unlisted RGB has been requested. As the file is 641 pages, it would much help to show the page number. ¿Is there any accessible parameter that reveals the page number of the page currently being painted? Ideally it would work in both Distiller and Ghostscript, but beggars, choosers, etc. Thank you.
[toc] | [next] | [standalone]
| From | luser droog <luser.droog@gmail.com> |
|---|---|
| Date | 2017-11-15 19:08 -0800 |
| Message-ID | <80f0efdb-4bec-4d97-a0e2-b684ff87060a@googlegroups.com> |
| In reply to | #3192 |
On Wednesday, November 15, 2017 at 5:04:48 PM UTC-6, jdaw1 wrote: > Word produces RGB colours, even though CMYK can be wanted. So a pre-amble has been written that takes a look-up table, RGB➝CMYK, and changes the meaning of setrgbcolor to do the obvious. This was ‘discussed’ in http://groups.google.com/forum/#!topic/comp.lang.postscript/6JW6VamdVlw > > The pre-amble’s new setrgbcolor reports when an unlisted RGB has been requested. As the file is 641 pages, it would much help to show the page number. ¿Is there any accessible parameter that reveals the page number of the page currently being painted? > > Ideally it would work in both Distiller and Ghostscript, but beggars, choosers, etc. > > Thank you. Probably the most portable way is to use the BeginPage or EndPage hooks with setpagedevice. You can increment a counter variable and then access the variable in the report function. Another possibly useful datum is the value of `currentfile fileposition`. fileposition should work fine with disk files in both interpreters but possibly not with pipes or network streams. It conceivably could signal an ioerror.
[toc] | [prev] | [next] | [standalone]
| From | ken <ken@spamcop.net> |
|---|---|
| Date | 2017-11-16 07:55 +0000 |
| Message-ID | <MPG.347754df9f0208ac98991f@usenet.plus.net> |
| In reply to | #3193 |
In article <80f0efdb-4bec-4d97-a0e2-b684ff87060a@googlegroups.com>, luser.droog@gmail.com says... > > On Wednesday, November 15, 2017 at 5:04:48 PM UTC-6, jdaw1 wrote: > > Word produces RGB colours, even though CMYK can be wanted. So a pre-amble has been written that takes a look-up table, RGB?CMYK, and changes the meaning of setrgbcolor to do the obvious. This was ?discussed? in http://groups.google.com/forum/#!topic/comp.lang.postscript/6JW6VamdVlw > > > > The pre-amble?s new setrgbcolor reports when an unlisted RGB has been requested. As the file is 641 pages, it would much help to show the page number. ¿Is there any accessible parameter that reveals the page number of the page currently being painted? > > > > Ideally it would work in both Distiller and Ghostscript, but beggars, choosers, etc. > > > > Thank you. > > Probably the most portable way is to use the BeginPage or EndPage > hooks with setpagedevice. You can increment a counter variable > and then access the variable in the report function. EndPage is called with a count of pages so far, so you could use that. Except note that this is defeated if you execute setpagedevice which resets the count. Most PostScript produced from Windows includes setpagedevice on every page. Ken
[toc] | [prev] | [next] | [standalone]
| From | jdaw1 <jdawiseman@gmail.com> |
|---|---|
| Date | 2017-11-16 15:56 -0800 |
| Message-ID | <f274f060-f0d7-4a90-b8db-e202db674600@googlegroups.com> |
| In reply to | #3194 |
Thank you. To hide my variable, at least slightly, it has been embedded it in a dictionary in the code. /setpagedevice [ << /setpagedeviceCount 0 >> /begin cvx /setpagedeviceCount dup cvx 1 /add cvx /store cvx /end cvx /setpagedevice cvx ] cvx bind def Accessed within similarly-constructed semi-immediately-evaluated code: [ … /setpagedevice load 0 get /setpagedeviceCount /get cvx … ] cvx bind File updated: http://www.jdawiseman.com/2017/20171113_TrueBlack.ps
[toc] | [prev] | [next] | [standalone]
| From | jdaw1 <jdawiseman@gmail.com> |
|---|---|
| Date | 2017-11-17 00:35 -0800 |
| Message-ID | <3a62b514-a41b-47f5-98d0-430f81122e8a@googlegroups.com> |
| In reply to | #3195 |
It seems that Microsoft calls setpagedevice less often than suggested. It might well be called on new sections — which would match observed behaviours and be logical. I’ll test showpage (which, upon reflection, seems more logical).
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.postscript
csiph-web