Skip to main content
Participant
Jan 9, 2018 3:33 AM UTC
Answered

Need Javacript Code to make all text bold

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.

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jan 9, 2018 8:25 AM UTC

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

4 replies

Joel Geraci
Community Expert
Community Expert
Jan 9, 2018 3:48 AM UTC

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.

Translate
mholmansrAuthor
Participant
Jan 9, 2018 7:59 AM UTC

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>

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jan 9, 2018 8:25 AM UTC

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

Translate