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
  #11  
Old May 14th, 2010, 11:04 AM
JulieP JulieP is offline
Junior Community Member
 
Join Date: Aug 2009
Posts: 11
Question Re: Moving lines up if one line is blank

The inline graphic works great. However, I need to tweak how it aligns with the text. Is there some way to force the text to align with the center of the graphic? I have tried everything I know to try in the text and Resource Editors and I couldn't find anything in the forums.
And, THANKS TO EVERYONE FOR ALL THE HELP

I have this:



I need this:

Reply With Quote
  #12  
Old May 14th, 2010, 12:44 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,361
Default Re: Moving lines up if one line is blank

Sorry, you didn't mention anything at all in your initial post about trying to move graphics as well as text, so I had no way of knowing about that. Eric is right on that you need to be using inline graphics which flow with the text, rather than separate graphic frames. (Although you could build a table, but that's more complicated.)

Now, you do need JavaScript rules to invoke the inline graphics. However, once you create the inline graphic rules, you can still apply them in the Text Editor and use the "Suppress if containing empty variables" setting to suppress the entire line, including the inline graphic, if the field value is empty. In other words, you still don't need any JavaScript logic to suppress the lines.

You can see an example of this in the Cell Phone tutorial job that's installed with FP Desktop. Double-click on the frame on the middle of the first page and edit the text to insert the "signature" rule on the line with the "Add2" variable.


Then, with that same line selected, click "Paragraph..." and change the setting in the "Suppress if" drop-down list to "Containing empty variables."


Then click OK twice to exit the Text Editor. Open the Preview Record Selector and check the "Preview" box. For record 1, you won't see the signature because the "Add2" field is empty. Now click the forward arrow button on the Preview palette and you'll see that for record 2, the signature appears on the line with the "Add2" field value. Every record with an "Add2" line will show it along with the graphic, and every record without an "Add2" line will suppress the graphic. Cool, huh?

This is exactly what you want to do in your job. You may have to tweak the inline graphic rule to get the graphic to appear at the proper size, but once you do that, suppressing the line containing is as easy as a few clicks.
Attached Images
File Type: jpg texted.JPG (29.3 KB, 12 views)
File Type: jpg paraform.JPG (29.0 KB, 14 views)
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #13  
Old May 14th, 2010, 01:01 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,361
Default Re: Moving lines up if one line is blank

Quote:
Originally Posted by JulieP View Post
The inline graphic works great. However, I need to tweak how it aligns with the text. Is there some way to force the text to align with the center of the graphic? I have tried everything I know to try in the text and Resource Editors and I couldn't find anything in the forums.
And, THANKS TO EVERYONE FOR ALL THE HELP

I have this:



I need this:

Sorry, I didn't see your other reply before I typed up my last one. Obviously you figured out how to make the inline graphic.

This is now getting into a separate question, which is not so much about suppressing lines as it is about aligning inline graphics with text. Tweaking that is a little more complicated.

Basically, everything on the line, including inline graphics, lines up to the baseline for the text. If the graphics are larger than the text, they will always have the kind of effect like you're seeing, by default.

That said, it looks like your graphics are actually sitting a little bit above the baseline. Without seeing the graphics themselves, I can't really tell for sure, but I suspect this is because the images have some white space padding around them. You could try editing the images to crop off the white space and see if that helps. However, if the graphics are larger than the text, you'll still see them on the baseline, not centered as you're trying to do.

There are a few things you can do to tweak the output to look different than the defaults. One is to make a table and place the graphic and the text in adjacent cells on the same row. This approach will give you the most fine-grain control, but it's also the most complicated to do. You may also be able to use a Repeatable Component (Template Page), but that's pretty complex too.

Short of creating a table or Repeatable Component , there are a couple of relatively simple things you can do, in your inline graphic rule. The first is to tweak the size of the inline graphic with the height and/or width attributes of the graphic tag. For instance:
Code:
return "<graphic file=signature.jpg height=1000>";
You'll have to play around with the numbers to get the desired effect, and you still may need to remove whitespace from the graphics themselves.

Another option is to put the text in superscript, raising it above the baseline, like so:
Code:
return "<graphic file=signature.jpg><p br=false superratio=100 superoffset=30><superscript>";
Again, you'll have to tweak the offset here, and this will also change the baseline relative to other lines, which may not be what you want either. You may be able to work around this by putting ALL the text in superscript, although at that point you're getting into the area where you might as well make a table. But it's something to try.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #14  
Old May 14th, 2010, 01:10 PM
JulieP JulieP is offline
Junior Community Member
 
Join Date: Aug 2009
Posts: 11
Thumbs up Re: Moving lines up if one line is blank

Thanks Dan! You are the best! I will work on it and try to achieve a better look. Thanks again for all your help!
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 03:09 PM.


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