View Single Post
Old April 22nd, 2022, 12:30 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,647
Default Re: Need help scaling images from url link

Originally Posted by rkury14 View Post
Should I be using a graphic window?
Yes, absolutely.
Originally Posted by rkury14 View Post
Because that would be asking for a path source which I don't have.
I don't understand what you mean by "a path source". Who is asking for that?

You can create a Graphic rule with exactly the same code as in your Text rule, and assign the rule to a Graphic frame. From the New Rule dialog, select the Graphic radio button at the top, then select Empty Rule and click Next. You can literally copy the content from your Text rule into the Graphic rule.
Originally Posted by rkury14 View Post
I have attached the zip of the fusionpro template.
Thanks. I've attached a modified version with a Graphic rule and a Graphic frame, which I think does basically what you want.

I did make a few changes to your rule to clean up some unnecessary code.

I also changed it to first look for "png". The first record doesn't find the graphic without this change. The reason is that, when it looks for the URL with a "tif" extension, the web server returns an XML document with an error instead of the graphic, but because it's returning the XML, FusionPro thinks that it did successfully download the file, but it errors when trying to handle that XML as a graphic. (At least it works this way on Mac; it might still find the right graphic when composed on Windows, such as when you submit it to Producer.)

The moral of the story here is, you shouldn't really "test" for files downloaded from the Internet by extension, the way you can for local files. Your data should include the fully-resolved URL for each graphic, with the filename extension. Then your Graphic rule can be just the one-liner I mentioned in the previous thread:
return CreateResource(Field("URL"));
Also, in FusionPro 11 and later, you can accomplish this without any rule at all, by simply changing the field type to Graphic. From the menu in Acrobat, select FusionPro -> Data Definition -> Input Options, click Edit Fields, select the field and click Edit, then set the type to Graphic and the Subtype to File name. Then you can insert assign that field directly as the variable for a graphic frame, again, without any rule at all.
Attached Files
File Type: pdf 20302_Shift_Mailer-graphic-rule.pdf (2.29 MB, 5 views)
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral

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

Complex template-building questions, as well as all installation and font questions or problems, should be directed to 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