Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #2711 > unrolled thread
| Started by | vincent.torri@gmail.com |
|---|---|
| First post | 2016-07-30 08:54 -0700 |
| Last post | 2016-08-04 10:17 -0700 |
| Articles | 11 — 4 participants |
Back to article view | Back to comp.lang.postscript
Postscript level 1 and DSC vincent.torri@gmail.com - 2016-07-30 08:54 -0700
Re: Postscript level 1 and DSC Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-07-30 10:31 -0600
Re: Postscript level 1 and DSC vincent.torri@gmail.com - 2016-07-30 10:00 -0700
Re: Postscript level 1 and DSC luser droog <luser.droog@gmail.com> - 2016-07-30 16:06 -0700
Re: Postscript level 1 and DSC luser droog <luser.droog@gmail.com> - 2016-07-31 22:53 -0700
Re: Postscript level 1 and DSC rodd@panix.com (Rod Dorman) - 2016-08-01 19:56 +0000
Re: Postscript level 1 and DSC luser droog <luser.droog@gmail.com> - 2016-08-01 13:34 -0700
Re: Postscript level 1 and DSC Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-08-03 10:43 -0600
Re: Postscript level 1 and DSC vincent.torri@gmail.com - 2016-08-04 03:30 -0700
Re: Postscript level 1 and DSC Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-08-04 09:43 -0600
Re: Postscript level 1 and DSC vincent.torri@gmail.com - 2016-08-04 10:17 -0700
| From | vincent.torri@gmail.com |
|---|---|
| Date | 2016-07-30 08:54 -0700 |
| Subject | Postscript level 1 and DSC |
| Message-ID | <ab6aac65-7246-4a79-9fd9-2048041cd7eb@googlegroups.com> |
Hello I am parsing Postscript file to validate it. I first start with level 1. The specifications say that it is possible to have minimal conforming, that is : - some DSC comments are requested - the version identifier begins with the string '%!PS-Adobe-' So it says only *begins with* this string, and not *is exactly* this string. My question is: is minimal conforming specified inside the postscript file in some way, or else should my parser be configured by the user to respect minimal conformance ? thank you Vincent Torri
[toc] | [next] | [standalone]
| From | Martin Leese <please@see.Web.for.e-mail.INVALID> |
|---|---|
| Date | 2016-07-30 10:31 -0600 |
| Message-ID | <nnikov$877$1@dont-email.me> |
| In reply to | #2711 |
vincent.torri@gmail.com wrote:
> Hello
>
> I am parsing Postscript file to validate it. I first start with level 1. The specifications say that it is possible to have minimal conforming, that is :
>
> - some DSC comments are requested
> - the version identifier begins with the string '%!PS-Adobe-'
What specifications say this? I cannot find
it in the PostScript Language Reference
Manual (Third Edition), so assume this is in
the DSC specification. The Language Manual
does say:
"There is no requirement that a regular
page description conform to DSC, but it
is strongly recommended."
So, a PostScript document can be valid
PostScript yet totally ignore DSC.
> So it says only *begins with* this string, and not *is exactly* this string.
Right. I just looked at a few PostScript
files. They began with:
%!PS-Adobe-2.0
%!PS-Adobe-3.0 Query
%!PS-Adobe-3.0 Resource-FontSet
> My question is: is minimal conforming specified inside the postscript file in some way, or else should my parser be configured by the user to respect minimal conformance ?
I do not understood your question. Perhaps
you could explain what exactly you wish to
do (and why)? Do you wish to validate that
the PostScript file is valid PostScript, or
that it conforms to the DSC specification?
--
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/
[toc] | [prev] | [next] | [standalone]
| From | vincent.torri@gmail.com |
|---|---|
| Date | 2016-07-30 10:00 -0700 |
| Message-ID | <6d82f920-c119-401f-b8b0-6dc250c42848@googlegroups.com> |
| In reply to | #2712 |
sâmbătă, 30 iulie 2016, 19:31:29 UTC+3, Martin Leese a scris: > vincent.torri@gmail.com wrote: > > Hello > > > > I am parsing Postscript file to validate it. I first start with level 1. The specifications say that it is possible to have minimal conforming, that is : > > > > - some DSC comments are requested > > - the version identifier begins with the string '%!PS-Adobe-' > > What specifications say this? as I say, the 1.0 specification. I have a copy of the 1.0 manual with these specifications > I cannot find > it in the PostScript Language Reference > Manual (Third Edition), so assume this is in > the DSC specification. it is normal : since the 2.0 specifications, minimal conformance is dropped see : http://www-cdf.fnal.gov/offline/PostScript/psstruct.ps section 4.3 or see : https://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf section A.1.1 page 95 i do not know if i am allowed to share the 1.0 specifications, as it is a scan of a book. Vincent Torri > The Language Manual > does say: > "There is no requirement that a regular > page description conform to DSC, but it > is strongly recommended." > > So, a PostScript document can be valid > PostScript yet totally ignore DSC. > > > So it says only *begins with* this string, and not *is exactly* this string. > > Right. I just looked at a few PostScript > files. They began with: > %!PS-Adobe-2.0 > %!PS-Adobe-3.0 Query > %!PS-Adobe-3.0 Resource-FontSet > > > My question is: is minimal conforming specified inside the postscript file in some way, or else should my parser be configured by the user to respect minimal conformance ? > > I do not understood your question. Perhaps > you could explain what exactly you wish to > do (and why)? Do you wish to validate that > the PostScript file is valid PostScript, or > that it conforms to the DSC specification? > > -- > Regards, > Martin Leese > E-mail: please@see.Web.for.e-mail.INVALID > Web: http://members.tripod.com/martin_leese/
[toc] | [prev] | [next] | [standalone]
| From | luser droog <luser.droog@gmail.com> |
|---|---|
| Date | 2016-07-30 16:06 -0700 |
| Message-ID | <9490de8e-6d60-4070-b305-5cbf3ba313db@googlegroups.com> |
| In reply to | #2711 |
On Saturday, July 30, 2016 at 10:54:15 AM UTC-5, vincen...@gmail.com wrote: > Hello > > I am parsing Postscript file to validate it. I first start with level 1. The specifications say that it is possible to have minimal conforming, that is : > > - some DSC comments are requested > - the version identifier begins with the string '%!PS-Adobe-' > > So it says only *begins with* this string, and not *is exactly* this string. > > My question is: is minimal conforming specified inside the postscript file in some way, or else should my parser be configured by the user to respect minimal conformance ? I'm starting to think that the answer may not be in the spec. I think "minimal conformance" might be a fuzzier concept, more of a program's strategy than a rigorous definition. If you want to validate a Dsc... ugh. I can't even finish the sentence, because it's not clear how the program should handle the postscript content. But, say it's been determined that the validator is only looking at the DSC comments. (I think this is the case, but I'm not sure if it was mentioned yet.) My only thought is to start at the other end. Use cases. $ dsc_valid 1.0 doc.ps $ #no news is good news? $ dsc_valid 1.0 doc2.ps doc2.ps: minimally conforming to DSC 1.0 doc2.ps: missing BBox comment doc2.ps: BBox specified as (atend) was NOT at the end $ dsc_valid 2.0 doc3.ps doc3.ps: does not conform to DSC 2.0 doc3.ps: missing such-and-such doc3.ps: malformed something-or-other One nicety I think every can agree on is a (default) option to complain about %%PageOrder: special.
[toc] | [prev] | [next] | [standalone]
| From | luser droog <luser.droog@gmail.com> |
|---|---|
| Date | 2016-07-31 22:53 -0700 |
| Message-ID | <b3d563f7-deaa-4624-8efb-d73e7f2e3043@googlegroups.com> |
| In reply to | #2714 |
On Saturday, July 30, 2016 at 6:06:52 PM UTC-5, luser droog wrote: > On Saturday, July 30, 2016 at 10:54:15 AM UTC-5, vincen...@gmail.com wrote: > > Hello > > > > I am parsing Postscript file to validate it. I first start with level 1. The specifications say that it is possible to have minimal conforming, that is : > > > > - some DSC comments are requested > > - the version identifier begins with the string '%!PS-Adobe-' > > > > So it says only *begins with* this string, and not *is exactly* this string. > > > > My question is: is minimal conforming specified inside the postscript file in some way, or else should my parser be configured by the user to respect minimal conformance ? > > I'm starting to think that the answer may not be in the spec. > I think "minimal conformance" might be a fuzzier concept, > more of a program's strategy than a rigorous definition. > > If you want to validate a Dsc... ugh. I can't even finish > the sentence, because it's not clear how the program should > handle the postscript content. But, say it's been determined > that the validator is only looking at the DSC comments. > (I think this is the case, but I'm not sure if it was > mentioned yet.) > > My only thought is to start at the other end. Use cases. > > $ dsc_valid 1.0 doc.ps > $ #no news is good news? > > $ dsc_valid 1.0 doc2.ps > doc2.ps: minimally conforming to DSC 1.0 > doc2.ps: missing BBox comment > doc2.ps: BBox specified as (atend) was NOT at the end > > $ dsc_valid 2.0 doc3.ps > doc3.ps: does not conform to DSC 2.0 > doc3.ps: missing such-and-such > doc3.ps: malformed something-or-other > > One nicety I think every can agree on is a (default) option > to complain about %%PageOrder: special. If we consider the validator program to have access to a postscript interpreter then we could get more interesting output, maybe. $ dsc_valid -v -ps -Wpage-order-special doc4.ps doc4.ps: Document declared to be DSC-2.0 doc4.ps: warning: missing this or that required by DSC-2.0 doc4.ps: executed Prologue: no errors, stack clean. doc4.ps: executed Page 1: no errors. doc4.ps: warning: blank page. doc4.ps: executed Document successfully. doc4.ps: warning: Document produced only 1 blank page. doc4.ps: warning: Document does not conform to advertised DSC version.
[toc] | [prev] | [next] | [standalone]
| From | rodd@panix.com (Rod Dorman) |
|---|---|
| Date | 2016-08-01 19:56 +0000 |
| Message-ID | <nno9h1$9s8$1@reader2.panix.com> |
| In reply to | #2711 |
In article <ab6aac65-7246-4a79-9fd9-2048041cd7eb@googlegroups.com>, <vincent.torri@gmail.com> wrote: >I am parsing Postscript file to validate it. I first start with level 1. The >specifications say that it is possible to have minimal conforming, that is : > > - some DSC comments are requested > - the version identifier begins with the string '%!PS-Adobe-' > >So it says only *begins with* this string, and not *is exactly* this string. > >My question is: is minimal conforming specified inside the postscript file >in some way, or else should my parser be configured by the user to respect >minimal conformance ? Where in the original PLRM are you reading this? Is it in Appendix C Structuring Conventions? That's been split out into its own document now, PostScript Language. Document Structuring. Conventions Specification https://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf It describes DSC version 3.0 with a version identifier %!PS-Adobe-3.0 -- -- Rod -- rodd(at)polylogics(dot)com
[toc] | [prev] | [next] | [standalone]
| From | luser droog <luser.droog@gmail.com> |
|---|---|
| Date | 2016-08-01 13:34 -0700 |
| Message-ID | <0e929110-ff64-4766-a7f7-97f34dd9fa71@googlegroups.com> |
| In reply to | #2717 |
On Monday, August 1, 2016 at 2:56:18 PM UTC-5, Rod Dorman wrote: > In article <ab6aac65-7246-4a79-9fd9-2048041cd7eb@googlegroups.com>, > <vincent.torri@gmail.com> wrote: > >I am parsing Postscript file to validate it. I first start with level 1. The > >specifications say that it is possible to have minimal conforming, that is : > > > > - some DSC comments are requested > > - the version identifier begins with the string '%!PS-Adobe-' > > > >So it says only *begins with* this string, and not *is exactly* this string. > > > >My question is: is minimal conforming specified inside the postscript file > >in some way, or else should my parser be configured by the user to respect > >minimal conformance ? > > Where in the original PLRM are you reading this? Is it in Appendix C > Structuring Conventions? > > That's been split out into its own document now, > PostScript Language. Document Structuring. Conventions Specification > https://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf > > It describes DSC version 3.0 with a version identifier %!PS-Adobe-3.0 > This was my suggestion to Vincent in a private correspondence. Based on my experience implementing xpost and reading the various editions of the PLRM, I firmly believe that the most productive way to approach cloning these systems is to start with earliest full specification that can be found. For comprehensibility, the earlier documents are just so much shorter. The PLRM, 1ed, Appendix C, Structuring Conventions, is like 7 pages long. For implementation, that's a beautiful first milestone to get something that fully-compliant to *some* standard, even if not the most current one. And the change-set from one standard to the next version will often be a smaller set of concepts than the full set of the entirety of the new version.
[toc] | [prev] | [next] | [standalone]
| From | Martin Leese <please@see.Web.for.e-mail.INVALID> |
|---|---|
| Date | 2016-08-03 10:43 -0600 |
| Message-ID | <nnt6uu$aa8$1@dont-email.me> |
| In reply to | #2711 |
vincent.torri@gmail.com wrote:
> Hello
>
> I am parsing Postscript file to validate it. I first start with level 1. The specifications say that it is possible to have minimal conforming, that is :
>
> - some DSC comments are requested
> - the version identifier begins with the string '%!PS-Adobe-'
>
> So it says only *begins with* this string, and not *is exactly* this string.
>
> My question is: is minimal conforming specified inside the postscript file in some way, or else should my parser be configured by the user to respect minimal conformance ?
It is inside the PostScript file. (Many
thanks to the Magic PDF Fairy for dropping
a few pages into my inbox.)
You accuratly described minimally
conforming in your post. The PostScript
must begin with the comment "%!PS-Adobe-"
and must contain the DSC comments:
%%DocumentFonts: ...
%%EndProlog
%%Page: ...
%%Trailer
There are also a few rules the DSC comments
must adhere to to be well formed.
However, if you wish to validate that a file
is fully conforming to DSC Level 1 then I
can see difficulties. The standard states:
"Compliance with these conventions is not
an all-or-nothing proposition.
Applications that generate PostScript
page descriptions need not supply all of
the information described [in the
standard]."
Apart from the initial comment, which must
begin with:
%!PS-Adobe-1.0
everything else (apart from the stuff
required to be minimally conforming) is
optional. Also, to do the job properly, you
will need to analyse the actual PostScript
to check that every page begins with the
mandatory "%%Page:" comment.
--
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/
[toc] | [prev] | [next] | [standalone]
| From | vincent.torri@gmail.com |
|---|---|
| Date | 2016-08-04 03:30 -0700 |
| Message-ID | <8338c508-06eb-4e06-9e20-05f316f43831@googlegroups.com> |
| In reply to | #2730 |
Hello, Le mercredi 3 août 2016 18:43:13 UTC+2, Martin Leese a écrit : > vincent.torri@gmail.com wrote: > > Hello > > > > I am parsing Postscript file to validate it. I first start with level 1. The specifications say that it is possible to have minimal conforming, that is : > > > > - some DSC comments are requested > > - the version identifier begins with the string '%!PS-Adobe-' > > > > So it says only *begins with* this string, and not *is exactly* this string. > > > > My question is: is minimal conforming specified inside the postscript file in some way, or else should my parser be configured by the user to respect minimal conformance ? > > It is inside the PostScript file. (Many > thanks to the Magic PDF Fairy for dropping > a few pages into my inbox.) > > You accuratly described minimally > conforming in your post. The PostScript > must begin with the comment "%!PS-Adobe-" > and must contain the DSC comments: > %%DocumentFonts: ... > %%EndProlog > %%Page: ... > %%Trailer If it is inside the prostscript, then I don't understand the reason to have such minimal conformance. Indeed one can have: 1) both minimal and full conformance (your exemple above with the version comment) 2) just minimal and not full conformance (bad Bounding Box values for example) 3) full conformance and not minimal (no EndProlog for example and just a new line or a comment) 4) none of them (easy to have...) As we can have all the possibilities, i can not see how such minimal conformance is interesting, except if my library, via an API, sets that one want minimal conforming. In that case, that would eliminate points 3) and 4). > There are also a few rules the DSC comments > must adhere to to be well formed. > > However, if you wish to validate that a file > is fully conforming to DSC Level 1 then I > can see difficulties. The standard states: > "Compliance with these conventions is not > an all-or-nothing proposition. > Applications that generate PostScript > page descriptions need not supply all of > the information described [in the > standard]." Is it a bit like in the DSC level 2.* ? (section 4.3: "There are no longer any required comments. All the comments are 'optional' etc...") > Apart from the initial comment, which must > begin with: > %!PS-Adobe-1.0 > > everything else (apart from the stuff > required to be minimally conforming) is > optional. > Also, to do the job properly, you > will need to analyse the actual PostScript > to check that every page begins with the > mandatory "%%Page:" comment. Yes, also using xpost to check the validity of each page, like Josh mentioned in a previous post thank you Vincent Torri
[toc] | [prev] | [next] | [standalone]
| From | Martin Leese <please@see.Web.for.e-mail.INVALID> |
|---|---|
| Date | 2016-08-04 09:43 -0600 |
| Message-ID | <nnvnrm$rur$1@dont-email.me> |
| In reply to | #2732 |
vincent.torri@gmail.com wrote: > If it is inside the prostscript, then I don't understand the reason to have such minimal conformance. Adobe agreed with you, and dropped minimal conformance in later levels of DSC. > Indeed one can have: > > 1) both minimal and full conformance (your exemple above with the version comment) > 2) just minimal and not full conformance (bad Bounding Box values for example) > 3) full conformance and not minimal (no EndProlog for example and just a new line or a comment) Not at DSC Level 1. If a PostScript program fully conforms to Level 1 then it also minimally conforms. Above DSC Level 1, there is no such thing as minimally conforming. > 4) none of them (easy to have...) > > As we can have all the possibilities, i can not see how such minimal conformance is interesting, except if my library, via an API, sets that one want minimal conforming. In that case, that would eliminate points 3) and 4). Well, you are the one who asked about it :-) -- Regards, Martin Leese E-mail: please@see.Web.for.e-mail.INVALID Web: http://members.tripod.com/martin_leese/
[toc] | [prev] | [next] | [standalone]
| From | vincent.torri@gmail.com |
|---|---|
| Date | 2016-08-04 10:17 -0700 |
| Message-ID | <bf2a1c4f-c0c8-45f8-bc1e-968027ff0004@googlegroups.com> |
| In reply to | #2733 |
Le jeudi 4 août 2016 17:43:52 UTC+2, Martin Leese a écrit : > vincent.torri@gmail.com wrote: > > > If it is inside the prostscript, then I don't understand the reason to have such minimal conformance. > > Adobe agreed with you, and dropped minimal > conformance in later levels of DSC. > > > Indeed one can have: > > > > 1) both minimal and full conformance (your exemple above with the version comment) > > 2) just minimal and not full conformance (bad Bounding Box values for example) > > 3) full conformance and not minimal (no EndProlog for example and just a new line or a comment) > > Not at DSC Level 1. If a PostScript program > fully conforms to Level 1 then it also > minimally conforms. right, i've got EndProglog and EndComments mixed up. Sorry. > Above DSC Level 1, there > is no such thing as minimally conforming. ok. I'll see if I can write some code... thank you Vincent Torri
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.postscript
csiph-web