Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Getting Started, Learning, Etc.

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 6th, 2010, 01:07 PM
marcuslayton marcuslayton is offline
Junior Community Member
 
Join Date: Sep 2008
Posts: 39
Default copyfitline description

Where is the location that describes copyfitline - looked in the manual and didn't seem to find any api like description of it.

I have a text box that would require some individual copyfitting, and i have used it ages ago and don't know what the requirments of the function are.

Looked at the new post for a better copyfit line - but that set the width where i need it to do a text copyfit. thanks!
Reply With Quote
  #2  
Old October 6th, 2010, 01:51 PM
marcuslayton marcuslayton is offline
Junior Community Member
 
Join Date: Sep 2008
Posts: 39
Default Re: copyfitline description

from what it looks like:

return CopyfitLine("", Field("Name"), "Adobe Garamond Pro", 20, 137, 6, false);

looks like something, field, font, what size supposed to be, width in points, minimum,
and if it to be enlarged or not
Reply With Quote
  #3  
Old October 7th, 2010, 02:09 PM
Dan Korn's Avatar
Dan Korn Dan Korn is online now
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: copyfitline description

Quote:
Originally Posted by marcuslayton View Post
Where is the location that describes copyfitline - looked in the manual and didn't seem to find any api like description of it.
Sorry, this seems to be a documentation oversight.

The parameters to CopyfitLine, in order, are:
  • staticPart - text to not be resized
  • dynamicPart - text to be resized (after staticPart)
  • font - font family name
  • size - base point size (in points)
  • width - width of the frame or column (in points)
  • minimum - minimum point size (in points)
  • adjustWidthOnly - true/false (optional - see below)
For the "adjustWidthOnly" parameter, if you leave it off (or specify false), the function will adjust the point size, that is, both the width and height, of the glyphs. If you specify true, the function will adjust only the set width of the glyphs, but not the height, which basically means they will look squished horizontally.

In FusionPro 6.0 and newer, you can use the FindTextFrame and GetSettableTextWidth functions to automatically get the frame width instead of hard-coding it.

Quote:
Originally Posted by marcuslayton View Post
Looked at the new post for a better copyfit line
You mean this?
http://forums.printable.com/showthre...?p=190#post190
Quote:
Originally Posted by marcuslayton View Post
- but that set the width where i need it to do a text copyfit. thanks!
I'm not sure what you mean. Both functions are doing the exact same "text" kind of copyfitting by default (unless you specify true for the last optional parameter to CopyfitLine).
Quote:
Originally Posted by marcuslayton View Post
from what it looks like:

return CopyfitLine("", Field("Name"), "Adobe Garamond Pro", 20, 137, 6, false);

looks like something, field, font, what size supposed to be, width in points, minimum,
and if it to be enlarged or not
You're close. The first parameter ("") is the static part not to be resized; it's perfectly valid (and common) to specify an empty string here to resize the entire line. The last parameter (false) means that it should to a regular "text" copyfit; that can be left off and you'll get the same result.
__________________
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)});

Last edited by Dan Korn; January 5th, 2015 at 10:25 AM.. Reason: width is in points, not hundredths of points
Reply With Quote
  #4  
Old October 7th, 2010, 02:41 PM
marcuslayton marcuslayton is offline
Junior Community Member
 
Join Date: Sep 2008
Posts: 39
Default Re: copyfitline description

excellent - txs dan - the rule is working great!
Reply With Quote
  #5  
Old January 2nd, 2015, 09:56 AM
Developer Developer is offline
Junior Community Member
 
Join Date: Sep 2013
Location: Connecticut, USA
Posts: 27
Default Re: copyfitline description

Quote:
The parameters to CopyfitLine, in order, are:

staticPart - text to not be resized
dynamicPart - text to be resized (after staticPart)
font - font family name
size - base point size (in points)
width - width of the frame or column (in hundredths of points)
minimum - minimum point size (in points)
adjustWidthOnly - true/false (optional - see below)
I did some testing, and it appears in FusionPro 8.2.7 the width parameter of the CopyfitLine function should be in points, not hundredths of points. Here is an example using the FindTextFrame and GetSettableTextWidth functions that Dan suggested. The GetSettableTextWidth function returns the width in hundredths of points, so I divided by 100 to get points. I also included a span tag to keep any text following this line at its normal size. Make sure to have "Re-evaluate this rule for every text flow" and "Treat returned strings as tagged text" in the rule editor checked.
Code:
myWidth = GetSettableTextWidth(FindTextFrame(FusionPro.Composition.CurrentFlow.name)) / 100;
return "<span accumulate=false>" + CopyfitLine("",Field("Email") + "@mycompany.com","Arial","7",myWidth,"1",false) + "</span>";
__________________
FusionPro VDP Creator 9.3.36
Adobe Acrobat DC Version 2015.006.30198
Windows 7 64-bit
Reply With Quote
  #6  
Old January 5th, 2015, 10:27 AM
Dan Korn's Avatar
Dan Korn Dan Korn is online now
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: copyfitline description

Quote:
Originally Posted by Developer View Post
I did some testing, and it appears in FusionPro 8.2.7 the width parameter of the CopyfitLine function should be in points, not hundredths of points.
Yes, that's correct. I've edited my post above to note that the width parameter is in points, not in hundredths of points. Thanks for the catch.
__________________
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
  #7  
Old May 26th, 2015, 04:44 PM
ThePorge ThePorge is offline
Regular Contributor
 
Join Date: Aug 2011
Location: Georgia
Posts: 56
Default Re: copyfitline description

Got a prob. I'm using the
return CopyfitLine("", Field("Name"), "Adobe Garamond Pro", 11, 214, 6, true);
It is used in a text resource that I made because the copy changes based on the data file. This copy also has an image (a signature) that moves with the copy. The problem is when the copy gets shrunk to fit the sig disappears. Otherwise this sig appears as it should. Any ideas?
Reply With Quote
  #8  
Old May 26th, 2015, 04:54 PM
Dan Korn's Avatar
Dan Korn Dan Korn is online now
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: copyfitline description

Quote:
Originally Posted by ThePorge View Post
Got a prob. I'm using the
return CopyfitLine("", Field("Name"), "Adobe Garamond Pro", 11, 214, 6, true);
It is used in a text resource that I made because the copy changes based on the data file. This copy also has an image (a signature) that moves with the copy. The problem is when the copy gets shrunk to fit the sig disappears. Otherwise this sig appears as it should. Any ideas?
Please start a new thread with your specific question. Include the versions of FusionPro, Acrobat, and the operating system. If you can attach a minimal sample job which demonstrates the problem, that would be ideal.
__________________
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
Old December 10th, 2015, 12:16 PM
daniel
This message has been deleted by daniel.
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 09:35 AM.


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