You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default Project#exportSVG() exports the SVG content exactly the way it is seen in the current view, including the view's size, scroll and zoom factor. This is not always the desired behavior.
I'd like to propose to implement these additional features:
options.bounds:
'view': the current behavior, and the default.
'content': the strokeBounds of the project content (all layers)
Rectangle: a rectangle specifying the bounding box to be used in the SVG output, in project coordinates.
null: When explicitly set to null, no bounds are used, the SVG contains now size information.
options.matrix:
When nothing is specified and options.bounds is 'view', the view's transformation matrix reflecting, zooming and scrolling is used.
When it is set to a matrix, this matrix is used to transform the exported content.
When nothing is set, and options.bounds is not 'view', no additional transformations are applied.
Does this naming make sense? Is anything missing?
The text was updated successfully, but these errors were encountered:
var boundsArtboard = new Rectangle({x:10,y:10, width:100, height:100});
var svg = paper.project.exportSVG({asString:true,precision: 5, bounds:boundsArtboard});
When I view the exported SVG in a web browser it appears correctly. However, if I open this SVG file in Illustrator, the SVG file contains all objects that exist on that currently layer. See attached SVG image example. How do I just export the objects in the bounds and not everything on the layer? Thanks
By default
Project#exportSVG()
exports the SVG content exactly the way it is seen in the current view, including the view's size, scroll and zoom factor. This is not always the desired behavior.I'd like to propose to implement these additional features:
options.bounds
:'view'
: the current behavior, and the default.'content'
: the strokeBounds of the project content (all layers)Rectangle
: a rectangle specifying the bounding box to be used in the SVG output, in project coordinates.null
: When explicitly set tonull
, no bounds are used, the SVG contains now size information.options.matrix
:options.bounds
is'view'
, the view's transformation matrix reflecting, zooming and scrolling is used.matrix
, this matrix is used to transform the exported content.options.bounds
is not'view'
, no additional transformations are applied.Does this naming make sense? Is anything missing?
The text was updated successfully, but these errors were encountered: