pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Kuznetsov" <imag...@gmx.de>
Subject AW: Extracting vector graphics from PDF
Date Mon, 02 Apr 2012 13:51:54 GMT
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
}

}

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


Mime
View raw message