Jump to content

aligning contact numbers


sschardan

Recommended Posts

I have a business card project that I am working on that requires the phone, cell, and fax numbers to be PERFECTLY aligned, and they are not using a monospaced font. I thought I could enlarge the width of the text, then force a specific width by using the copyfitline function. This is getting me fairly close, but there are still some number pairs that are up to .25 number width off. I'm afraid it won't be perfect enough for our client. Here is a sample of one of my rules:

 

if (Field("Cell #") != "")
{
  var fill = '<magnify type=setwidth factor=110>' + Field("Cell #") + '</magnify>';
  return CopyfitLine("", fill, "Gotham-Bold", 6.25,41, 2, true)
}

return "";

 

Any assistance would be greatly appreciated.

 

FusionPro Desktop 7.2p1d

Mac OS 10.6

Acrobat 9

Link to comment
Share on other sites

Are you asking for the alignment to be "justified" so that the left and right of both sides of the number are aligned? Or do you want the left/right side of the numbers aligned in regard to their prefix (phone, cell, fax, etc.)?

If you have a number with an extension, how are you handling that?

Are the prefixes and phone numbers in the same text box? Maybe what you need to do is set up two text boxes, one for prefixes, one for numbers.

Without sample output, it is hard to see what you are asking for exactly.

Link to comment
Share on other sites

The actual numbers in a 111.111.1111 presentation need to perfectly justify left to right within the 41 pt. space defined in my rule. The resulting justified text block needs to be aligned flush right within the overall text box. I can not use separate text boxes because there can be as few as one number, or as many as three numbers on the card. To complicate matters, if there is only one number, that number, email address, street address, city, state, and zip need to be below a blank space with 8 pt. leading underneath the contact name and title. If there is more than one number, then the blank space needs to have 5 pt. leading and the numbers will have the abbreviations of P, C, or F, which have to be perfectly aligned on the left edge in front of the corresponding numbers.

 

I didn't mention all that mess in my original post because I have worked it all out except for getting perfect justification within the 41 pt. space. My rule is enlarging all the text beyond the 41 pt. space because some of the text is naturally smaller than 41 pt. in width. The copyfitline is then reducing the width of the numbers to fit, and in the rule editor it is giving me results such as a new width of 5.93400679 pt. or 6.00245007 pt. If it is being that precise, I don't understand why there is still fluctuation from number to number.

Link to comment
Share on other sites

Thank you everyone for your response. I have this working now. I still had to incorporate a copyfitline because some of the numbers are too big to fit in the desired area. Here is the final rule that I used:

 

var fit = CopyfitLine("", Field("Cell"), "Gotham-Bold", 6.25,41, 2, true)

if (Field("Cell") != "")
{
   return "<p br=false quad=JJ>" + fit;
}

return "";

 

I had to use a second text box to get my prefixes to work correctly. This second box is a duplicate of the first box, sent to the back, with all the other info colored white. I did this because if I include my cell prefix rule in the main box, the cell phone line formatting does not hold when the prefix is "C". If it is "c" or any other prefix, it is fine. Here is a copy of my prefix rule:

 

if (Field("Cell") != "")
{
  return "C";
}

return "";

 

It does not matter how I set "treat returned strings as tagged text" for this rule. It is as if the "C" is overriding the tabs somehow. For now I am proceeding with the two box option. I'm just curious as to why this is happening.

Sample 2.pdf

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...