Thanks Paolo already I have erased those lines and the image continues being transparent.   

Many thanks by your rapidity in the answer   

A greeting


Paulo Soares escribió:
Works for me. You may post the PDF for inspection. Some comments: use an
Image instead of an Watermark and the lines 

water.setBackgroundColor (Image.getInstance
(rutaDestino).backgroundColor ());
water.setTransparency (Image.getInstance (rutaDestino).getTransparency
()); 

should be deleted.

Paulo

  
-----Original Message-----
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]] On 
Behalf Of Alejandro
Sent: Wednesday, June 21, 2006 12:56 PM
To: [email protected]
Subject: [iText-questions] [Fwd: not find the XObject 'Xi0']


Hi

I have a problem when I generate a document with a water mark 
in itext.

The following code shows as I make it 

--------------------------------------------------------------
-------------------------
....
PdfReader reader = new PdfReader ("c:/"+doc.getId_doc()+ ".pdf");
                                       

          FileOutputStream fo = new FileOutputStream 
("c:/firmados/"doc.getId_doc() + ".pdf");

         
            stp = PdfStamper.createSignature (reader, fo, 
'\0', null, true);

Watermark water = new Watermark (Image.getInstance 
(rutaDestino), 0, 0);
          water.scalePercent (15);
          water.setRotationDegrees ( -45);
          PdfSignatureAppearance sap = stp.getSignatureAppearance ();
          
          int n = reader.getNumberOfPages ();
          PdfContentByte cb = null;
          water.setBackgroundColor (Image.getInstance 
(rutaDestino).backgroundColor ());
          water.setTransparency (Image.getInstance 
(rutaDestino).getTransparency ());
          int valor_porcentaje = 150;
          for (int i2 = 1; i2 <= n; i2++)
          {
            com.lowagie.text.Rectangle rect2 = reader.getCropBox (i2);
            if(rect2.width() > 2000 || rect2.height() > 2000)
            {
              water.scalePercent(20);
              valor_porcentaje = 250;
            }
            else
            {
              if(sello == 1){
              water.scalePercent(15);
              valor_porcentaje = 150;
              }
              else
              water.scalePercent(15);
              valor_porcentaje = 170;              
            }
    
            if (reader.getPageRotation (i2) == 90 ||   
reader.getPageRotation (i2) == 270)
            {
              if(rect2.width() < rect2.height())
              {
                water.setAbsolutePosition(rect2.height() - 
valor_porcentaje, rect2.width() - valor_porcentaje);
              }
                else
                {
                  water.setAbsolutePosition(rect2.width() - 
valor_porcentaje, rect2.height() - valor_porcentaje);        
                }
            }
            else
            {
              water.setAbsolutePosition (rect2.width () - 
valor_porcentaje,   rect2.height () - valor_porcentaje);
            }
            
            cb = stp.getOverContent(i2);
            cb.addImage (water);
          }
          //System.out.println ("Marcando pagina " + i2 + "de " + n);
          sap.setCrypto (key, chain, null, 
PdfSignatureAppearance.WINCER_SIGNED);
          sap.setReason ("SELLANDO DOCUMENTO);
          sap.setLocation ("Madrid");
          stp.close ();



If I do not add to the water mark the document it opens to me 
correctly. If I add it it leaves the message to me which it 
does not find xobject denominated Xi0

To pardon my English Thanks to me for everything 



    


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.



  

_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to