I wanted to export a Java Graphics2D component to PDF
and did something like this:

   PDFDocumentGraphics2D pdfGenerator =
      new PDFDocumentGraphics2D(true, stream, (int)width, (int)height);
   pdfGenerator.setSVGDimension(w, h);
   ((Graphics2D)pdfGenerator).setClip(0, 0, (int)width, (int)height);
   component.export((Graphics2D)pdfGenerator, ctm);
   pdfGenerator.finish();

O.K. this approach has got nothing to do with FO,
so FOP couldn't be blamed if it didn't support it.
(But it sure would be nice :-)

Jens Thieler

-----Ursprüngliche Nachricht-----
Von: Keiron Liddle [mailto:[EMAIL PROTECTED]]
Gesendet am: Montag, 9. Juli 2001 09:34

On Fri, 06 Jul 2001 15:30:59 Thieler Jens wrote:
> Hi,
> 
> I'm a great fan of org.apache.svg.PDFTranscoder
> or rather
> org.apache.svg.PDFDocumentGraphics2D.
> 
> PDFDocumentGraphics2D initializes with
>    super(textAsShapes)
> 
> So the FontState in the superclass PDFGraphics2D
> is not initialized.
> 
> After the augmentation of method PDFGraphics2D.drawString(...)
> on June 26 we're now bound for a NPE in line 710:
>    fontState = new FontState(fontState.getFontInfo(), name,
>                              style, weight, size * 1000, 0);
> 
> Keiron, please make me smile again.


How is it that you are calling drawString. This did not work properly
before anyway and using the transcoder it draws the text as curves.

If you are using the PDFDocumentGraphics2D directly yourself then it would
be a problem.

I'll have a look at it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to