You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Clay Leeds <cl...@medata.com> on 2003/05/09 17:18:58 UTC

Re: PDF metadata

Jeremias Maerki wrote:
> Well, I think there's two kinds of metadata available in PDF. The
> chapter 9.2.1 (PDF spec) "Document Information Dictionary" object
> (represented by PDFInfo.java) which takes the basic values such as
> creator, title, keywords, etc. And there are metadata streams (chapter
> 9.2.2). These have not yet been implemented and I can't tell offhand how
> much work it would be to implement them. I guess it depends what exactly
> you need to place in the PDF.

I've read the chapter 9.2.1 (PDF spec) "Document Information Dictionary" 
  and still don't know how to leverage this piece of information. Must I 
use Java to add this meta-data to the PDF file, or can I do it from the 
command line interface? In other words, can it be done from within 
xsl-fo? What do the calls look like?

Thanks!
-- 
Clay Leeds - cleeds@medata.com
Web Developer - Medata, Inc. - http://www.medata.com
PGP Public Key: https://mail.medata.com/pgp/cleeds.asc


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: PDF metadata

Posted by Jeremias Maerki <de...@greenmail.ch>.
The only thing close to metadata in XSL-FO is fo:title on
fo:page-sequence, I think. We would have to write a FOP extension
(similar to outlines) to bring metadata over to the PDF document. (Maybe
this would also be a job for http://exslfo.sourceforge.net or XSL 1.1.)

At the moment you can only do it with Java (on the PDFRenderer instance)
and only with a small subset of values (setProducer()) if you don't hack
the PDF renderer.

On 09.05.2003 17:18:58 Clay Leeds wrote:
> Jeremias Maerki wrote:
> > Well, I think there's two kinds of metadata available in PDF. The
> > chapter 9.2.1 (PDF spec) "Document Information Dictionary" object
> > (represented by PDFInfo.java) which takes the basic values such as
> > creator, title, keywords, etc. And there are metadata streams (chapter
> > 9.2.2). These have not yet been implemented and I can't tell offhand how
> > much work it would be to implement them. I guess it depends what exactly
> > you need to place in the PDF.
> 
> I've read the chapter 9.2.1 (PDF spec) "Document Information Dictionary" 
>   and still don't know how to leverage this piece of information. Must I 
> use Java to add this meta-data to the PDF file, or can I do it from the 
> command line interface? In other words, can it be done from within 
> xsl-fo? What do the calls look like?



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: PDF metadata

Posted by Victor Mote <vi...@outfitr.com>.
Clay Leeds wrote:

> Here're the supported PDF meta-data attributes:
>
> Title
> Author
> Subject
> Keywords
> Creator
> Producer
> CreationDate
> ModDate
> Trapped
>
> Here's the PDF Spec Example:
>
> Example 9.1 shows a typical document information dictionary.
> 1 0 obj
>    << /Title (PostScript Language Reference, Third Edition)
>      /Author (Adobe Systems Incorporated)
>      /Creator (Adobe® FrameMaker® 5.5.3 for Power Macintosh)
>      /Producer (Acrobat® Distiller™ 3.01 for Power Macintosh)
>      /CreationDate (D:19970915110347-08'00')
>      /ModDate (D:19990209153925-08'00')
>    >>
> endobj
>
> Unfortunately, I don't know how to add these.
>
> Would I do something like this:
>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
>                 xmlns:fox="http://xml.apache.org/fop/extensions">
>    <fox:metadata title="Nifty PDF Meta Data">
>    <fox:metadata author="Clay Leeds">
>    <fox:metadata creator="XMLSpy">
>    <fox:metadata producer="Yahoo Serious">
>    <fox:metadata creation-date="2003-05-09">
>    <fox:metadata modification-date="2003-05-09">
> </fo:root>
>
> BTW, just as I was sending this, Jeremias' e-mail came through. I don't
> know if this stuff has any bearing (or might help "make it so"), but
> here it is...

There are two issues. First, you need a way to tell the FOP session what
metadata to embed in the PDF. Second, FOP needs to be able to take that
information and actually embed it. The "fox" code you have written above
would be one way to handle the first issue. The second issue will require
some modifications to FOP (i.e. java programming) which are probably not
terrible difficult.

Victor Mote


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: PDF metadata

Posted by Clay Leeds <cl...@medata.com>.
Victor Mote wrote:
> I think the best way to do this would be with our FO extension mechanism,
> using the "fox" namespace. There are no calls to do this right now, but it
> will be pretty doable after we get the redesign done. (Its actually pretty
> doable now, but the redesign needs to take priority).
> 
> Victor Mote

I've never used FOP's extensions, although I keep threatening to play 
around a bit with Bookmarks. Here's an example from the FOP site:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:fox="http://xml.apache.org/fop/extensions">
   <fox:outline internal-destination="sec3">
     <fox:label>Running FOP</fox:label>

     <fox:outline internal-destination="sec3-1">
       <fox:label>Prerequisites</fox:label>
     </fox:outline>
   <fox:outline>
</fo:root>

Here're the supported PDF meta-data attributes:

Title
Author
Subject
Keywords
Creator
Producer
CreationDate
ModDate
Trapped

Here's the PDF Spec Example:

Example 9.1 shows a typical document information dictionary.
1 0 obj
   << /Title (PostScript Language Reference, Third Edition)
     /Author (Adobe Systems Incorporated)
     /Creator (Adobe® FrameMaker® 5.5.3 for Power Macintosh)
     /Producer (Acrobat® Distiller™ 3.01 for Power Macintosh)
     /CreationDate (D:19970915110347-08'00')
     /ModDate (D:19990209153925-08'00')
   >>
endobj

Unfortunately, I don't know how to add these.

Would I do something like this:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:fox="http://xml.apache.org/fop/extensions">
   <fox:metadata title="Nifty PDF Meta Data">
   <fox:metadata author="Clay Leeds">
   <fox:metadata creator="XMLSpy">
   <fox:metadata producer="Yahoo Serious">
   <fox:metadata creation-date="2003-05-09">
   <fox:metadata modification-date="2003-05-09">
</fo:root>

BTW, just as I was sending this, Jeremias' e-mail came through. I don't 
know if this stuff has any bearing (or might help "make it so"), but 
here it is...
-- 
Clay Leeds - cleeds@medata.com
Web Developer - Medata, Inc. - http://www.medata.com
PGP Public Key: https://mail.medata.com/pgp/cleeds.asc


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: PDF metadata

Posted by Victor Mote <vi...@outfitr.com>.
Clay Leeds wrote:

> I've read the chapter 9.2.1 (PDF spec) "Document Information Dictionary"
>   and still don't know how to leverage this piece of information. Must I
> use Java to add this meta-data to the PDF file, or can I do it from the
> command line interface? In other words, can it be done from within
> xsl-fo? What do the calls look like?

I think the best way to do this would be with our FO extension mechanism,
using the "fox" namespace. There are no calls to do this right now, but it
will be pretty doable after we get the redesign done. (Its actually pretty
doable now, but the redesign needs to take priority).

Victor Mote


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org