Skip to main content
colettel75944671
Participant
July 2, 2017
Question

Adobe DC - custom format 12 numbers to include dashes

  • July 2, 2017
  • 2 replies
  • 3027 views

Adobe DC - I am trying to import a number from Excel that has no dashes into a pdf file that will insert the dashes. Is this possible ? ie 123456789012 in excel and I want it to look like 123-456-7890-12 when in the pdf. Do I need to do a Java script? If yes could you tell me how to write it?

This topic has been closed for replies.

2 replies

colettel75944671
Participant
July 2, 2017

Thank you, would you please give me the script for the 12 digit format? 111-222-3333-44?

JR Boulay
Community Expert
Community Expert
July 3, 2017

123456789012 in excel and I want it to look like 123-456-7890-12 when in the pdf

Properties : Format : Special : Arbitrary Mask

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
July 3, 2017

I thought so also, but that doesn't work when you import the data from an external source...

try67
Community Expert
Community Expert
July 2, 2017

No, that won't work. You need to give the values the correct format before

importing them to the PDF.

On Mon, Jul 3, 2017 at 12:33 AM, colettel75944671 <forums_noreply@adobe.com>

try67
Community Expert
Community Expert
July 2, 2017

Sorry, my reply above is not entirely correct. You can do is using a script... For example, to format a 6-digit number as "123-456" you can use this code as the custom Format script:

if (/^\d{6}$/.test(event.value)) event.value = event.value.substring(0,3)+"-"+event.value.substring(3);

colettel75944671
Participant
July 2, 2017

Thank you, would you please give me the script for the 12 digit format? 111-222-3333-44?