A rectangle to crop

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

A rectangle to crop

Post by relapse »

How could I get a rectangle of a certain size drawn on the program start to crop it later.
selection.zip
What object is it? A crop box?
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: A rectangle to crop

Post by Stefan - PDF-XChange »

Hello relapse,

The shot you have attached appears like a regular rectangle that you can add with the respective tool.

If you want to actually crop a page's content and make only portion of it visible - then please check the Document -> Crop Pages options in our Viewer.

Best,
Stefan
relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Re: A rectangle to crop

Post by relapse »

OK, I've found the following code in the program which sets some of the rect properties:

Code: Select all

            ctrl.SetProperty("Commenting.Rect.Styles[0].FColor", 0);
            ctrl.SetProperty("Commenting.Rect.Styles[0].Opacity", 0.4);
            ctrl.SetProperty("Tools.Rect.KeepSelected", false.ToString());
            ctrl.SetProperty("Tools.Active", "Rect");
But how can I set the size of that rect?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: A rectangle to crop

Post by Stefan - PDF-XChange »

Hello relapse,

I believe it will be much easier if you create the rectangle using JS.

E.g.

Code: Select all

var annot = this.addAnnot({
page: 0,
type: "Square",
author: "Your Name",
name: "myStamp",
rect: [200, 200, 350, 350]})
For samples how to execute JS in our Viewer AX please refer to the samples provided with the AX.

Best,
Stefan