Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #1620
| From | Helge Blischke <h.blischke@acm.org> |
|---|---|
| Newsgroups | comp.lang.postscript |
| Subject | Re: Unbalanced [ |
| Followup-To | comp.lang.postscript |
| Date | 2013-09-12 11:31 +0200 |
| Message-ID | <b9dfv4Fith5U1@mid.individual.net> (permalink) |
| References | <86272e7d-88ce-4adb-ba92-3424ec5e89ca@googlegroups.com> <d131f9d1-0bd3-4bfe-98fd-6a3ab6cc7ff7@googlegroups.com> |
Followups directed to: comp.lang.postscript
luser- -droog wrote:
> On Wednesday, September 11, 2013 11:16:13 AM UTC-5, ana...@gmail.com
> wrote:
>> Hi everyone,
>>
>> I am writing a PostScript interpreter for a product I sell, and while
>> working with some sample .EPS files, I ran into the following:
>>
>> /xpdfm
>> {
>> {
>> dup 0 get/Label eq
>> {
>> aload length[exch 1 add 1 roll/PAGELABEL
>> }{
>> aload pop
>> [{ThisPage}<<5 -2 roll>>/PUT
>> }ifelse
>> pdfmark_5
>> }forall
>>
>>
>> This code snippet contains two unbalanced opening square brackets ([).
>>
>> Is this normal? How should this be treated by a PostScript interpreter?
>>
>> Thanks in advance.
>>
>
> As others have said, the left bracket [ is defined in systemdict as a
> marktype object (same as the name /mark). Since only one of the procedure-
> bodies passed to ifelse will be executed, there is really only one mark
> without a matching right bracket ]. This style is used in much the same
> way as a vararg function in C, to pass an open-ended set of values,
> presumably to pdfmark_5. I'm not familiar with the '_5' part, but pdfmark
> is used to pass data into a generated pdf file.
>
> If your output device is not a pdf-writer, you can probably safely
> define
>
> /pdfmark { cleartomark } def
>
> By the way, the << is also a mark, so you will sometimes see [ used
> instead.
>
> [ /this (is) /a (dictionary) >>
The ample snippet is from the prolog section Acrobat
(Adobe Reader as well) generates when printing to PostScript printers,
and /pdfmark_5 is there defined like:
/currentdistillerparams where{pop currentdistillerparams/CoreDistVersion get 5000 lt}{true}ifelse
{
/pdfmark_5{cleartomark}bind def
}{
/pdfmark_5{pdfmark}bind def
}ifelse
Helge
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Unbalanced [ anavi8r@gmail.com - 2013-09-11 09:16 -0700
Re: Unbalanced [ Mark Carroll <mtbc@bcs.org> - 2013-09-11 17:28 +0100
Re: Unbalanced [ Helge Blischke <h.blischke@acm.org> - 2013-09-11 18:34 +0200
Re: Unbalanced [ luser- -droog <mijoryx@yahoo.com> - 2013-09-11 12:16 -0700
Re: Unbalanced [ Helge Blischke <h.blischke@acm.org> - 2013-09-12 11:31 +0200
Re: Unbalanced [ anavi8r@gmail.com - 2013-09-18 10:11 -0700
csiph-web