There are some very large numbers that exceed the PDF limits. For
example:

410.77 698710556672 409.09 698710556672 407.02 698710556672 c

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Paul Belleville
> Sent: Wednesday, December 05, 2007 1:07 AM
> To: [email protected]
> Subject: [iText-questions] Token type not recognized - jFreeChart
> 
> All:
>  
> Attached is the problem PDF file.
>  
> I am using using 
> jFreeChart 1.0.8
> jCommon 1.0.12
> (I get the same problem with jFreeChart 1.0.6)
>  
> I have an application which can create Box Plots within the 
> GUI, or export them to PDF (using iText 2.0.5).
> In the GUI you can go from one dataset to the next and the 
> Box Plot draws in the chartPanel.  Or you
> can ask the app to run through all datasets and send the 
> graphs to a PDF file.
>  
> The PDF file saves fine.  But when I open it and scroll down 
> several pages, one page gives me an error.
>  
> The error I get is:
> Adobe Reader error:
> Token type not recognized.
>  
> This is for a PDF file which includes a set of Box Plot charts.
> It seems it might have to do something with the chart where 
> the std Dev = 0, or the chart right 
> after that one.
> It occurs in Adobe Reader, after 2 graphs where Std Dev = 0.
> Those 2 graphs look fine in the PDF file, but when going to 
> the next page I get the error.
> In my GUI application, I can navigate through all graphs with 
> no issue.
>  
>  
> I use the 2 methods below to write a chart, then new page, 
> then new chart, then page, etc:
>  
>     /**
>      * Writes a set of charts to an open PDF document in an 
> open output stream in PDF format.
>      *
>      * @param chartList the arrayList of charts.
>      * @param width the width of one chart.
>      * @param height the height of one chart.
>      *
>      */
>     public void writeChartToOpenPDF(ArrayList<JFreeChart> chartList,
>             int width,
>             int height) throws IOException {
>         FontMapper mapper = new DefaultFontMapper();
>         PdfContentByte cb = writer.getDirectContent();
>         int i=0;
>         for (i=0; i<chartList.size(); i++) {
>             JFreeChart chart = chartList.get(i);
>             PdfTemplate tp = cb.createTemplate(width, height);
>             Graphics2D g2 = tp.createGraphics(width, height, mapper);
>             Rectangle2D r2D = new Rectangle2D.Double(0, 0, 
> width, height);
>             chart.draw(g2, r2D);
>             g2.dispose();
>             cb.addTemplate(tp, 5, (height+5)*i+5);
>         }
>     }
>     
>     public void addNewPage() {
>         document.newPage();
>     }
>  
>     /**
>      * Opens a file for PDF.
>      *
>      * @param file the file.
>      */
>     public void openPDF(File file, PageLayout layout) throws 
> FileNotFoundException {
>         if (layout == PageLayout.LANDSCAPE)
>             document = new Document(PageSize.A4.rotate()); //landscape
>         else
>             document = new Document(); //portrait
>         try {
>             writer = PdfWriter.getInstance(document, new 
> BufferedOutputStream(new FileOutputStream(file)));
>         } catch (DocumentException ex) {
>             ex.printStackTrace();
>         }
>         document.open();
>     }
>     
>     public void closePDF() {
>         document.close();
>     }
> 
> Let me know if anyone has seen this or has any idea.
> thanks
> Paul Belleville
> 


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.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
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