Here is a odd one. I need to have invisible text in PDF’s. I therefore make the text white. In the designers design tab the text remains white but in Preview or Print the text reverts to black and changes back to the default point size of 10pt. The text is set to 7pt. Even the source code has the right values.
I can’t reproduce the issue described if I use the above code inside a blank template. I am not sure what other settings\scripts there are in the template which could trigger the issue.
To troubleshoot this, I would start by trying this code snippet inside a brand new template. If you can’t reproduce with a new template, then there probably is another script or setting which overwrites css values at run time.Then check if there are any scripts which update the DOM and its properties at run time. If you still can’t figure this out, give the element you want to turn white an ID, then change its CSS color attribute with the css() function:
In a new template with the above code the text does keep its formatting but not in the template I’m working on. What I did is add a script with a Selector #emailString. This script basically builds a string with static and variable text.
In a positioned box I added @emailString@ and put emailString in its ID on the attributes pane. I then made the positioned box conditional to only show when the Email field contains the character @.
In another template that I did a while back I did not use scripts to build the string I instead typed the static values and added the variable fields and that template is working fine. Except for the “<!” & “!>” characters that I put into two scripts as strings so that Connect would not parse them as code.
update the DOM and its properties at run time.???
give the element you want to turn white an ID, then change its CSS color attribute with the css() function
Can you elaborate on the above two quotes. Also note that my CSS knowledge is minimal.
It is now happening to a simple flysheet on another template that contains only a address block and two text scripts. i designed this template yesterday.
DOM (Document Object Model) is a structured representation of your document in HTML. Simply said it is your document HTML source code. So I meant that there could be another script which then updates this source code and css at run time or when rendering the job in preview or print.
As for the second statement, you could simply put the text you want to turn white inside a span and then give it an id:
<div><p> some text…<span id=“toWhite”> text to turn white</span> other text </p></div>
then add a script which targets the ID (selector): #toWhite and use the css() function to turn the text to white:
results.css({‘color’:‘white’});
The css() function is part of the Designer API and you can get more information regarding this function from the following link:
If you are still having issues getting this to work, please open a support ticket and attach your template for further investigation. The support team will need to look at how the document has been built and investigate other code and scripts as well as other css settings which may have an effect on the text you want to turn white.
This must be a bug in PPConnect. I started using selectors because the speed difference in Profile Scripts was massive. It is the selectors that are making the text default in preview and print. If I change back to using text (@emailString@) in the script then the text remains white in preview and print. I’m assuming you work for Objectiflune since I think I read that you worked on Talk, so can you inform them of this issue if you can try to see if this happens on your side.