Display Image Only

Post about projects that use Inkscape for web design.
Ged
Posts: 40
Joined: Wed Sep 16, 2015 3:01 pm

Display Image Only

Postby Ged » Fri Mar 18, 2016 6:59 pm

When I create an image, and copy the SVG code into my web page, it creates an image of the entire A4 page - not just the image. I first noticed by the large 'white' area and the need to 'scroll' after uploading. So I looked at my SVG code and noticed the size was indeed that of an A4 page. (297*210)

I dont want this. How do I select the code so that it displays the image only?

User avatar
brynn
Posts: 9541
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Display Image Only

Postby brynn » Fri Mar 18, 2016 7:57 pm

Ctrl + a (select all)
Document Properties > Page tab > Custom Size > Resize Page to Content
Save

You can add a margin if you want one, but to make the page fit the drawing precisely, leave margin fields at zero.

Moini
Posts: 2057
Joined: Mon Oct 05, 2015 10:44 am

Re: Display Image Only

Postby Moini » Fri Mar 18, 2016 10:13 pm

(The Ctrl+A isn't even necessary)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Ged
Posts: 40
Joined: Wed Sep 16, 2015 3:01 pm

Re: Display Image Only

Postby Ged » Sat Mar 19, 2016 4:06 am

Thanks for that.

If my Inkscape page has several images, I presume that the entire page is saved as one SVG file, and the selected portion be saved as another SVG file. If so, would it be an improvement idea to add a 'save image as' button in Document Properties, then the size default back to its page size?

Or am I missing something?

User avatar
brynn
Posts: 9541
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Display Image Only

Postby brynn » Sat Mar 19, 2016 7:51 am

Ged wrote:Thanks for that.

If my Inkscape page has several images, I presume that the entire page is saved as one SVG file, and the selected portion be saved as another SVG file. If so, would it be an improvement idea to add a 'save image as' button in Document Properties, then the size default back to its page size?

Or am I missing something?


I'm not quite sure what you're thinking. But no, it's all the same SVG file. Resize Page to Content simply changes the page border to fit the drawing (or the selected part of the drawing).

Moini's correct, that you don't really have to do Select All, in your case. That's a leftover step from a previous version when you did have to select the part you wanted. (old habits....) However, if for example, you only wanted one of the images on the page to be showing on the webpage, you would select only that image, and then click the same Resize Page to Content button. The other drawings would still be in that file, but they will be outside the page border. (Try it!)

Ged
Posts: 40
Joined: Wed Sep 16, 2015 3:01 pm

Re: Display Image Only

Postby Ged » Sat Mar 19, 2016 7:56 am

Ah, got it. :idea:


Return to “Inkscape & the Web”

Who is online

Users browsing this forum: No registered users and 1 guest