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

line above the text box

Explorer ,
Nov 28, 2023 Nov 28, 2023

Hello, I would like to make the price crossed out in the text field (example below; Adobe Acrobat Pro). Unfortunately, the line hides under this field, which has a white fill. How can I get it to be over?

 

Katarzyna31553090gbjo_0-1701176427382.png

 

TOPICS
PDF forms
4.3K
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
1 ACCEPTED SOLUTION
Community Expert ,
Dec 01, 2023 Dec 01, 2023

Here is a simple workaround using image field, try and see if it's working for you.

https://drive.google.com/file/d/1Oc_i7S_7DWiCmEqQ6jaPEQULKGqawTVI/view?usp=sharing 

View solution in original post

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 ,
Nov 28, 2023 Nov 28, 2023

You can't, at least not reliably.  The only way to do this is for the price to either be in the page content, or for you to create a custom annotation that includes both the price value and the red line. 

 

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

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
Explorer ,
Nov 28, 2023 Nov 28, 2023

Prices in the text boxes should be editable, sellers in the store will enter prices there themselves. So, the prices can't be on the page content/page background.

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 ,
Nov 29, 2023 Nov 29, 2023

TThe strikethrough is a commenting annotation. It cannot be used to reliably cover a form field.

 

The only option for creating a price with a line through it is to use a combined commenting annotation. A text box combined with a line annot. Commenting annotations can be grouped, made readonly, and locked. So after the price is  entered it  can't be changed or moved (manually on the page), and the line will stay on top. 

The text value can be changed from the commenting window. 

 

 

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

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
Explorer ,
Nov 29, 2023 Nov 29, 2023

So, if understand it well, a store employee who only uses free PDF reading software will not be able to edit the price?

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 ,
Nov 30, 2023 Nov 30, 2023

No, they should be able to set it. Commenting annotations can be added and modified in the free Reader.  

 

 

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

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
Adobe Employee ,
Nov 28, 2023 Nov 28, 2023

++ Adding to the discussion

 

Please go through the help article https://www.adobe.com/acrobat/hub/how-to-use-strikethrough-on-a-pdf-file.html and see if that helps.

 

~Amal

 

 

Regards
Amal
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
Explorer ,
Nov 28, 2023 Nov 28, 2023

Unfortunately it doesn't work... Prices are in the text boxes (they should be editable, sellers in the store will enter prices there themselves) and apparently this tool doesn't work on text boxes.

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 ,
Nov 28, 2023 Nov 28, 2023

Hi @Katarzyna31553090gbjo ,

 

Do you mid sharing that PDFfile?

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
Explorer ,
Nov 28, 2023 Nov 28, 2023

Here is the file. Both prices should be editable, so that's why I used text boxes (sellers in the store will enter prices there themselves). 

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 ,
Nov 30, 2023 Nov 30, 2023

Hi,

If you remove the background of both fields and create a white rectangle stamp, you can do something close to what you want...

Capture d’écran 2023-12-01 à 02.27.35.png

@+

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
Explorer ,
Nov 30, 2023 Nov 30, 2023

yes, I did it in different file but unfortunately this is not something that satisfies me... And in the future I may need to cross out prices on various backgrounds.

Katarzyna31553090gbjo_0-1701415198393.png

 

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
Explorer ,
Nov 30, 2023 Nov 30, 2023

But thank you for your help! Really appreciate. Thnx!

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 ,
Dec 01, 2023 Dec 01, 2023

Hi,

I don't have the right font here, but you could replace the price field by a text box annotation where you can modify the text font and color and the color of the background to be the same as the rectagle stamp.

Capture_d’écran_2023-12-01_à_14_17_07.png

and the result (with a wrong font):

Capture d’écran 2023-12-01 à 14.13.22.png

and you can modify the price directly from the annotation window.

Capture_d’écran_2023-12-01_à_14_24_28.png

@+

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
Explorer ,
Dec 01, 2023 Dec 01, 2023

Maestro!!! It looks like it should look like. 

The only small problem is that this field does not anchor, I can move it anywhere, and sellers cannot be allowed to do so, because they will soon "destroy" the layout of the entire label.

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 ,
Dec 01, 2023 Dec 01, 2023

Commenting annotations cannot reliably cover a form field, but they can cover another comment annotation. 

In the example below, a text annotation is covered with a line annotation. Both are locked, so they can't be moved by the user. But the price can be changed from either the commenting panel, or as try67 mentioned, from a script that could be written specifically for this purpose. The script could be activated from a control panel page in the same pdf. 

 

Combined Annot used as strikout.jpg

 

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

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 ,
Dec 02, 2023 Dec 02, 2023

Hi,

Nesa's answer is correct, simple and seems to suit you.
As it is said, the annotation text box can be blocked, but it must be unblocked to be able to change the price or do it via a scrpt.
To finish with my version with annotations, and for those who are interested, I suggest to you a transparent button placed above the "QUICK STEP" sign.

Capture_d’écran_2023-12-02_à_09_27_08.png
A script is executed when you press this button and brings up a dialog box where you can only indicate a price, different from the one already indicated, then replaces the price displayed without having to unlock the annotation block.

Capture d’écran 2023-12-02 à 09.27.24.png

Here is the script ran:

 

this.syncAnnotScan();
var annots=this.getAnnots();
if (annots!=null) {
	for (var i=0; i<annots.length; i++) {
		if (annots[i].type=="FreeText") {
			var price=annots[i].contents;
			while (price==annots[i].contents || isNaN(price.toString().replace(/[,]/,"."))) {
				var price=app.response({
					cQuestion: "What is the new price?",
					cTitle: "PRICE",
					cLabel: "New Price:",
					cDefault: annots[i].contents
				});
			}
			annots[i].delay=true;
			var textAttributs=annots[i].richContents;
			var spans=new Array();
			spans[0]=new Object();
			spans[0].alignment=textAttributs[0].alignment;
			spans[0].fontFamily=textAttributs[0].fontFamily;
			spans[0].fontStretch=textAttributs[0].fontStretch;
			spans[0].fontStyle=textAttributs[0].fontStyle;
			spans[0].fontWeight=textAttributs[0].fontWeight;
			spans[0].strikethrough=textAttributs[0].strikethrough;
			spans[0].subscript=textAttributs[0].subscript;
			spans[0].text=price;
			spans[0].textColor=textAttributs[0].textColor;
			spans[0].textSize=textAttributs[0].textSize;
			spans[0].underline=textAttributs[0].underline;
			annots[i].richContents=spans;
			annots[i].delay=false;
		}
	}
}

 

This script assumes that there is only one text box but can be adapted if there are several ones. All text attributes are re-placed but in your case you don't need all of them...

 

Why make it simple when you can make it complicated ! 🙂

@+

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 ,
Nov 29, 2023 Nov 29, 2023

As mentioned, it can only be done using annotations, so the user will have to enter the amount indirectly.

 

I can create for you a script that will allow you to achieve that, if you're interested, for a fee.

You can contact me privately by clicking my user-name and then on "Send a Message" 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
Community Expert ,
Dec 01, 2023 Dec 01, 2023

Here is a simple workaround using image field, try and see if it's working for you.

https://drive.google.com/file/d/1Oc_i7S_7DWiCmEqQ6jaPEQULKGqawTVI/view?usp=sharing 

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
Explorer ,
Dec 04, 2023 Dec 04, 2023

Hi, looks ok, but in my opinion image field makes difficult to edit the price. Every time when I click on price it image field with red line which opens (properties box). Only way to edit the price is via the commenting panel. For me it's ok, but the sellers need to be trained to use this type of file. For them it will be something new 🙂 

Thank you for your help!

 

 

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
Explorer ,
Dec 04, 2023 Dec 04, 2023
LATEST

Tryied once again and I can edit the price directly. It works! Thank you!

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