108 September 2005 XMP Specification Embedding XMP Metadata in Application Files PostScript and EPS 5 Compatibility With Distiller 5 for PostScript Acrobat Distiller version 5 was the first to include XMP support, but it does not support the /Metadata pdfmark. There is no easy way to attach document-level XMP with Distiller 5. It will ignore the /Metadata pdfmark, without signaling a PostScript error. LanguageLevel 1 for PostScript and EPS The SubFileDecode filter became available in PostScript LanguageLevel 2. If the PostScript or EPS containing XMP must be processed by PostScript LanguageLevel 1 devices, such as older printers, another approach must be used to read the XMP into the stream object. With PostScript LanguageLevel 1, there are at least two approaches: using readstring to read in the whole XMP packet, or readline to read in the XMP packet data line by line until an end marker is found. We present the readline approach here. The readline approach solves two problems that exist for readstring: We don’t have to know the exact size of the whole packet, just need to know the maximum length of the lines. The exact length of an XMP packet may change if the PostScript/EPS file is re-saved by a text editor with different line ending convention, CR, LF, or CRLF. Here is an example showing how to use the readline approach for PostScript. It is very similar overall to the earlier example, differing only in step 2 and related prolog: % ====================================================================== % We start with some Postscript prolog. This defines operators and % procedures that we will use when processing the XMP metadata. % Define pdfmark to cleartomark, so the data is discarded when consumed % by a PostScript printer or by Distiller 4.0 or earlier. All following % references to “privatedict” should be changed to a unique name to % avoid potential conflicts. This is discussed later in the section % “Avoiding Name Conflicts”. /currentdistillerparams where {pop currentdistillerparams /CoreDistVersion get 5000 lt} {true} ifelse {privatedict /pdfmark /cleartomark load put} if % Define another procedure to read line by line from current file until % marker line is found. The maximum line length is used to create a % temporary buffer for reading the XMP lines. % On stack: [ {name} maxLineLength MarkerString privatedict /metastring_pdfmark { 2 dict begin /markerString exch def string /tmpString exch def { currentfile tmpString readline pop
Previous Page Next Page