🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.postscript.programming
Article #667

Embedding Metadata - Need Some Help.

#667
From: Tim_Radle
Date: Fri, 20 Feb 2004 20:03
29 lines
2657 bytes
I'm a PostScript Language newbie, and need some quick help. According to the Adobe XMP Specification, the below code will insert metadata into PostScript files. What I don't know - is once I write this code, what do I use (and how) to process the code and get the metadata that's defined into the target PostScript file? I assume that I have a few syntax errors - any help you could offer would be more than appreciated.
Thanks!

/currentdistillerparams where
{pop currentdistillerparams /CoreDistVersion get 5000 lt} {true} ifelse

{newdict /pdfmark / cleartomark load put
	newdict /metafile_pdfmark {flushfile cleartomark} bind put}
{newdict /metafile_pdfmark {/PUT pdfmark} ifelse

%Define the stream object and associate it as metadata
[/_objdef {ncb_metadata_stream} /type /stream /OBJ pdfmark
[{ncb_metadata_stream} 2 dict begin
	/Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark

%Fill the stream with the XMP Packet...
[{ncb_metadata_stream}
	currentfile 0 (% &&end XMP packet marker&&)
	/SubFileDecode filter metafile_pdfmark

<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' bytes='817'?><rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'><rdf:Description about='' xmlns='http://ns.adobe.com/pdf/1.3/' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Author='Advertising Dept' pdf:Creator='Adobe Illustrator(R) X' pdf:Title='New logo.star.ai'/>
<rdf:Description about='' xmlns='http://ns.adobe.com/xap/1.0/' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:Author='Advertising Dept'><xap:Title><rdf:Alt><rdf:li xml:lang='x-default'>New logo.star.ai</rdf:li></rdf:Alt></xap:Title></rdf:Description>
<rdf:Description about='' xmlns='http://purl.org/dc/elements/1.1/' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:creator='Advertising Dept' dc:title='New logo.star.ai'/>
</rdf:RDF><?xpacket end='r'?>

% &&end XMP packet marker&&

%Attach the stream as the main XMP metadata stream
[{Catalog} {ncb_metadata_stream} /Metadata pdfmark
Technical Details
Message-ID: <2cd022ab.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c61a,4276c71709ca5aae,start
X-Google-Attributes: gid10c61a,public
X-Google-ArrivalTime: 2004-02-20 12:09:45 PST
From: Tim_Radle@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.postscript.programming
Subject: Embedding Metadata - Need Some Help.
Message-ID: <2cd022ab.-1@webx.la2eafNXanI>
Date: Fri, 20 Feb 2004 12:03:29 -0800
Lines: 44
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit