001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: /* $Id: DSCConstants.java 512838 2007-02-28 16:42:28Z jeremias $ */
019:
020: package org.apache.xmlgraphics.ps;
021:
022: /**
023: * This class defines constants with Strings for the DSC specification.
024: *
025: * @version $Id: DSCConstants.java 512838 2007-02-28 16:42:28Z jeremias $
026: */
027: public class DSCConstants {
028:
029: // ----==== General Header Comments ====----
030:
031: /** Lead-in for a DSC-conformant PostScript file */
032: public static final String PS_ADOBE_30 = "%!PS-Adobe-3.0";
033:
034: /** Lead-in for an EPS file */
035: public static final String EPSF_30 = "EPSF-3.0";
036:
037: /** Bounding box for the document */
038: public static final String BBOX = "BoundingBox";
039: /** High-resolution bounding box for the document */
040: public static final String HIRES_BBOX = "HiResBoundingBox";
041: /** Copyright information associated with the document or resource */
042: public static final String COPYRIGHT = "Copyright";
043: /** Creator of the document */
044: public static final String CREATOR = "Creator";
045: /** Date and time when the document was created */
046: public static final String CREATION_DATE = "CreationDate";
047: /** Type of data */
048: public static final String DOCUMENT_DATA = "BoundingBox";
049: /** Use for indicating an emulator being invoked in the document */
050: public static final String EMULATION = "Emulation";
051: /** Explicit end of comments */
052: public static final String END_COMMENTS = "EndComments";
053: /** Required PostScript Level 1 extension for this document */
054: public static final String EXTENSIONS = "Extensions";
055: /** Indicates who is this document printed for */
056: public static final String FOR = "For";
057: /** Indicates the PostScript language level used in the document */
058: public static final String LANGUAGE_LEVEL = "LanguageLevel";
059: /** Indicates the orientation of the document */
060: public static final String ORIENTATION = "Orientation";
061: /** Number of pages in the document */
062: public static final String PAGES = "Pages";
063: /** Indicates the order of the pages */
064: public static final String PAGE_ORDER = "PageOrder";
065: /** Indicates how the document should be routed back to its owner */
066: public static final String ROUTING = "Routing";
067: /** Title of the document */
068: public static final String TITLE = "Title";
069: /** Version of the document */
070: public static final String VERSION = "Version";
071:
072: // ----==== General Body Comments ====----
073:
074: /** Indicates a continued line */
075: public static final String NEXT_LINE = "+ ";
076:
077: //Skipping BeginBinary/EndBinary. They are deprecated.
078:
079: /** Indicates the start of a data section*/
080: public static final String BEGIN_DATA = "BeginData";
081: /** Indicates the end of a data section*/
082: public static final String END_DATA = "EndData";
083:
084: /** Indicates the start of the defaults section */
085: public static final String BEGIN_DEFAULTS = "BeginDefaults";
086: /** Indicates the end of the defaults section */
087: public static final String END_DEFAULTS = "EndDefaults";
088:
089: /** Indicates the start of a non-PostScript section */
090: public static final String BEGIN_EMULATION = "BeginEmulation";
091: /** Indicates the end of a non-PostScript section */
092: public static final String END_EMULATION = "EndEmulation";
093:
094: /** Indicates the start of a preview section (EPS only)*/
095: public static final String BEGIN_PREVIEW = "BeginPreview";
096: /** Indicates the end of a preview section (EPS only)*/
097: public static final String END_PREVIEW = "EndPreview";
098:
099: /** Indicates the start of the prolog */
100: public static final String BEGIN_PROLOG = "BeginProlog";
101: /** Indicates the end of the prolog */
102: public static final String END_PROLOG = "EndProlog";
103:
104: /** Indicates the start of the document setup */
105: public static final String BEGIN_SETUP = "BeginSetup";
106: /** Indicates the end of the document setup */
107: public static final String END_SETUP = "EndSetup";
108:
109: // ----==== General Page Comments ====----
110:
111: /** Indicates the start of a graphic object */
112: public static final String BEGIN_OBJECT = "BeginObject";
113: /** Indicates the end of a graphic object */
114: public static final String END_OBJECT = "EndObject";
115:
116: /** Indicates the start of the page setup section */
117: public static final String BEGIN_PAGE_SETUP = "BeginPageSetup";
118: /** Indicates the end of the page setup section */
119: public static final String END_PAGE_SETUP = "EndPageSetup";
120:
121: /** Indicates a page number */
122: public static final String PAGE = "Page";
123: /** Bounding box for a page */
124: public static final String PAGE_BBOX = "PageBoundingBox";
125: /** High-resolution bounding box for a page */
126: public static final String PAGE_HIRES_BBOX = "PageHiResBoundingBox";
127: /** Bounding box for a page */
128: public static final String PAGE_ORIENTATION = "PageOrientation";
129:
130: // ----==== General Trailer Comments ====----
131:
132: /** Indicates the start of the page trailer */
133: public static final String PAGE_TRAILER = "PageTrailer";
134: /** Indicates the start of the document trailer */
135: public static final String TRAILER = "Trailer";
136: /**
137: * Indicates the end of a page (NON-STANDARD!)
138: * @deprecated Shouldn't really use that. Bad idea. "Page" and "Trailer" end a page.
139: */
140: public static final String END_PAGE = "EndPage";
141: /** Indicates the end of the document */
142: public static final String EOF = "EOF";
143:
144: // ----==== Requirements Conventions ====----
145:
146: /**@todo Add the missing comments */
147: /**
148: * This comment indicates all types of paper media (paper sizes, weight, color)
149: * this document requires.
150: */
151: public static final String DOCUMENT_MEDIA = "DocumentMedia";
152: /** This comment provides a list of resources the document needs */
153: public static final String DOCUMENT_NEEDED_RESOURCES = "DocumentNeededResources";
154: /** This comment provides a list of resources the document includes */
155: public static final String DOCUMENT_SUPPLIED_RESOURCES = "DocumentSuppliedResources";
156: //Skipping %%DocumentPrinterRequired
157: //Skipping %%DocumentNeededFiles -> deprecated
158: //Skipping %%DocumentSuppliedFiles -> deprecated
159: //Skipping %%DocumentFonts -> deprecated
160: //Skipping %%DocumentNeededFonts -> deprecated
161: //Skipping %%DocumentSuppliedFonts -> deprecated
162: //Skipping %%DocumentNeededProcSets -> deprecated
163: //Skipping %%DocumentSuppliedProcSets -> deprecated
164: //Skipping %%OperatorIntervention
165: //Skipping %%OperatorMessage
166: //Skipping %%ProofMode
167: /**
168: * This comment describes document requirements, such as duplex printing,
169: * hole punching, collating, or other physical document processing needs.
170: */
171: public static final String REQUIREMENTS = "Requirements";
172: //Skipping %%VMlocation
173: //Skipping %%VMusage
174:
175: // ----==== Requirement Body Comments ====----
176:
177: /** Indicates the start of an embedded document */
178: public static final String BEGIN_DOCUMENT = "BeginDocument";
179: /** Indicates the end of an embedded document */
180: public static final String END_DOCUMENT = "EndDocument";
181: /** Indicates a referenced embedded document */
182: public static final String INCLUDE_DOCUMENT = "IncludeDocument";
183:
184: /** Indicates the start of a PPD feature */
185: public static final String BEGIN_FEATURE = "BeginFeature";
186: /** Indicates the end of a PPD feature */
187: public static final String END_FEATURE = "EndFeature";
188: /** Indicates a referenced a PPD feature */
189: public static final String INCLUDE_FEATURE = "IncludeFeature";
190:
191: //Skipping BeginFile/EndFile/IncludeFile. They are deprecated.
192: //Skipping BeginFont/EndFont/IncludeFont. They are deprecated.
193: //Skipping BeginProcSet/EndProcSet/IncludeProcSet. They are deprecated.
194:
195: /** Indicates the start of a resource (font, file, procset) */
196: public static final String BEGIN_RESOURCE = "BeginResource";
197: /** Indicates the end of a resource (font, file, procset) */
198: public static final String END_RESOURCE = "EndResource";
199: /** Indicates a referenced a resource (font, file, procset) */
200: public static final String INCLUDE_RESOURCE = "IncludeResource";
201:
202: // ----==== Requirement Page Comments ====----
203:
204: //Skipping %%PageFonts -> deprecated
205: //Skipping %%PageFiles -> deprecated
206: /** Indicates that the paper attributes denoted by medianame are invoked on this page. */
207: public static final String PAGE_MEDIA = "PageMedia";
208: /**
209: * This is the page-level invocation of a combination of the options listed in
210: * the %%Requirements: comment.
211: */
212: public static final String PAGE_REQUIREMENTS = "PageRequirements";
213: /**
214: * This comment indicates the names and values of all resources that are needed
215: * or supplied on the present page.
216: */
217: public static final String PAGE_RESOURCES = "PageResources";
218:
219: // ----==== (atend) indicator ====----
220:
221: /**
222: * Indicator for the PostScript interpreter that the value is provided
223: * later in the document (mostly in the %%Trailer section).
224: */
225: public static final Object ATEND = new AtendIndicator();
226:
227: /** Used for the ATEND constant. See there. */
228: private static final class AtendIndicator extends Object {
229:
230: private AtendIndicator() {
231: super ();
232: }
233:
234: public String toString() {
235: return "(atend)";
236: }
237: }
238:
239: }
|