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
For some reason the following code has stopped working... .I am not sure if a change I made elsewhere could have had an effect on it so any help would be appreciated.
// to change measurement options for current style of "Distance" tool
// (currently this tool can have some different styles, like to any other commenting tool)
int curStyleID;
ctrl.GetProperty("Tools.Distance.Style", curStyleID);
string prefix = "Commenting.Distance.Styles[#" + curStyleID + "].Measure.Simple.";
ctrl.SetProperty(prefix + "FromValue", 1#);
ctrl.SetProperty(prefix + "FromUnit", "in");
...
// The same for "Area" and "Perimeter" tools...
Best
Regards.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
It would seem that the ability to have styles in the measuring tools has affected my code. The current ID seems like it is not accesable until a merasuring tool is selected. I have tried the code sample above with no result. No error and no change. Shouldn't I be able to preset the measuring values? It used to work fine...?
// ...
// ... change measurement for distance tool as in my previous post and if this tool is selected currently:
string activeToolName;
ctrl.GetProperty("Tools.Active", out activeToolName, PXCVA_GetNamed);
if (activeToolName == "Distance")
{
ctrl.SetProperty("Tools.Active", "Hand", 0);
ctrl.SetProperty("Tools.Active", activeToolName, 0);
};
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
I was able to work out that I could trap the event and set the scale at that time. My code originally set the scale at the time of loading a document which no longer seems possible.(?)
A few comments…
The lack of error msg threw me off. My old commands were accepted yet not executed. This is just an FYI. I appreciate the difficulty in finding every detail and just thought I would pass it along.
It would be helpful to preset the measuring scale at the time of loading. I have tried a few other optiond but none seem to work. Does the MeasureSetScale command do what I am looking for? The documentation is a little unclear.
And thank you for your comments. I am sure that the devs have taken them into account, and I will ask Vasyl to see if he has anything else to add to this topic