Skip to main content
colettel75944671
Participant
Jul 2, 2017 10:32 PM UTC
Question

Adobe DC - custom format 12 numbers to include dashes

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 is closed to new replies. Start a new post to keep the conversation going.

10 replies

colettel75944671
Participant
Jul 2, 2017 11:04 PM UTC

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

Translate
JR Boulay
Community Expert
Community Expert
Jul 3, 2017 9:37 AM UTC

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

Properties : Format : Special : Arbitrary Mask

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Jul 3, 2017 9:47 AM UTC

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

Translate
try67
Community Expert
Community Expert
Jul 2, 2017 10:51 PM UTC

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>

Translate
try67
Community Expert
Community Expert
Jul 2, 2017 10:56 PM UTC

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);

Translate
colettel75944671
Participant
Jul 2, 2017 11:06 PM UTC

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

Translate