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

Need Javacript Code to make all text bold

New Here ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

I am almost there.  I have Adobe Acrobat DC.

I can bring up the Java Console.

My file name is test.pdf

The text of about 100 pages is extremely light.

I can't figure out which code to put in the box so that it will turn all of my text to bold after hitting CTL + Enter.

I am very new at this.

Thank You for ANY help or DIRECTION you can provide.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

935

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

correct answers 1 Correct answer

Community Expert , Jan 09, 2018 Jan 09, 2018

No. That code was written for an HTML page. It can't be used for a PDF file.

Votes

Translate

Translate
Community Expert ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

You're not almost there. You aren't even close. Unfortunately, Acrobat JavaScript can't change the PDF page content. It's just not possible.

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
New Here ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

So, you are saying nothing from the below can be used???:

<html>

<head>

<script language="JavaScript"><!--

function bold(id) {

  if (document.getElementById) {

  document.getElementById(id).style.fontWeight = 'bold';

  }

  else if (document.all) {

  document.all[id].style.fontWeight = 'bold';

  }

}

//--></script>

<p id="myPara">

some sample text <span id="mySpan">this bit will turn bold</span> but this won't.

</p>

<form>

<input type="button" value="bold" onClick="bold('mySpan')">

</form>

</body>

</html>

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 ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

No. That code was written for an HTML page. It can't be used for a PDF file.

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 ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

LATEST

There's a very good article at the link below that describes the JavaScript Core vs. Browser JavaScript vs. Acrobat JavaScript.

Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC

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