Change document rendering size without touching my objects?

Post questions on how to use or achieve an effect in Inkscape.
FriendFX
Posts: 3
Joined: Tue Mar 17, 2009 2:54 am

Change document rendering size without touching my objects?

Postby FriendFX » Tue Mar 17, 2009 3:08 am

Hello,

I've created a document to upload to a MediaWiki page. This works fine - the MediaWiki engine puts a rasterised version of the SVG on the page where the image is embedded - but this rasterised version is too large.

How can I tell the interpreter program of the SVG file what resolution should be used to render the SVG?

Of course, I could go to the document properties and enter a new (smaller) size for the page boundaries, but this would change the size (and position) of my objects on the page and in relation to the raster.

Is there a way to enter something like a "global zoom" parameter or change the DPI of a whole document?

SureWhyNot
Posts: 137
Joined: Mon Jun 16, 2008 11:37 pm
Location: United States

Re: Change document rendering size without touching my objects?

Postby SureWhyNot » Tue Mar 17, 2009 1:52 pm

Instead of saving your document as an SVG and having another application convert it, you could export a PNG file directly from Inkscape. Just goto file->export bitmap. You will get a dialog with a bunch of options for sizing your document.

FriendFX
Posts: 3
Joined: Tue Mar 17, 2009 2:54 am

Re: Change document rendering size without touching my objects?

Postby FriendFX » Tue Mar 17, 2009 11:50 pm

Thanks for your reply.

At the company I work for, we use the following method to create and maintain such images:
- We create a SVG and upload it into the MediaWiki, so it's saved and backed up there.
- Therefore, the "local copy" of the document is deleted.
- The MediaWiki converts the SVG to a PNG for browsers not capable of displaying SVGs directly.
- But by clicking on the PNG, one can always open the SVG directly, print it at arbitrary resolution and, most importantly,
- can edit the SVG directly with inkscape and upload the new version of the document.

If you're interrested, you can see this in action on the following Wikipedia page
http://en.wikipedia.org/wiki/Scalable_Vector_Graphics

Inkscape is great for us because we can create SVGs directly, upload it to the MediaWiki where they get displayed (maybe converted on-the-fly) and are still able to edit the original file without having to always maintain one rasterized and one original document per image.

If I am correct, there must be some size or DPI info embedded into the SVG because where else from should other SVG interpreters (e.g. Firefox) know how large the drawing should be... but until now, I haven't found such a parameter in inkscape.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Change document rendering size without touching my objects?

Postby microUgly » Thu Mar 19, 2009 7:13 pm

FriendFX wrote:Is there a way to enter something like a "global zoom" parameter or change the DPI of a whole document?

Not through the Inkscape interface. I think you'll need to select all objects in your drawing and scale down to the size you want. I think perhaps you can manually edit the XML to scale your drawing, but I don't know the exact property to edit.

FriendFX
Posts: 3
Joined: Tue Mar 17, 2009 2:54 am

Re: Change document rendering size without touching my objects?

Postby FriendFX » Mon Mar 23, 2009 7:26 pm

I think perhaps you can manually edit the XML to scale your drawing


Thanks for the hint, I am able to scale the whole document by inserting an attribute like transform="scale(0.75)" at the <g> element.

Of course, then the grid and the pixel raster stay the same so I would have to insert this attribute everytime I want to publish my document and remove the attribute again when I want to edit it with inkscape. Not very convenient, but at least a workaround for now.

I have also found some developer discussions about the coordinate system and real-world units on the inkscape website which could be the sign that there is something going on around this topic.


Return to “Help with using Inkscape”