Copy link to clipboard
Copied
For example: I want to convert 0.162 to 0,162 and I want to do that for all numbers in my document. Do I have to use javascript for that?
Copy link to clipboard
Copied
Are the numbers something you can fill-in like a form? Or are they in an ordinary page? You cannot use JavaScript for ordinary text. There is no "replace all", and no way to recognise that these are part of numbers rather than between sentences.
Copy link to clipboard
Copied
OMG is that impossible?
Isn't there any option (ex.) to select a specific table that contains numbers and to convert their dots like doing Microsoft word?
Copy link to clipboard
Copied
Acrobat is NOT Microsoft Word and you will always be disappointed if you try to compare them. The editing in Acrobat is for fixing minor problems, it isn't a competitor to Word. PDF is very difficult to edit, it was not made for this. In fact, many people choose it BECAUSE it's hard to edit.
You could try Exporting to Word, editing, and remaking the PDF. Sometimes the results are OK, often not.
Copy link to clipboard
Copied
Alright I see thanks for your explanation. But I'm just asking, what is the javascript option in acrobat for? I thought everything is possible with correct script. It can be like "if the a dot is in between numbers replace it with a comma". Am I wrong?
Copy link to clipboard
Copied
E.g. with Javascript you can change the content of form text fields.
Copy link to clipboard
Copied
JavaScript was designed to work as part of form filling. For example, so that you can choose how many items to buy and it will calculate the price. Later, more functions were added, but it was never designed to be a tool for automating what you can do with Acrobat.
In C++, people can write plug-ins to do advanced editing. But a task like yours would still be very difficult, with detailed analysis of each piece of text, and possibly font issues to overcome.
Copy link to clipboard
Copied
> I thought everything is possible with correct script.
Absolutely not. JavaScript can't edit the static contents of a PDF file. The best it can do is remove them entirely (using Redaction) and then add new ones (by adding a field or a comment and then flattening it, for example), but that is a very inaccurate (and complicated) process. For one, if the length of the texts are not the same the new text will have to be resized to fit the area where the old text was, as the rest of the text can't be "re-flowed". In addition, JS can't know what font was used or what color, so that has to be hard-coded into it. The height can be more or less calculated, but that's about it.
Copy link to clipboard
Copied
Don't you think that even such a simple issue has such a difficult solution is an indication that we are pretty far behind in programming today?
Copy link to clipboard
Copied
No, like many PDF difficulties I see it as a problem of expectation. But we cannot resolve your impractical problems by debate...
Copy link to clipboard
Copied
Beyond solving the problem, I'm trying to understand what is possible and what is not in the programming world and as far as I understand there are remarkable unsolvable and unanswerable restrictions and impossibilities.
Copy link to clipboard
Copied
You can solve it, if you spend enough time, effort and money on the solution.
Copy link to clipboard
Copied
No, not really. It's more an issue of what people think a PDF is, versus what it really is. You need to think of creating a PDF file as printing out your document. How would you go about making this kind of change on a printed page? You would need to manually scan it for all the numbers, and when you find one carefully cut out the period, and replace it with another cut out of a comma of the same size, font, color, etc., and then repeat this process over and over. This might sound easy, but what if you needed to replace "Apple" with "Pineapple", or with "A fruit of your choosing"? How would you go about doing that?
And a PDF file is much more complex than a printed page. It is constructed according to a highly-complex instructions manual of around 1000 pages... So once a PDF file is created you should mostly use it to add comments (highlights, sticky notes, pencil scribbles, etc.) or form fields, but editing the underlying static contents is not a good idea. The fact you can even do it to the extent that you can is a small miracle.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now