Clip view to only the page?

Post questions on how to use or achieve an effect in Inkscape.
mortoray
Posts: 6
Joined: Fri Jan 25, 2013 5:38 am

Clip view to only the page?

Postby mortoray » Thu Jan 17, 2019 7:18 pm

Is there a quick way to clip the current view to show only what's on the page (the part within the dimensions set in the document)?

I usually end up creating an Overlay layer, but it's a bit of work and size finagling to get right. I'm hoping there's an easier way to do this.

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Clip view to only the page?

Postby Polygon » Thu Jan 17, 2019 8:43 pm

Seems not implemented like in other vector editors as far as I can tell. Easiest way might be to export page to PNG - that´s at least precise.

Cheers

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

Re: Clip view to only the page?

Postby Moini » Fri Jan 18, 2019 9:02 am

I do the same as mortoray. Getting the size right is actually really easy.

Activate snapping to the page and to sharp corners, and create a rectangle that covers the page by snapping the rectangle tool to the page cornes.
Draw another, much larger rectangle.
Lower that.
Do Path > Difference with both.
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)

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Clip view to only the page?

Postby Lazur » Fri Jan 18, 2019 9:36 am

The overlaying layer seems a reasonable and easy solution.
Although if that's not sleek enough, you might want to cheat a bit more.

So you want to clip the document to a certain area? Clip the parent layer. Define the clip object in the defs section.
Don't want to clip it anymore?
Make the clipping part of the codes into comments by adding "!" marks before.
Theoretically doable yet needs testing. Have doubts if the xml editor in inkscape could display comments so maybe another solution would be more sufficient.
Instead of clipping, let's try masking.
If the masking object is white, all is showing. If part is black, the image is not rendered.
Then you'd need to define a large enough mask object in the defs you can access in the xml editor and change the outside of the page area to be black easily. Sounds more doable yet less prone to function right -exporting has hardly any support when saving as pdf so then your work is quite limited.


Another way of cheating would be cloning all of the parent layer's content and putting that on a new layer. Clip that new layer and switch off the rest.
Preferably put all the original object into one layer, so you can switch those off by one click, while switching the clipped clone layer's visibility on.


Yet another option could be applying a custom filter to the parent layer, which also needs to be set up specially to the page size.
If you are changing the document size, you need to edit the filter.
Another quirk could be performace issue and again, saving as pdf (which'd need to rasterize the filter effect or you couldn't benefit from using filters in your image at all).


tl;dr: Your solution may sound crude but is straightforward and the most easy to pull off.

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

Re: Clip view to only the page?

Postby brynn » Fri Jan 18, 2019 9:49 am

The zoom tool has a zoom to fit page button, on the control bar. But it doesn't hide everything. It only can fit one dimension of the page.

I've done the same thing in the past. I just draw my own sort of picture frame to fit the page border.

Doesn't Inkscape have something built in for this? I've heard about it, but I don't really know how to use it. I think it's called Inkview ?? I've seen references to it on the mailing list, but I've never understood the message threads (too technical for me). If you look in the program files, there's inkview.exe. I've tried opening it, but nothing happens....

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

Re: Clip view to only the page?

Postby Moini » Fri Jan 18, 2019 9:54 am

Offtopic: brynn, as you seem to read the forums, but not all the tags from gitlab or the chat: can you help with doing your announcements for the new versions?
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)

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Clip view to only the page?

Postby Lazur » Fri Jan 18, 2019 9:57 am

Moini wrote:Offtopic: brynn, as you seem to read the forums, but not all the tags from gitlab or the chat: can you help with doing your announcements for the new versions?


Off topic:
Oh I'd also need to take some actions.

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

Re: Clip view to only the page?

Postby brynn » Fri Jan 18, 2019 10:00 am

Uumm, sure. I've been offline for the last day or so. Haven't checked my email yet today. Will get there shortly.

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

Re: Clip view to only the page?

Postby Moini » Fri Jan 18, 2019 10:12 am

Offtopic: Thanks, you two!
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)


Return to “Help with using Inkscape”