Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to draw rectangular position with mouse drag in PDF using javascript?

New Here ,
Aug 06, 2020 Aug 06, 2020

I want to get rectangular position with height & width on the mouse drag. 

Can I make below code more dynamic? For example, eRect value should be come from mouse drag and it position should not be hardcoded.   

 

var inch = 72;
var aRect = doc.getPageBox({ nPage: currentPage });
aRect[0] += 0.5 * inch; // from upper left hand corner of page.
aRect[2] = aRect[0] + 2 * inch; // Make it 2 inch wide
aRect[1] -= 0.5 * inch;
aRect[3] = aRect[1] - 0.5 * inch; // and 0.5 inch high
sigField = doc.addField("signature1", "signature", currentPage, aRect);

 

  

TOPICS
Acrobat SDK and JavaScript
720
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 06, 2020 Aug 06, 2020

Use Tools > Prepare Form and add the signature field with the mouse.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 06, 2020 Aug 06, 2020

My requirement is to place the new control based on mouse drag using javascript. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 06, 2020 Aug 06, 2020

May be not possible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 06, 2020 Aug 06, 2020
LATEST

No, it's not possible. The closest you can get to it is to use the mouse to mark the two opposite corners of the box (by clicking them) and then draw it. I've developed similar tools in the past so if you're interested I could help you set it up, for a fee.

You can contact me privately via [try6767 at gmail.com] to discuss it further.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines