Doesn't work. 
I am trying to put the table I create in the center of the page. How can
I do it ?
Regards,david

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paulo
Soares
Sent: Monday, December 19, 2005 7:28 PM
To: David Wong; [email protected]
Subject: RE: [iText-questions] PDF Page Margins

Try:

Graphics2D g2 = cb.createGraphicsShapes(400, 400); 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of David Wong
> Sent: Sunday, December 18, 2005 6:33 AM
> To: [email protected]
> Subject: [iText-questions] PDF Page Margins
> 
> Hi
> I tried to do this instead 
> 
> 
> >            // Create the graphics as shapes
> >            cb.saveState();
> >            Graphics2D g2 = cb.createGraphicsShapes(600, 600);
> >            // Print the table to the graphics
> >            Shape oldClip = g2.getClip();
> >            g2.clipRect(100,100, 700, 700);
> >            table.print(g2);
> >            g2.setClip(oldClip);
> 
> 
> But my table is still appearing at the top left hand corner of the pdf
> page without ANY margin at all (despite I positioned it away from the
> sides g2.clipRect(100,100, 700, 700); . any ideas what is wrong ?
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Paulo
> Soares
> Sent: Monday, December 12, 2005 1:46 AM
> To: David Wong; iText Mailing List
> Subject: Re: [iText-questions] PDF Page Margins
> 
> setMargins() will only work in the next page. For the first 
> page set it 
> before opening. About the table location the margins don't 
> matter as you
> are 
> placing it at an absolute position.
> 
> ----- Original Message ----- 
> From: "David Wong" <[EMAIL PROTECTED]>
> To: "iText Mailing List" <[email protected]>
> Sent: Sunday, December 11, 2005 5:14 PM
> Subject: [iText-questions] PDF Page Margins
> 
> 
> > Hi guys,
> >
> > I tried to use document.setMargins(200,200,200,200); to set the page
> > margins but the output page always place the table I create 
> at the top
> > left hand corner without any margins at all. setMargins() return a
> true
> > indicating the operation is successful.
> >
> > Any idea why it doesn't work? (see code below for my 
> implementation).
> > Thanks!
> >
> >
> >
> > private void print() {
> >        Document document = new Document(PageSize.A4.rotate());
> >        try {
> >            PdfWriter writer =
> >            PdfWriter.getInstance(document, new
> > FileOutputStream("jTable.pdf"));
> >
> >            document.open();
> >            document.setMargins(200,200,200,200);
> >            System.out.println("SetMargins:
> > "+document.setMargins(200,200,200,200));
> >            PdfContentByte cb = writer.getDirectContent();
> >
> >            // Create the graphics as shapes
> >            cb.saveState();
> >            Graphics2D g2 = cb.createGraphicsShapes(600, 600);
> >            // Print the table to the graphics
> >            Shape oldClip = g2.getClip();
> >            g2.clipRect(0,0, 600, 600);
> >            table.print(g2);
> >            g2.setClip(oldClip);
> >
> >            g2.dispose();
> >            cb.restoreState();
> >
> > 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-q
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Paulo
> Soares
> Sent: Saturday, December 17, 2005 5:42 PM
> To: Baker, Gregory M; [email protected]
> Subject: Re: [iText-questions] PDF Columns not displaying
> 
> Works for me.
> 
> ----- Original Message ----- 
> From: "Baker, Gregory M" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Friday, December 16, 2005 9:30 PM
> Subject: [iText-questions] PDF Columns not displaying
> 
> 
> I hope somebody can give me a suggestion on a problem I am having.
>  
> We have a routine to create a PDF file using iText.  This 
> routine always
> uses a template.  I am trying to use a column so that I can 
> write out a
> large comments field with automatic wrapping.  However, no 
> text is ever
> displayed on my document.
>  
> An example of my code is below.  Any ideas?
>  
> PdfContentByte cb = writer.getDirectContent();
> document.newPage();
> PdfImportedPage page = writer.getImportedPage(reader, pageNumber);
> cb.addTemplate(page, X, Y);
> BaseFont helveticaFont = BaseFont.createFont(BaseFont.HELVETICA,
> BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
> Font font = new Font(helveticaFont, 8, Font.NORMAL);
> Phrase fContent = new Phrase("testing\n", font);
> ColumnText ct = new ColumnText(cb);
> ct.setSimpleColumn(fContent,100, 300, 200, 500,
> 15,Element.ALIGN_CENTER);
> try
> {
>   ct.go();
> }
> catch (Exception e)
> {
>   System.out.println("error trying to write field: " + 
> e.getMessage());
> }
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep 
> through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=ick
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to