I'm not quite sure what you mean as I am new to iText but my code is: 
...
PdfContentByte cb = writer.getDirectContent();
PdfTemplate tp = cb.createTemplate(500, 500);
Graphics2D g2 = tp.createGraphics(500, 500);

JPanel empty = new SmallFret();
empty.print(g2);

JPanel empty1 = new SmallFret();
empty1.print(g2);

...

and I have tried adding a cb.addTemplate(tp, x, y) method call before each
of the JPanel statements but when I do that it seems as if both are drawn at
their respective positions twice.
Mike



Paulo Soares wrote:
> 
> Put each in a PdfTemplate.
> 
> Paulo 
> 
> 
> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On 
>> Behalf Of mikeS
>> Sent: Wednesday, June 27, 2007 4:31 PM
>> To: [email protected]
>> Subject: [iText-questions] Spacing JPanels in PDF
>> 
>> 
>> Hi, 
>> I have a guitar fretboard which is being correctly printed to 
>> a pdf. The
>> thing is, is that in my program, I have an array of JPanels containg
>> different guitar fretboard configurations, and I'm not sure 
>> how to space
>> them / move them down a line. When I try printing two 
>> together they just
>> print ontop of each other.
>> Thanks in advance,
>> Mike
> 
> 
> 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.
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Spacing-JPanels-in-PDF-tf3989076.html#a11327601
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to