What's the best way to print an image into the PDF using FOP?

I have it working using fo:instream-foreign-object in my XSL to send a
hard coded svg graphic.  This method works no matter what output I
select (PDF, printer, preview).
I tested one using the SVG which created a 54KB PDF, which among other
things included the image twice.
I ran that same exact test, replacing the fo:instream-foreign-object SVG
image with fo:external-graphic JPG and it created a 73KB PDF.
I thought the JPG was supposed to produce smaller output files than the
SVG.  Am I missing something?
Ideally I would like to package the JPG into a JAR to print from so I
don't have to worry about a physical file location.
I thought putting an image in a JAR which is in my classpath would also
avoid having different references for client and server calls (running
embedded code).
I put the images into a folder within the jar if that matters.  I can't
get it to automatically find the images.
I tried hard coding the src reference to the jar
('jar:file:/C:/Jarpath/Myjar.jar!/Images/Myimage.jpg').  That worked on
the create PDF which is running with server objects.  That's where I got
the 73KB PDF.  Using client objects to get the preview it said it
couldn't find the file on that path.  The path should be the same since
in this test case the client and server are the same machine (using
local webstart).

Reply via email to