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 December 22nd, 2010, 09:30 AM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Question Help! Copyfit won't copyfit

Hello,

I have a situation where a rule returning a text resource is placed in a variable text field and it is not copyfitting the text in the resource. I have "Do not break on copyfit" selected for both the resource and the variable text field, and "Adjust text to fit" selected in the Overflow Options for the text field. The text continues to wrap to the next line.

I have tried editing the default OnCopyfit settings and no matter what I do nothing changes; the text still wraps to the next line. I have tried the CopyfitLine function and I get an error that says "Function does not return a result".

The Variable Text Field looks like:
Location «Clinic-Address»
Floor «FLOOR»
Parking «PARKING»
Registration «REGISTRATION»

The Clinic-Address rule is:
Code:
return Resource("LocationResource")
The Resource "LocationResource" is:
«LOCATION»

«ADDRESS»
The rule for the field ADDRESS is:
Code:
var numberFont = "Folio Light";
var numberWidth = "11";
var numberHeight = "10.5";
var text = NormalizeEntities(Rule("AddressCopyfit"));

return text.replace(/(\d+\s*)/g, function(d){return '<span font="' + numberFont + '"><z newsize="' + numberHeight + '"><setwidth newsize="' + numberWidth + '">' + d + '</span>';});
The rule AddressCopyfit is:
Code:
CopyfitLine("", Field("ADDRESS"), "Alright Sans Regular", 6, 330, 6, false);
In this scenario what shows up in the variable text field instead of the address is the word "undefined". What am I doing wrong and how do I get the Address line to copyfit, i.e. shrink when necessary?
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3
Reply With Quote
  #2  
Old December 22nd, 2010, 01:24 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,338
Default Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by mstanton View Post
I have tried the CopyfitLine function and I get an error that says "Function does not return a result".
...

The rule AddressCopyfit is:
Code:
CopyfitLine("", Field("ADDRESS"), "Alright Sans Regular", 6, 330, 6, false);
In this scenario what shows up in the variable text field instead of the address is the word "undefined".
The error message that you get when you validate the rule is exactly right; it's trying to tell you that you're not actually returning anything. Try adding "return " (without quotes) to the beginning of that rule, before the call to the CopyfitLine function.
__________________
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
  #3  
Old December 22nd, 2010, 01:36 PM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Default Re: Help! Copyfit won't copyfit

Thanks for the quick reply! I added return to the beginning of the rule and now the result I get is:

<f name="Alright Sans Regular"><z newsize=6><z newsize=6>4855 West Arrowhead Road | Hermantown MN 55811-3936

The address is there, but so is some code, and still none of it has shrunk to fit on one line. It is the same whether I have "Treat returned strings as tagged text" checked or not.
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3
Reply With Quote
  #4  
Old December 23rd, 2010, 08:23 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,338
Default Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by mstanton View Post
I added return to the beginning of the rule and now the result I get is:

<f name="Alright Sans Regular"><z newsize=6><z newsize=6>4855 West Arrowhead Road | Hermantown MN 55811-3936

The address is there, but so is some code, and still none of it has shrunk to fit on one line.
When calling CopyfitLine, you need to set the sixth parameter (the minimum point size) to something smaller than the fourth parameter (the starting point size), otherwise it won't do anything. Try something like this:
Code:
return CopyfitLine("", Field("ADDRESS"), "Alright Sans Regular", 6, 330, 4, false);
Although less than six points is getting pretty small.
__________________
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
  #5  
Old December 28th, 2010, 09:17 AM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Default Re: Help! Copyfit won't copyfit

Ok, I have changed the AddressCopyfit rule to:
Code:
return CopyfitLine("", Field("ADDRESS"), "Alright Sans Regular", 7, 330, 6, false);
but it hasn't solved the problem I am now having where extra information shows up before the address:
Code:
<f name="Alright Sans Regular"><z newsize=7><z newsize=7>
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3
Reply With Quote
  #6  
Old January 5th, 2011, 10:25 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,338
Default Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by mstanton View Post
Ok, I have changed the AddressCopyfit rule to:
Code:
return CopyfitLine("", Field("ADDRESS"), "Alright Sans Regular", 7, 330, 6, false);
but it hasn't solved the problem I am now having where extra information shows up before the address:
Code:
<f name="Alright Sans Regular"><z newsize=7><z newsize=7>
I don't understand what you mean. Those tags are not "extra information," they're formatting commands needed to make the text appear correctly. Did you forget to check the "Treat returned strings as tagged text" box?
__________________
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 January 5th, 2011, 11:59 AM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Default Re: Help! Copyfit won't copyfit

"Treat Returned Strings..." is checked for all the rules and still, in the preview, it shows the <f name="Alright Sans Regular"><z newsize=7><z newsize=7> before the address; and nothing has been resized. I've attached a screen shot of what I'm seeing - at least I've tried to.
Attached Images
File Type: jpg Picture 1.jpg (37.2 KB, 6 views)
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3

Last edited by mstanton; January 5th, 2011 at 12:03 PM.. Reason: to attach a graphic
Reply With Quote
  #8  
Old January 5th, 2011, 01:31 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,338
Default Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by mstanton View Post
"Treat Returned Strings..." is checked for all the rules and still, in the preview, it shows the <f name="Alright Sans Regular"><z newsize=7><z newsize=7> before the address; and nothing has been resized. I've attached a screen shot of what I'm seeing - at least I've tried to.
Can you collect up your job, or at least a minimal example which demonstrates the problem, and post it?
__________________
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
  #9  
Old January 5th, 2011, 01:48 PM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Default Re: Help! Copyfit won't copyfit

Here is the collected zip file
Attached Files
File Type: zip AC-Example.zip (956.8 KB, 4 views)
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3
Reply With Quote
  #10  
Old January 11th, 2011, 07:06 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,338
Default Re: Help! Copyfit won't copyfit

The problem is in the rule named "ADDRESS", on this line:
Code:
var text = NormalizeEntities(Rule("AddressCopyfit"));
You need to remove the call to NormalizeEntities here; it's taking the markup tags generated by the "AddressCopyfit" rule and turning them into entities which cause the markup to appear literally in the output. (The "Treat returned strings as tagged text" box only affects rules used directly in text frames, not rules referenced in other rules like this.)
__________________
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
Reply

Tags
copyfit, copyfitline

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


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