Change text position using javascript

Community Beginner ,
Nov 02, 2020 Nov 02, 2020

Copy link to clipboard

Copied

Hello,

 

I would like to change x and y text position using javascript.

Clicking on a button, I would like to set x/y pos of differents text elements presents on my PDF.

Do you have a way to do it, I can't find any solution.

Thanks!!

TOPICS
Acrobat SDK and JavaScript

Views

87

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Nov 02, 2020 Nov 02, 2020

Copy link to clipboard

Copied

Position of form fields or comments?

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Nov 02, 2020 Nov 02, 2020

Copy link to clipboard

Copied

The only way to do this is if the text is in a form field or annotation.

You can find scripting info on doing this here:

https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

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 Beginner ,
Nov 03, 2020 Nov 03, 2020

Copy link to clipboard

Copied

Thank you for your answers. I was not specific enough indeed.

I has a form text element in my PDF.

I would like to change it's position using javascript. Example :
myTextFormField.setxpos = 100;

myTextFormField.setypos = 100;

=> I know this os not the good code 🙂 Just for the example.

 

@Thom Parker  :

I'm going to read it thanks but not sur this is my need 🙂

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Nov 03, 2020 Nov 03, 2020

Copy link to clipboard

Copied

LATEST

If it is a text field that is being moved, then the article is exactly what you need. You'll also find a free example that shows how to move fields here:

https://www.pdfscripting.com/public/Free-Sample-PDF-Files-with-scripts.cfm

 

Look at the "Bouncing Button" and "Swat the Fly" example files. 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

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