You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Mark Macbeth <mm...@swingtide.com> on 2002/12/09 19:48:54 UTC

FW: incomplete rastorization?

I'm evaluating Batik 1.5beta4b's Rasterizer utility but am encountering
problems.  My goal is to generate a PDF from an image drawn inside
Swing.  To that end, I'm using the SVGGraphics2D class to paint the
component's contents and write image to an SVG file.  The resulting SVG
file renders fine inside Internet Explorer and Squiggle.  However, when
I try to convert the SVG file to anything (PDF, JPEG, whatever), only
the top quarter (approximately) is Rasterized.?.?  I've tried passing in
command line arguments such as:

% java org.apache.batik.apps.rasterizer.Main -m image/jpg -a
0,0,1000,1000 test.svg.  However, the same amount of image is captured.
Larger AOIs just seem to make the final result image smaller.  Has
anyone ever encountered this? 


Re: incomplete rastorization?

Posted by Dave Carlson <dc...@ontogenics.com>.
----- Original Message -----
From: "Thomas E Deweese" <th...@kodak.com>

> DC> I rewrote these exporters to render their own new image using the
> DC> full image size, and not reuse the current offscreen buffer.
>
>     I think this is intentional in Squiggle. The goal is to save the
> 'current view' to disk.  However I could see how your mode might be
> preferable in some cases (one would need to be very careful as if you
> were zoomed in a lot the resultant file could be huge).
>

Yes, I intend to create behavior similar to printing from a Web browser.  By
analogy, printing an entire HTML doc could also be huge.  For SVG, I plan to
implement a "current selection" option that would export only the current
window view to an image.  I use Batik within a view that has scrollbars, and I
believe most users would expect more than the current viewport to be saved to
an exported image.



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: incomplete rastorization?

Posted by Thomas E Deweese <th...@kodak.com>.
Hi Dave, Mark

>>>>> "DC" == Dave Carlson <dc...@ontogenics.com> writes:

DC> I also wrestled with a similar problem last week.  Looking into
DC> the image export code from Squiggle, it seems that it uses the
DC> offscreen image from the current swing view to produce the
DC> exported image (in PNG or JPG).  If the entire image is not
DC> visible, it will not be saved to the image file.

DC> I rewrote these exporters to render their own new image using the
DC> full image size, and not reuse the current offscreen buffer.

    I think this is intentional in Squiggle. The goal is to save the
'current view' to disk.  However I could see how your mode might be
preferable in some cases (one would need to be very careful as if you
were zoomed in a lot the resultant file could be huge).

MM>   I'm evaluating Batik 1.5beta4b's Rasterizer utility but am
MM> encountering problems.  My goal is to generate a PDF from an image
MM> drawn inside Swing.  To that end, I'm using the SVGGraphics2D
MM> class to paint the component's contents and write image to an SVG
MM> file.  The resulting SVG file renders fine inside Internet
MM> Explorer and Squiggle.  However, when I try to convert the SVG
MM> file to anything (PDF, JPEG, whatever), only the top quarter
MM> (approximately) is Rasterized.?.?  I've tried passing in command
MM> line arguments such as:

MM>   % java org.apache.batik.apps.rasterizer.Main -m image/jpg -a
MM> 0,0,1000,1000 test.svg.  However, the same amount of image is
MM> captured.  Larger AOIs just seem to make the final result image
MM> smaller.  Has anyone ever encountered this?

    I suspect something is 'off' in the generated SVG, it would be
helpful to see the SVG document you are trying to rasterize.  I
suspect something in the viewbox or width/height attributes on the
outermost svg element, or a clip path is causing problems - but it
isn't clear why it would render fine in Squiggle but not with the '-a'
option in the rasterizer.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: incomplete rastorization?

Posted by Dave Carlson <dc...@ontogenics.com>.
Hi Mark,

I also wrestled with a similar problem last week.  Looking into the image export code from Squiggle, it seems that it uses the offscreen image from the current swing view to produce the exported image (in PNG or JPG).  If the entire image is not visible, it will not be saved to the image file.

I rewrote these exporters to render their own new image using the full image size, and not reuse the current offscreen buffer.

-- Dave Carlson

  ----- Original Message ----- 
  From: Mark Macbeth 
  To: batik-users@xml.apache.org 
  Sent: Monday, December 09, 2002 11:48 AM
  Subject: FW: incomplete rastorization?


  I'm evaluating Batik 1.5beta4b's Rasterizer utility but am encountering problems.  My goal is to generate a PDF from an image drawn inside Swing.  To that end, I'm using the SVGGraphics2D class to paint the component's contents and write image to an SVG file.  The resulting SVG file renders fine inside Internet Explorer and Squiggle.  However, when I try to convert the SVG file to anything (PDF, JPEG, whatever), only the top quarter (approximately) is Rasterized.?.?  I've tried passing in command line arguments such as:

  % java org.apache.batik.apps.rasterizer.Main -m image/jpg -a 0,0,1000,1000 test.svg.  However, the same amount of image is captured.  Larger AOIs just seem to make the final result image smaller.  Has anyone ever encountered this?