pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Murray-Rust <pm...@cam.ac.uk>
Subject Re: Extracting vector graphics from PDF
Date Mon, 02 Apr 2012 13:58:47 GMT
On Mon, Apr 2, 2012 at 2:51 PM, Andrey Kuznetsov <imagero@gmx.de> wrote:

> Peter, you have to pass your own Graphics2D object (with some overridden
> methods) to pdfbox.
>
> Something like
>
> MyGraphics2D extends Graphics2D {
>
> public void fill(Shape s) {
>        //extract shape here - don’t forget to apply affine transform
> }
>
> }
>

Got it, I think. (A different mail said you had to extend PageDrawer), so
presumably I need to do that to get my Graphics2D into the system.

I already have stuff that transforms Graphics2D into SVG I think.

>
> Andrey
>
>
> -----Ursprüngliche Nachricht-----
> Von: peter.murray.rust@googlemail.com
> [mailto:peter.murray.rust@googlemail.com] Im Auftrag von Peter Murray-Rust
> Gesendet: Montag, 2. April 2012 15:27
> An: users@pdfbox.apache.org
> Betreff: Re: Extracting vector graphics from PDF
>
> On Mon, Apr 2, 2012 at 1:14 PM, Andrey Kuznetsov <imagero@gmx.de> wrote:
>
> > Forget hacking into the stream.
> > Hack into Graphics2D - this is much easier and will give you shape in
> > right size and transform.
> >
>
> Many Thanks Andrey,
>
> I did something like that before and got a separate graphics stream which I
> was able to interpret, but it was disjoint from the stream. Is it possible
> to examine the Graphics2D in the debugger.
>
> When you say "Graphics2D" do you mean Java 2D or is there a PDFBox graphics
> engine? If so what is it called :-)
>
> P.
>
>
>
> --
> Peter Murray-Rust
> Reader in Molecular Informatics
> Unilever Centre, Dep. Of Chemistry
> University of Cambridge
> CB2 1EW, UK
> +44-1223-763069
>
>


-- 
Peter Murray-Rust
Reader in Molecular Informatics
Unilever Centre, Dep. Of Chemistry
University of Cambridge
CB2 1EW, UK
+44-1223-763069

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message