Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > FusionPro® VDP Creator

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 11th, 2014, 11:37 AM
Meir Meir is offline
Regular Contributor
 
Join Date: Mar 2011
Location: Lawrenceville, NJ
Posts: 50
Default Why is my phone extension dropping to the next line only when address2 is present?

So I have a business card where the address and other info all share one box. They display like this:

«Address»«Address2_rule»
«City», «State» «Zip» «Country»
«Gap_rule»
«Phone1_Label_Rule» «Phone1_Format_Rule»
«Phone2_Label_Rule» «Phone2_Format_Rule»
«Phone3_Label_Rule» «Phone3_Format_Rule»
«Phone4_Label_Rule» «Phone4_Format_Rule»
Email: «Email»@epam.com
«Other_Label_Rule»«Other»

The text box is set to "Adjust text to fit"

The phone lines are set to "Do not break on copyfit"

Address2 is not involved in any rules for any Phone label or number.

When there is no Address 2, my output displays like this:

"""
123 Anystreet
Citytown, PA, 12356 USA

Main: +1(123) 456-7890 ext.12345
Fax: +1(123) 098-7654
Cell: +1(123) 102-9837
Email: JSnow@company.com
"""

When there is an Address 2, my output displays like this:

"""
123 Anystreet
Suite 303
Citytown, PA, 12356 USA

Main: +1(123) 456-7890
ext.12345
Fax: +1(123) 098-7654
Cell: +1(123) 102-9837
"""

When there is no Address2, but an extra line for Phone4, the extension is still on the same line.

I need help understand what is going on here. I cannot comprehend why the extension would drop a line only when address2 is present. This is also causing my email to no longer fit in the text box.


Attached is my collected files.
Attached Files
File Type: zip 84150_Epam_BC_Mar-11-2014_07-40-39.zip (9.38 MB, 2 views)
__________________
Meir Galimidi
Allegra
FP 7.2P1k, MAC OSX 10.5.8, Acrobat 9.4.0
Reply With Quote
  #2  
Old March 11th, 2014, 01:05 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Why is my phone extension dropping to the next line only when address2 is present

Do a select all (cmd + A) on the text in that text box, click paragraph, and then click "suppress if empty" and select OK.
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #3  
Old March 11th, 2014, 01:43 PM
Meir Meir is offline
Regular Contributor
 
Join Date: Mar 2011
Location: Lawrenceville, NJ
Posts: 50
Default Re: Why is my phone extension dropping to the next line only when address2 is present

This did not have an effect. The Address 2 field was suppressing when it is not present prior to your change. After your change, the extension is still dropping one line when address2 is present.

Attached are screen shots. Address 2 drops the extension on all the phone numbers when it is present even though they all fit fine on one line when it is not present.
Attached Files
File Type: zip Archive 2.zip (766.7 KB, 1 views)
__________________
Meir Galimidi
Allegra
FP 7.2P1k, MAC OSX 10.5.8, Acrobat 9.4.0
Reply With Quote
  #4  
Old March 11th, 2014, 02:03 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Why is my phone extension dropping to the next line only when address2 is present

Okay, sorry I misread your original post and didn't see an extension in the data file you included.

You can edit your phone number rules to replace all spaces with non-breaking spaces and that could solve your problem. (The change is in red. And make sure you check "treat returned strings as tagged text" in the rule editor)
Code:
var Var1 = "Phone1";
var CaseSelection = "Format 3";

	
	
if(CaseSelection == "Format 1")
{
var formatStyle01 = "$1.$2"; 			//simple 7 digit phone
var formatStyle02 = "$1.$2.$3";			//simple 10 digit phone
var formatStyle03 = "+$1 $2.$3.$4";		//10 digit phone starts with 1
var formatStyle04 = "$1.$2.$3 ext.$4";		//10 digit phone with extension
var formatStyle05 = "+$1 $2.$3.$4 ext.$5";	//10 digit phone starts with 1 with extension
var formatStyle06 = "$1.$2 ext.$3";		//7 digit phone with extension
	
var thisNumber = Field(Var1);
	
return formatNumber(Trim(thisNumber));
}
	
	
	
	
	
if(CaseSelection == "Format 2")
{
var formatStyle01 = "$1-$2"; 			//simple 7 digit phone
var formatStyle02 = "$1-$2-$3";			//simple 10 digit phone
var formatStyle03 = "+$1 $2-$3-$4";		//10 digit phone starts with 1
var formatStyle04 = "$1-$2-$3 ext.$4";		//10 digit phone with extension
var formatStyle05 = "+$1 $2-$3-$4 ext.$5";	//10 digit phone starts with 1 with extension
var formatStyle06 = "$1-$2 ext.$3";		//7 digit phone with extension
	
var thisNumber = Field(Var1);
	
return formatNumber(Trim(thisNumber));
}
	
	
	
	
	
if(CaseSelection == "Format 3")
{
var formatStyle01 = "$1-$2"; 			//simple 7 digit phone
var formatStyle02 = "($1) $2-$3";			//simple 10 digit phone
var formatStyle03 = "+$1 ($2) $3-$4";		//10 digit phone starts with 1
var formatStyle04 = "($1) $2-$3 ext.$4";		//10 digit phone with extension
var formatStyle05 = "+$1 ($2) $3-$4 ext.$5";	//10 digit phone starts with 1 with extension
var formatStyle06 = "$1-$2 ext.$3";		//7 digit phone with extension
	
var thisNumber = Field(Var1);
return formatNumber(Trim(thisNumber)).replace(/\s/g," ");

}
	
	
	
	
	
	
if(CaseSelection == "Format 4")
{
var formatStyle01 = "$1.$2"; 			//simple 7 digit phone
var formatStyle02 = "($1)$2.$3";			//simple 10 digit phone
var formatStyle03 = "+$1 ($2)$3.$4";		//10 digit phone starts with 1
var formatStyle04 = "($1)$2.$3 ext.$4";		//10 digit phone with extension
var formatStyle05 = "+$1 ($2)$3.$4 ext.$5";	//10 digit phone starts with 1 with extension
var formatStyle06 = "$1.$2 ext.$3";		//7 digit phone with extension
	
var thisNumber = Field(Var1);
	
return formatNumber(Trim(thisNumber));
}
	
	
	
	
	
	
	
	
	
//////////////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT EDIT BELOW THIS LINE ///////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
	
return formatNumber(Trim(thisNumber));
	
function formatNumber(number01){
	
var pattern01 = /^(\d{3})[^\d]*(\d{4})$/;   						
//   //2201727 or 220-1727 or 220- 1727
	var pattern02 = /^[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})$/;   				
// 8002201727 or 800-220-1727 or (800)220-1727 or (800) 220-1727
	var pattern03 = /^\+?(\d{1})[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})$/;   			
// 18002201727 or 1-800-220-1727 or +1 (800) 220-1727
	var pattern04 = /^[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})\D*[x#n]\D*(\d+)$/;		
// 800-220-1727 ext 12345 or (800) 220-1727 ext 12345
	var pattern05 = /^\+?(\d{1})[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})\D*[x#n]\D*(\d+)$/;	
// 1-800-220-1727 ext 12345 or +1 (800) 220-1727 ext 12345
	var pattern06 = /^(\d{3})[\D]*(\d{4})\D*[x#n]\D*(\d+)$/;   				
// 2201727 ext 1234 or 220-1727 ext 1234 or 220- 1727 ext 1234
	var patternEndExt = /(.)[x#n](.)/;
	var patternStart1 = /^[\D]*[1]/;
	
	if(number01.match(pattern01)){
		number01 = number01.replace(pattern01, formatStyle01);
		return number01;
	} else if(number01.match(pattern02)){
		number01 = number01.replace(pattern02, formatStyle02);
		return number01;
	} else if(number01.match(pattern03)){
		if (number01.match(patternStart1)){
			number01 = number01.replace(pattern03, formatStyle03);
			return number01;
		} else {
			return number01;
		}
	} else if(number01.match(pattern04)){
			number01 = number01.replace(pattern04, formatStyle04);
			return number01; 
	} else if(number01.match(pattern05)){
			number01 = number01.replace(pattern05, formatStyle05);
			return number01;
	}  else if(number01.match(pattern06)){
			number01 = number01.replace(pattern06, formatStyle06);
			return number01;
	} else {
		//return "no match any pattern";
		return number01;
	}	
}
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #5  
Old March 11th, 2014, 02:14 PM
Meir Meir is offline
Regular Contributor
 
Join Date: Mar 2011
Location: Lawrenceville, NJ
Posts: 50
Default Re: Why is my phone extension dropping to the next line only when address2 is present

Thank you for taking the time to help me.

I'm sorry, the extension is not in the data file, as I am using this online and that is where I am encountering the error by a user. However, the error persists in the collect files.

I tried your method, but this is making the entire phone number drop to the line below my phone label. I attached a screen shot of the output.

Before your change:
Main: +1(123) 456-7890
ext.12345

After your change:
Main:
+1(123) 456-7890 ext.12345

Desired output:
Main: +1(123) 456-7890 ext.12345


I have attached updated collect files with records 3-7 demonstrating the issue.

You will notice in record 3 that all those lines fit in the text box. Notice how Address2 is present.

You will notice in record 4 that all the phone extensions can fit on the same line as their phone numbers. Notice how Address2 is not present.

You will notice in record 5 that all those extensions that had previously fit on the same line as the phone number are dropped to the next line. Notice how Address2 is present.

You will notice in record 6 that the extension on phone 1 pushes to the next line. Address 2 is present. All the fields that fit in record 3 no longer fit, because phone is taking up two lines instead of 1.

In record 4, I displayed that the extension for every phone number can fit on the same line as the phone number. Yet in record 6, the phone number and extension are on different lines.

Why is the extension dropping onto the next line only when Address2 is present?
Attached Files
File Type: zip Collect_Example.zip (9.66 MB, 6 views)
__________________
Meir Galimidi
Allegra
FP 7.2P1k, MAC OSX 10.5.8, Acrobat 9.4.0
Reply With Quote
  #6  
Old March 11th, 2014, 02:38 PM
jwhittaker jwhittaker is offline
Senior Contributor
 
Join Date: Feb 2009
Location: San Diego
Posts: 159
Default Re: Why is my phone extension dropping to the next line only when address2 is present

Can you just add the address2 field on the second line by itself and select suppress if empty instead of using a rule to create a return? I did it and saved it. I'll attach.
Attached Files
File Type: pdf 84150 Epam_BC.pdf (113.9 KB, 6 views)
__________________
FusionPro VDP Creator 10.0.26 | MacOS 10.13.4 | Acrobat DC
Reply With Quote
  #7  
Old March 11th, 2014, 02:42 PM
Meir Meir is offline
Regular Contributor
 
Join Date: Mar 2011
Location: Lawrenceville, NJ
Posts: 50
Default Re: Why is my phone extension dropping to the next line only when address2 is present

well that works... I still have no idea why it wasn't working the other way, but that'll do.

Thank you very much!
__________________
Meir Galimidi
Allegra
FP 7.2P1k, MAC OSX 10.5.8, Acrobat 9.4.0
Reply With Quote
  #8  
Old March 11th, 2014, 02:51 PM
jwhittaker jwhittaker is offline
Senior Contributor
 
Join Date: Feb 2009
Location: San Diego
Posts: 159
Default Re: Why is my phone extension dropping to the next line only when address2 is present

It looks like you had both the Address and Address2_rule line selected and had do not break on copyfit but the address2_rule had a line break in it so it was freakin out. If you select the entire first line and then un-check the don't break on copyfit and it will be fine.
__________________
FusionPro VDP Creator 10.0.26 | MacOS 10.13.4 | Acrobat DC
Reply With Quote
  #9  
Old March 11th, 2014, 03:00 PM
Meir Meir is offline
Regular Contributor
 
Join Date: Mar 2011
Location: Lawrenceville, NJ
Posts: 50
Default Re: Why is my phone extension dropping to the next line only when address2 is present

That seems to work too. Makes sense. Thank you.
__________________
Meir Galimidi
Allegra
FP 7.2P1k, MAC OSX 10.5.8, Acrobat 9.4.0
Reply With Quote
Reply

Tags
copyfit, javascript, linebreak

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.