Page 1 of 1
Tool: Override dimension text
Posted: Sat Sep 23, 2023 2:11 am
by Mathew
Often I want to put my own text into a dimension line, or adjust the number for markups. I don't think PDF-XCE allows one to edit it directly (?) I'm not sure if there's another way, but here's a tool I use to change it.
I also added two options:
- option to try to scale the dimension to the entered dimension. It generally works fine with imperial ft-in dimensions also. So if the dimension is 1.487m and you want it to read 1.5m it can adjust the length of the dimension so that it is actually 1.5m (scaled);
- option to change the text color to the same color as the dimension lines
image.png
image(1).png
It adds a toolbar button to the Add-on Tools. In the ribbon UI it adds a button at the end of the measuring tools in the Comment ribbon, in the classic UI it adds a menu item "Dim Override…" to "Add-in Tools" in the Tools menu.
Extract the zip and save in the Javascripts folder either in the application folder, or in %APPDATA%\Tracker Software\PDFXEditor\3.0\Javascripts
dimText v1.3.zip
Note that if you stretch the dimension, then PDF-XChange will override your text.
Translations
This tool is translatable with 1ang.js. Currently I only have machine translation to German in the translation file. The
tool posted here will help adding translations if you want to add a language

. Here's the translation file and 1ang.js - save both in the Javascripts folder:
translationData.dimText.json.zip
Re: Tool: Override dimension text
Posted: Mon Sep 25, 2023 9:49 am
by Stefan - PDF-XChange
Hello Mathew,
In the past it was possible to e.g. double click the measurement of the dimension line, and then change the text in the pop-up bubble.
This was causing some problems - so now you can have a "Label" on top of the actual measurement:
image.png
However you can not remove/hide the measurement itself with just the UI.
So many thanks for sharing your tool!
Kind regards,
Stefan
Re: Tool: Override dimension text
Posted: Wed Aug 07, 2024 5:43 pm
by Mathew
I made a few updates to this tool:
- I changed the icon to 40x40 so it shows a bit better on the ribbon UI
- It's now translatable with the 1ang function (I've pasted the translation strings below) on the domain 'dimText'
- I added an option to scale the dimension. This is useful to round off a dimension if measuring gets some small fractions on it:
image.png
so that instead of overriding the text, it actually changes the dimension length to read the entered dimension:
image(1).png
and the measured distance is correct:
image(2).png
DimText v1.0.zip
Re: Tool: Override dimension text
Posted: Wed Aug 07, 2024 5:54 pm
by Mathew
These are the translatable strings in case anyone wants to. See post about 1ang for more info:
viewtopic.php?p=182242#p182242
Code: Select all
{
"": {
"Dimension Text Override…\n────────────────────────\nOverride the dimension text on a dimension.": "",
"Dim Override…": "",
"Change Dimension Text": "",
"Elements to change:": "",
"Current Selection": "",
"All dimension lines on this page": "",
"Change text: ": "",
"Try to scale the dimension": "",
"Change text color to match line color": "",
"Nothing Selected": ""
}
}
Tool: Override dimension text
Posted: Wed Aug 07, 2024 10:45 pm
by Daniel - PDF-XChange
Re: Tool: Override dimension text
Posted: Tue Dec 24, 2024 5:57 pm
by Mathew
I fixed some bugs and added to the ribbon UI at the end of the measuring tools under Comment:
image.png
dimText v1.1.zip
Changes in v1.1
- Fix regex to deal properly with fraction ft in (ie 4ft 1/8in),
- fix lint errors,
- add to ribbon UI
Re: Tool: Override dimension text
Posted: Tue Dec 24, 2024 8:47 pm
by Daniel - PDF-XChange
Hello, Mathew
Glad to see it, we appreciate you tackling some of these features (Especially ones like this, which "kind of sort of" break the specification, and we could not offer if we wanted to).
Kind regards,
Re: Tool: Override dimension text
Posted: Sat Jan 11, 2025 12:29 pm
by PDFan
Hello Mathew,
thank you for developing this tool! It's exactly that what I have been looking for. Especially the option to scale the dimension is very useful. But unfortunately this option doesn’t work on my computer (Windows 10, German version) as you described above. For example, I have a dimension with length 3.94 m. Then I apply this tool to change it to 4 m and choose the option “Try to scale the dimension”. After this I get a changed text “4 m”, but the actual length of the dimension is not adjusted to 4 m, but something different, as following images show. The adjusted length is not the same each time even for the same original length. What could be the reason?
Thanks for helping!
001.png
002.png
Re: Tool: Override dimension text
Posted: Sun Jan 12, 2025 12:38 am
by Mathew
[edit] I found the issue: German uses commas instead of period, so javascript was rounding off the number 3,94 to 3. I've posted a fix below.
I suspect I messed something up in the code. I'll investigate and post a fix here.
Re: Tool: Override dimension text
Posted: Sun Jan 12, 2025 2:32 am
by Mathew
Here's an update that fixes an issue when commas are used as decimal points.
dimText v1.2.zip
This tool is also translateable using the domain 'dimText'. I've not included the translation files in the zip, but the strings and a link to the process:
viewtopic.php?p=182689#p182689
For example, If you have German set as the default language in pdf xchange:
I used google translate to translate the text strings posted above into German. Save the following as a text file with the name 'translationData.dimText.json' into the javascripts folder, and also save the 1ang.js file in the javascripts folder ( from here:
viewtopic.php?t=43253)
Code: Select all
{
"": {
"Dimension Text Override…\n────────────────────────\nOverride the dimension text on a dimension.": "",
"Dim Override…": "",
"Change Dimension Text": "",
"Elements to change:": "",
"Current Selection": "",
"All dimension lines on this page": "",
"Change text: ": "",
"Try to scale the dimension": "",
"Change text color to match line color": "",
"Nothing Selected": ""
},
"DEU": {
"Dimension Text Override…\n────────────────────────\nOverride the dimension text on a dimension.": "Bemaßungstext überschreiben…\n────────────────────────\nDen Bemaßungstext einer Bemaßung überschreiben.",
"Dim Override…": "Bemaßungstext überschreiben…",
"Change Dimension Text": "Bemaßungstext ändern",
"Elements to change:": "Zu ändernde Elemente:",
"Current Selection": "Aktuelle Auswahl",
"All dimension lines on this page": "Alle Bemaßungslinien auf dieser Seite",
"Change text: ": "Text ändern: ",
"Try to scale the dimension": "Versuchen Sie, die Bemaßung zu skalieren",
"Change text color to match line color": "Textfarbe so ändern, dass sie der Linienfarbe entspricht",
"Nothing Selected": "Nichts ausgewählt"
}
}
Re: Tool: Override dimension text
Posted: Sun Jan 12, 2025 11:10 am
by PDFan
Hello Mathew,
now both the option to scale the dimension and the German language file work perfectly. Thank you very much for the prompt help!
Kind regards
Tool: Override dimension text
Posted: Mon Jan 13, 2025 12:54 pm
by Stefan - PDF-XChange
Re: Tool: Override dimension text
Posted: Mon Jan 13, 2025 6:24 pm
by Mathew
@PDFan You're the first person I know of who's used the language function
PDFan wrote: ↑Sun Jan 12, 2025 11:10 am
.. and the German language file work perfectly.
Re: Tool: Override dimension text
Posted: Mon Jan 13, 2025 8:49 pm
by PDFan
wow!
glad to be the first one
005.png
Mathew wrote: ↑Mon Jan 13, 2025 6:24 pm
@PDFan You're the first person I know of who's used the language function
PDFan wrote: ↑Sun Jan 12, 2025 11:10 am
.. and the German language file work perfectly.
Re: Tool: Override dimension text
Posted: Wed Apr 09, 2025 11:36 pm
by Mathew
If a dimension had a Label, then the tool was not getting or setting the dimension text properly. Fixed in v1.3.
dimText v1.3.zip
Tool: Override dimension text
Posted: Thu Apr 10, 2025 3:22 pm
by Stefan - PDF-XChange