Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 21st, 2015, 01:05 PM
Ryan_B Ryan_B is offline
Regular Contributor
 
Join Date: Mar 2015
Location: Kansas City, MO
Posts: 70
Default Horizontal Alignment Formatting Rule

I'm getting some strange behavior from a rule I have written, and I'm wondering if anybody can tell me why.
I have a business card that allows the user to upload a headshot. It is not required, so if the user decides not to upload one, I want to horizontally center align a textframe.
This is the rule I have written to do so:
Code:
if(Field("HeadShot") == "")
{
   return '<p quad=C>' + Rule("RuleNameToUpper");
}
else
{
   return Rule("RuleNameToUpper");
}
The rule RuleNameToUpper simply puts the Name field in all caps. I then inserted that rule into the textframe that I want to center align.

I've tested it and it works as expected, except for one part. If the user does not upload a headshot, the textframe center aligns, but the font size is decreased. I've tried conditionally setting the font size with:
Code:
<z newsize="32">
//this is as big as I can go before getting the "red bar of death" at the bottom of the textframe.
But I can't get it the same size as the font if the user does upload a headshot. Here's the strange part: The font size set for that text frame is 12, and fills the entire height of the text frame.

This is how it looks when the user does not upload a headshot.
woHeadShot.PNG
This is how it looks when the user does upload a headshot.
wHeadShot.PNG

I'm not sure how or why when the user does not upload a headshot, the font size decreases. Any ideas for a fix would be greatly appreciated.
__________________
Ryan Boever
FusionPro VDP Designer 9.3.36
Adobe Acrobat XI 11.0.07
Windows 10
Reply With Quote
  #2  
Old August 24th, 2015, 07:26 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Horizontal Alignment Formatting Rule

The paragraph tag by default starts a new paragraph. In other words, adds a break. Making this small modification should resolve your issue:
Code:
if(Field("HeadShot") == "")
{
   return '<p br=false quad=C>' + Rule("RuleNameToUpper");
}
else
{
   return Rule("RuleNameToUpper");
}
__________________
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 August 24th, 2015, 07:58 AM
Ryan_B Ryan_B is offline
Regular Contributor
 
Join Date: Mar 2015
Location: Kansas City, MO
Posts: 70
Default Re: Horizontal Alignment Formatting Rule

Ah yes, this makes sense. I've made the addition and now it works like a charm! Thank you Ste for your reply.
__________________
Ryan Boever
FusionPro VDP Designer 9.3.36
Adobe Acrobat XI 11.0.07
Windows 10
Reply With Quote
  #4  
Old August 24th, 2015, 08:03 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Horizontal Alignment Formatting Rule

No problem! I'm glad I could help
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
Reply

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 04:09 AM.


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