Thanks Thomas !
For anyone else wanting to get thumbs out, see snippet below.
A further question: PDF -> SVG ?
I am using PDFGo, but it is slow and appears to leak. Any alternatives ?
cheers
jules
<snippet>
public byte[] thumb(Document document, Dimension d, float quality)
throws Exception
{
String width =
document.getDocumentElement().getAttribute(SVGConstants.SVG_WIDTH_ATTRIBUTE)
;
String height =
document.getDocumentElement().getAttribute(SVGConstants.SVG_HEIGHT_ATTRIBUTE
);
JPEGTranscoder t = new JPEGTranscoder();
t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new
Float(quality));
t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new
Float(d.getWidth()));
t.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, new
Float(d.getHeight()));
TranscoderInput input = new TranscoderInput(document);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStream out = new BufferedOutputStream(baos);
TranscoderOutput output = new TranscoderOutput(out);
t.transcode(input, output);
out.flush();
out.close();
return(baos.toByteArray());
}
</snippet>
-----Original Message-----
From: Thomas E Deweese [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 12 February 2003 9:09
To: Batik Users
Subject: RE: SVG Thumbnailing question (PDF representation)
>>>>> "JL" == Julian Salerno <[EMAIL PROTECTED]> writes:
JL> This is more a question for SVG afficionados, but at this point
JL> i'll take any assistance !
JL> I am trying to plumb bits together instead of re-inventing wheels.
JL> My task is to generate thumbnail images from pdf documents. To
JL> this end I have tried both JPedal and Snowbound. Each has
JL> drawbacks (either financial or performance). So, I have looked at
JL> the SVG world.
Take a look at the transcoders: ...batik.transcoder.image
For Thumbnails they should work well.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
CAUTION - This message may contain privileged and confidential information intended
only for the use of the addressee named above. If you are not the intended recipient
of this message you are hereby notified that any use, dissemination, distribution or
reproduction of this message is prohibited. If you have received this message in error
please notify AMCOR immediately. Any views expressed in this message are those of the
individual sender and may not necessarily reflect the views of AMCOR.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]