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

Error message trying to justify text in Acrobat

Participant ,
Sep 07, 2021 Sep 07, 2021

Copy link to clipboard

Copied

Hello everyone,

 

I´m trying to justify a text, and I´m using the inverted slashes to escape the inverted commas inside the text, but still, the debugger keeps saying I have a problem of "unterminated string".

Can you please take a look and tell me what I may have done wrong, because for me everything seems OK.

Here is a picture of part of the text. The problematic part is highlighted.

andres45888027_0-1631033876603.png

Thanks you very much in advance!

TOPICS
Create PDFs , JavaScript , PDF forms

Views

404

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 Expert ,
Sep 07, 2021 Sep 07, 2021

Copy link to clipboard

Copied

Please post the entire script, not just a portion. 

Votes

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
Participant ,
Sep 07, 2021 Sep 07, 2021

Copy link to clipboard

Copied

This is the full script:

 

var spans = [{

alignment: "justify",

fontFamily: ["MouseMemoirs"],

fontStyle: "normal",

fontWeight: 100,

text: "The energy giant Royal Dutch Shell has announced it has passed its peak
production of oil. The days of increasing oil production are over and the
decline in output has started. Shell said in a press release that, \"+oil
production peaked in 2019+\". The \"+high point+\" of Shell+\'+s oil production
reached around 1.7 million barrels per day. It now expects an annual
drop of up to two per cent per year. The fall comes a year ahead of
Shell+\'+s initial forecasts. In 2015, the company predicted the peak of
global oil demand would be in 2020. The announcement included news
that Shell would reduce the number of its oil refineries from 14 sites to
six. This means the loss of around 9,000 jobs, or more than 10 per cent
of its workforce.
Shell said it is shifting its focus onto renewables and reducing its carbon
footprint. It pledged to achieve net-zero carbon emissions by 2050. The
company said it wants to diversify into becoming an energy provider
rather than relying on fossil fuels. It has been actively exploring new,
green technologies such as carbon capture. It has also been buying
companies that provide electric vehicle charging stations. Shell CEO Ben
van Beurden vowed to create half a million EV charging points by 2025.
He said: \"We must give our customers the products and services they
want - products that have the lowest environmental impact. We
will...grow in markets where demand for cleaner products and services is
strongest.\"",

textColor: ["RGB", 0, 0, 0],

textSize: 18

}]

this.getField("Texto1").richValue = spans;

Votes

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 Expert ,
Sep 07, 2021 Sep 07, 2021

Copy link to clipboard

Copied

Here you go.

var spans = [{

alignment: "justify",

fontFamily: ["MouseMemoirs"],

fontStyle: "normal",

fontWeight: 100,

text: "The energy giant Royal Dutch Shell has announced it has passed its peak production of oil. The days of increasing oil production are over and the decline in output has started. Shell said in a press release that, \"oil production peaked in 2019\". The \"high point\" of Shell's oil production reached around 1.7 million barrels per day. It now expects an annual drop of up to two per cent per year. The fall comes a year ahead of Shell's initial forecasts. In 2015, the company predicted the peak of global oil demand would be in 2020. The announcement included news that Shell would reduce the number of its oil refineries from 14 sites to six. This means the loss of around 9,000 jobs, or more than 10 per cent of its workforce.\nShell said it is shifting its focus onto renewables and reducing its carbon footprint. It pledged to achieve net-zero carbon emissions by 2050. The company said it wants to diversify into becoming an energy provider rather than relying on fossil fuels. It has been actively exploring new, green technologies such as carbon capture. It has also been buying companies that provide electric vehicle charging stations. Shell CEO Ben van Beurden vowed to create half a million EV charging points by 2025. He said: \"We must give our customers the products and services they want - products that have the lowest environmental impact. We will...grow in markets where demand for cleaner products and services is strongest.\"",

textColor: ["RGB", 0, 0, 0],

textSize: 18

}]

Votes

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
Participant ,
Sep 07, 2021 Sep 07, 2021

Copy link to clipboard

Copied

Thanks a lot. It worked this time.

Just one thing: The font didn´t change to "Mouse Memoirs", as I expected.

 

Votes

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
Participant ,
Sep 07, 2021 Sep 07, 2021

Copy link to clipboard

Copied

I have a few questions:

 

1) I´m using this code in the Format tab, section Customized Script Format. Is it the right place to be?

 

2) Once I placed the code in the above section, I removed the original text from the Defalt Value section,

in the tab Options. Is this correct|?

 

Because, the code is behaving strangely. The text doesn´t seem to be affected by the changes I make in the

code, for example. font size, etc.

 

Thanks for your help.

Votes

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
Participant ,
Sep 10, 2021 Sep 10, 2021

Copy link to clipboard

Copied

LATEST

 

Can you please send me your reply/comments to the following massage? Thanks for the help

 

-qte-

I have a few questions:

 

1) I´m using this code in the Format tab, section Customized Script Format. Is it the right place to be?

 

2) Once I placed the code in the above section, I removed the original text from the Defalt Value section,

in the tab Options. Is this correct|?

 

Because, the code is behaving strangely. The text doesn´t seem to be affected by the changes I make in the

code, for example. font size, etc.

 

Thanks for your help.

 

-unqte-

Votes

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