Hi all,
This is probably a stupid question, but hopefully someone can help.
Is there a way to create a page from a selected object? For example, if I select a rectangle that forms the background of my image, can I create a page of the same size and in the same location? I used to use Inkscape, and it was very simple to do that.
I had to change my paper size and now my drawing does not align with the page. The drawing is very complex and I would rather not have to move it. If there is an easy way to realign the page, please let me know.
I hope that makes sense...I'm rather new to CorelDRAW.
i Had the same issue with corel....the crop tool, well doesnt do anything....It should resize the canvas to the selection you make....but its.....well doesn't work that way. (Or atleast that is what i thought)
It only work by resizing what you made (or cutting it). It doesnt change the canvas size)
To do so use the crop tool...3rd tool down and when you make the selection (like using the marquee tool) double click the selection. But the good thing is when you export the file (ctrl + e) you will not see the extra white areas. So that should do it.
If any more question let us know.
AlphaNiner said:It only work by resizing what you made (or cutting it). It doesnt change the canvas size)
Canvas...Sounds like you're coming from from Photoshop. Give it some time. I've seen many who make the switch. It takes a little while to get used to a vector app, but you should catch on soon.
Jennifer said: Is there a way to create a page from a selected object? For example, if I select a rectangle that forms the background of my image, can I create a page of the same size and in the same location? I used to use Inkscape, and it was very simple to do that. I had to change my paper size and now my drawing does not align with the page. The drawing is very complex and I would rather not have to move it. If there is an easy way to realign the page, please let me know.
Mabe this little macro will work for you. It will adjust page to selected items.
Option ExplicitSub fitCanvas() Dim s As Shape Dim w As Double, h As Double Set s = ActiveSelection If s.Shapes.Count = 0 Then MsgBox "Please make a selection" Exit Sub End If s.GetSize w, h ActivePage.SizeHeight = h ActivePage.SizeWidth = w ActiveDocument.ReferencePoint = cdrBottomLeft s.SetPosition 0, 0End Sub
-John
John
Thanks for sharing, a neat solution.Personally I use one of Os' (wOxxOm) macro, included in his TOOLS.package, for setting page size based on objects.It works perfectly (after a few 'trial and error' modifications) except for one thing; the page origin isn't reset after using the macro in X5.Do you know how to, or if it's even possible to, automatically reset the origin after 1. setting the page size with a user defined edge pad (dialog box), 2. display the page at a defined zoom level, centered?Your macro seems to move the objects, while Os' macro creates the page around the objects instead.
Hi Ronnie.
I don't exactly understand the first part of your question. The macro above does leave the page origin alone at the bottom corner.
You can change the origin by modifying the Document.DrawingOriginX (and Y) properties.
Here's an example from the help menu for it:
The DrawingOriginX property returns or specifies the horizontal drawing origin for the center of coordinates for the document relative to the center of the page. By default, the center of coordinates is set to the lower-left corner of a page.
The following VBA example moves the center of coordinates to the center of the page and creates a rectangle at this new center of coordinates. The center of coordinates is then moved back to the lower-left corner of the page, and an ellipse is created at this modified center of coordinates.
Ronny Axelsson said:2. display the page at a defined zoom level, centered?
This will zoom to all object and then zoom out. Is this what you mean?
Sub changeView() With ActiveDocument.ActiveWindow.ActiveView .ToFitAllObjects .ZoomOut End WithEnd Sub
Unfortunately I don't know anything about VBA, and the things I tweaked in Os' macro were simple things, all done via experiments and some logical thinking. Anyway, I managed to copy the vital parts from the help file example in your post, and add them to the end of the macro, before 'End Sub' and now it seems to work.
Basically, when executed it brings up a dialog where you enter the desired margin to the objects (all objects) and hit OK. The unit is automatically taken from the document and the default value can be set inside the code.When the page with the desired white space has been created, it automatically zooms to a predefined zoom level (inside the code).The missing part was that the page origin didn't get reset to lower left corner. No big deal but it can sometimes be of importance, and thanks to you I have now got it to work the way I want!Thank you. Much appreciated.
This was all I needed:
Dim d As DocumentSet d = ActiveDocumentd.DrawingOriginX = -d.ActivePage.SizeWidth / 2d.DrawingOriginY = -d.ActivePage.SizeHeight / 2
Hi Ronny,
you might remember this one - I have attached a macro which needs more features, but I am happy to do that extra work after ascertaining what people would like added to it. I can only think of one thing which I will mention shortly.
The macro simply swaps the positions of 2 images/shapes. Select 2 shapes on your page and click a button. The 2 images literally swap places. In case the 2 shapes are of different sizes you can choose which part of the images will be aligned. e.g. if you click the top left button then the top left of Shape 1 will move to where the top left of shape 2 was, and vice-versa. If you click the bottom right button then the bottom right of shape 1 will move to where the bottom right of shape 2 was, and vice-versa. There are 9 buttons for all alignment options. Pressing an alignment button twice will swap the shapes and then swap them back again. The Reset button puts the 2 swapped images back to their original positions in case you forget which started out where.
The only extra feature I can think of is a mirror feature which would make, for example, the top right of shape 1 go to where the top right of shape 2 was, but the top left of shape 2 will move to where the where the top left of shape 1 was. In this example I am imagining shape 1 was originally on the left and shape 2 on the right.
Please note that if the 2 images are equal in dimensions then it makes no difference which alignment button you click on, the images will simply switch places. An example of a use for this macro might be a situation where you are going to have 5 photos in a line in your design, but you have 10 photos to choose from. You have all 10 images off the page and move 5 possible images into position. You now to want to swap out some of the images with ones off the page. You may also want to switch the positions of 2 of the 5 already on the page.
Any suggestions are welcome.
Best regards,Brian.
Hi Brian.
This is very nice. I tried your first version but wasn't very fond of it, since it was a bit cumbersome and unintuitive.This one is much better; Select two object and click the button corresponding to what part to be aligned.May I suggest a "Quick swap" mode? Select two objects, execute, and they swap places centered.This is probably the most common alternative and personally I'd love to be able to do it quickly with just a shortcut key.What do you say?
can you try this one please? When you go to Tools>Customisation..........Macros, look for QuickSwap and drag that to your toolbar. It will give you a one-click swap using centres. If you look in the Macro Manager Docker you will see 2 entries now, SwapImage which gives the dialog box, and QuickSwap which is what I have just described.
One little tip: when you select more than one object on a page you get a slightly different Property Bar to when you have only one object selected. Therefore, if you select 2 objects on the page you can go then go into Customisation and place the macro button on the Property Bar in that state. This results in the macro button only appearing when you have more than one object selected on the page. In other words, it appears when you want it and not when you don't.
Please note I forgot to rename the file...so just replace the previous one with this new one in your GMS folder.
Best regards,