It's the same. In the first case it really does this in PdfWriter:

PdfStream xmp = new PdfStream(xmpMetadata);
xmp.put(PdfName.TYPE, PdfName.METADATA);
xmp.put(PdfName.SUBTYPE, PdfName.XML);
catalog.put(PdfName.METADATA, body.add(xmp).getIndirectReference());

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Roger Misteli
> Sent: Wednesday, October 18, 2006 1:19 PM
> To: Post all your questions about iText here
> Subject: [iText-questions] Is this the same?
> 
> Hiyas
> 
> If I have this snippet:
> 
> byte[] buffer = ....
> 
> PdfStream xmp = new PdfStream(buffer);
>              xmp.put(PdfName.TYPE, PdfName.METADATA);
>              xmp.put(PdfName.SUBTYPE, new PdfName("XML"));
> 
>              PdfReader reader = new PdfReader(pdfBytes);
>              ByteArrayOutputStream bos = new ByteArrayOutputStream();
>              PdfStamper stp = new PdfStamper(reader, bos,
> PdfWriter.VERSION_1_5);
>              stp.setXmpMetadata(xmpBuffer.getBytes());
>              stp.close();
> 
> 
> is this the same as when I do this:
> 
> PdfStream xmp = new PdfStream(buffer);
>        xmp.put(PdfName.TYPE, PdfName.METADATA);
>        xmp.put(PdfName.SUBTYPE, new PdfName("XML"));
>        // xmp.flateCompress();
>        PdfIndirectReference ref =
> writer.addToBody(xmp).getIndirectReference();
>        writer.getExtraCatalog().put(PdfName.METADATA, ref);
> 
> 
> In terms of.. what catalog is being used? In the latter 
> version I use getExtraCatalog(), but what catalog is used 
> with the former version? In other 
> words.. is it possible that one writes to the information 
> stream, the other one to the Catalog?
> 
> Rog
> 
> --------------------------------------------------------------
> -----------
> Using Tomcat but need to do more? Need to support web 
> services, security?
> Get stuff done quickly with pre-integrated technology to make 
> your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on 
> Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&;
> dat=121642
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to