jl_arnold Posted February 1, 2017 Share Posted February 1, 2017 Hello, I have a very straight forward template that will have two fields, Code and Color. Code is a text field. Color will be the background color to the entire document. We want to allow users to choose ANY color they want. So in Indesign, I added the Pantone uncoated swatch library and exported it to my FusionPro PDF. I currently have the field Color as a graphic field. I want to know the best way to setup the Color option. I was initially thinking the Color field as a graphic field and just allowing users to select a colored graphic "Swatch" from a gallery. These were just generic PNG files that were color squares. I used these more as a test to ensure the small files worked fined to color the background. The only issue I have with the gallery is that I now need to extracted the embedded colors from the PDF or InDesign file to PNG files to upload to an Image Library. If I can figure out an easy way to export one file for each swatch, this way should work well. However, since I also have all the colors embedded in the PDF, I was wondering if there was a better way to allow users to select the color background. Let me know if there are any quick tips you can provide. I know there are several ways to do this, but with the number of color options we want to provide, I am just looking for any options that avoid manually defining each color setting. Thanks! Jason Quote Link to comment Share on other sites More sharing options...
jl_arnold Posted February 2, 2017 Author Share Posted February 2, 2017 I went with graphic files for colors. However, I'm trying to allow editing the font color. The user is able to enter text and change the font of the "Code" text field in MarcomCentral. The other text is fixed, but the text color needs to change as well. The text is formatted, so I am using a Text Resource named Page1res. I have set my Font Format feature in MarcomCentral to allow users to change the font color of the text fields. However, I am using a Switch rule for the Page1 field so that it displays the Page1res resource formatted content. The only issue with this is the Resource maintains the font color in the resource and does not apply the font color from the Page1 field. I think I'm only missing a small portion of the code needed. switch (Field("Page1")) { case "": return Resource("Page1res"); default: return Resource("Page1res"); } I've tried working with the some of the raw text functions, but I lose all formatting that way. Can you help me set the Resource("Page1res") font color to be the selected choice from the user in MarcomCentral? Thanks! Jason Quote Link to comment Share on other sites More sharing options...
jl_arnold Posted February 2, 2017 Author Share Posted February 2, 2017 Created multiple fields and rules. Could not use with MarcomCentral features. Issue resolved with manual setting all individual color options for graphics and colors. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 3, 2017 Share Posted February 3, 2017 From a FusionPro standpoint, you definitely do not need to make a bunch of files for each color. You can programmatically set the fill color of any frame in OnRecordStart, like so: var myFrame = FindTextFrame("MyFrameName"); // or FindGraphicFrame myFrame.fillColorName = "Red"; // or: myFrame.fillColorName = Field("ColorName"); //optionally: myFrame.fillColorPercent = 50; If the data has color values instead of percentages, such as RGB or CMYK, then you can create a new FusionProColor object and use that for the frame's fill color. For example: var customColor = new FusionProColor("custom name", Field("cyan"), Field("yellow"), Field("magenta"), Field("black")); // or: var customColor = new FusionProColor("custom name", "RGB", Field("red"), Field("green"), Field("blue")); var myFrame = FindTextFrame("MyFrameName"); // or FindGraphicFrame myFrame.fillColorName = "custom name"; Or you can parse out the color values if they're in something like hex digits in the data. Now, how to present the color options to the end user is a different question. In order to help with that, I first need to know exactly where the user will be doing this selection. Is this in MarcomCentral? Or in another web-to-print application such as EFI Digital StoreFront? Or something else? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 3, 2017 Share Posted February 3, 2017 I went with graphic files for colors. However, I'm trying to allow editing the font color. The user is able to enter text and change the font of the "Code" text field in MarcomCentral. The other text is fixed, but the text color needs to change as well. The text is formatted, so I am using a Text Resource named Page1res. I have set my Font Format feature in MarcomCentral to allow users to change the font color of the text fields. However, I am using a Switch rule for the Page1 field so that it displays the Page1res resource formatted content. The only issue with this is the Resource maintains the font color in the resource and does not apply the font color from the Page1 field. I think I'm only missing a small portion of the code needed. switch (Field("Page1")) { case "": return Resource("Page1res"); default: return Resource("Page1res"); } I've tried working with the some of the raw text functions, but I lose all formatting that way. Can you help me set the Resource("Page1res") font color to be the selected choice from the user in MarcomCentral? Thanks! Jason This is really a separate question, which should be in its own thread. But generally, a Formatted Text Resource contains a <color> tag, which you can see if you use the View Source button. So putting another <color> tag out before the resource won't do anything. You could use a <span color=***> tag instead. But I would need to see the job files in order to offer more specific suggestions. Again, a separate thread would be best. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.