I have implemented to reset scale on pagecomplete or documentload event to 1cm = 1cm (Customize Measurement Tools for PDF.js Express | Documentation). But it looks like the scale resetting on zoom or move screen with hand symbol. I don’t want to happen this on zoom or move, once set the scale that should stay until user change it again (but on first load it should reset as i did already). It shouldn’t change on zoom or move
also i set calibration box to be visible when adding line annotation, but it is showing on each page load now, this should appear only when i draw a line using scale
Expected behaviour
{Provide a screenshot or description of the expected behaviour}
Does your issue happen with every document, or just one?
{Answer here}
Link to document
{Provide a link to the document in question if possible}
const distanceMeasurementTool = documentViewer.getTool('AnnotationCreateDistanceMeasurement');
distanceMeasurementTool.setStyles(() => ({
// value of Scale is an array that is consisted of two arrays
// the first element in each array is the scale ratio and the second element is the unit.
// valid units are: mm, cm, m, km, mi, yd, ft, in and pt
// the following array means that for the annotations created by the distance measurement tool, 0.25 inches on the document is equal to 1 inch in the real world
Scale: [[1, 'cm'], [1, 'cm']],
// value of Precision is a number that means how many decimal places the calculated value should have
Precision: 0.001
}));
The measurement tool’s scale is still the same after zooming/scrolling:
On documentLoad or pagecomplete am setting the scale 1cm=1cm. Then i have used calibration and changed scale to 5cm = 5in … this is resetting to 1cm=1cm whenever i zoom/scroll … I want it to stay 5cm = 5in until I change it again on scale
I made a rectangle annotation and am on the tools panel (rectangle tool selected), but when I move mouse over to the drawn rectangle annotation cursor automatically changing to handle symbol and allowing me to select the rectangle. I need to restrict it, so that if I want to select an annotation I need to choose either select or pan tool from the top section
I think readonly is not option as I wanted to draw other annotations… currently when i move mouse to corner of an already drawn annotation its automatically change to selection. So am not able to start drawing next annoation from there
This is not resolving the issue as when we move mouse near to a drawn annotation still switching to hand . So we are not able to draw new annotation from there