Jump to content

Background Color


jl_arnold

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 6 years later...
On 2/3/2017 at 1:26 AM, jl_arnold said:

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

How can I change the font color of a text field in MarcomCentral that is populated with a Text Resource? please let me know, I know this is an old discussion but the answer to my question is very important I am appealing to the admin. Please approve my post, Thanks

 

Link to comment
Share on other sites

One way you could do this is by adding two new fields to your data file (in this example we’ll call them simply “Font” and “Color”). When this is uploaded to the manager you will configure these as dropdowns that the client can choose from.

From here you either hard code the fonts/colors you want into the template itself – or – if you want to add more colors/etc in the future, you can put these in an XDF (external data file) and write a rule that calls on those columns. The XDF method gives you the most flexibility, but In the interest of time, I’m just going to explain the first option.

After you’ve created the new Font and Color fields, you can write a rule that will look something like the following:

//This rule applies your font choice to your RTE field (for this example, it’s just called paragraph)

var mycolor = Field("Color");
var myfont = Field(“Font”);

if (Field(Paragraph) != “”)
            {
            return '<f name="'+myfont+'">'  + '<color name = "'+mycolor+'">' + Field(Paragraph);
            }

else
            {
return “”;
}

Note: your fonts names and color names in the data file (and in the dropdowns in marcom) must EXACTLY match the name of the colors and fonts as found in the template. Try this and let us know if it works for you. 
 

Link to comment
Share on other sites

Hi Kumas, do  you mean you are bringing in a formatted text resource? If so, you can make a new color (call it placeholder) and make the text you want to change the color called placeholder.

You can then redefine the definition of placeholder in a rule. There is a form rule called Color from Data:

 

image.png.02eac2a24396667b3be4744951ce6cd8.png

 

The field can be a color definition such as 0 0 100 0 (for yellow) for 00FF00 (for green)

Let us know if this helps.

 

 

Link to comment
Share on other sites

21 hours ago, Douglas Cogan said:

Hi Kumas, do  you mean you are bringing in a formatted text resource? If so, you can make a new color (call it placeholder) and make the text you want to change the color called placeholder.

You can then redefine the definition of placeholder in a rule. There is a form rule called Color from Data: g

 

image.png.02eac2a24396667b3be4744951ce6cd8.png

 

The field can be a color definition such as 0 0 100 0 (for yellow) for 00FF00 (for green)

Let us know if this helps.

 

 

thanks, Douglas Cogan

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...