Chandrajeet:
I am not sure there is any link between your post and the original query
below by Clair Cabal. Chandrajeet please create a new thread and copy over
the related material (your original post and Leonard's reply) if you want to
continue this discussion.
By creating your own thread rather than tacking on to unrelated messages,
you help the archives function as a working resource.
Thanks!
---Mister Bean
>>> re >>>
chandrajeet wrote:
>
> Hi All,
>
> I want a PDF output of a large JTable without any pagination.
> I am sending a sample output attached.
> Whatever may be the row or column count, I want that in a single page.
> With the cell colors retained.
>
> I used the following code: -
>
> Document document = new Document();
> table.setVisible(true);
> try {
> // step 2: creation of the writer
> PdfWriter writer = PdfWriter.getInstance(document, new
> FileOutputStream(FILE_NAME));
>
> // step 3: we open the document
> document.open();
>
> // step 4: we grab the ContentByte and do some stuff with it
>
> // we create a template and a Graphics2D object that
> corresponds with it
> int w = table.getWidth();
> int h = table.getHeight();
> PdfContentByte cb = writer.getDirectContent();
> PdfTemplate tp = cb.createTemplate(w, h);
> Graphics2D g2 = tp.createGraphics(w, h);
> tp.setWidth(w);
> tp.setHeight(h);
> table.paint(g2);
> g2.dispose();
> cb.addTemplate(tp, 50, 400);
> }
> catch(DocumentException de) {
> System.err.println(de.getMessage());
> }
> catch(IOException ioe) {
> System.err.println(ioe.getMessage());
> }
> // step 5: we close the document
> document.close();
>
> But this prints absolutely nothing .
> Thanks
> Chandrajeet Padhy.
>
>
>
>
> ----- Original Message ----
> From: Clair W. Cabal <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Wednesday, June 20, 2007 11:30:51 AM
> Subject: [iText-questions] Dynamic content in document header
>
>
>
>
>
>
>
> <!--
>
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
> {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times
> New
> Roman";}
> a:link, span.MsoHyperlink
> {color:blue;text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
> {color:purple;text-decoration:underline;}
> span.EmailStyle17
> {font-family:Arial;color:windowtext;}
> _filtered {margin:1.0in 1.25in 1.0in 1.25in;}
> div.Section1
> {}
> -->
>
>
>
>
>
>
> My task is this: create a pdf report document of many
> pages where each page has a header with both fixed content and dynamic
> content
> (the value changes periodically throughout the report).
>
>
>
>
>
> I have been unable to accomplish this. I have a class
> that builds the report and a class that builds the header which extends
> PdfPageEventHelper. The PdfPageEventHelper class has access to the
> attributes that periodically change in the report class. I initialize the
> variables that need to display in the onStartPage method, and display the
> header information in the onEndPage method. Whatever the LAST variable
> values are for the report is what gets printed in the header of every
> page. So, it looks like the PdfPageEventHelper methods do not execute
> until the entire document is complete – by which time I have lost the
> ability to capture the values I need. Is there a way to do this?
>
>
>
>
>
> Clair W. Cabal
>
>
> Nelson & Associates
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Get the Yahoo! toolbar and be alerted to new email wherever you're
> surfing.
> http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> 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/Re%3A-Dynamic-content-in-document-header-tf4142938.html#a11790976
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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/