Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

suppress blank line

Avatar

Former Community Member
My project is to create a web-to-print solution for business cards.



On the LEFT side:



NAME

Title



[Few blank lines}

Address1

Address2

Address3

Web url



On the RIGHT side:

Phone

Fax

Cell

Email

AIM



I layout the business card in PDF (using designer) and the web front end Im using ColdFusion with CF_PDFForm by Ben Forta ( http://www.forta.com/blog/index.cfm/2006/7/27/cf_pdfform) which uses LiveCycle XPAJJ.



This is where I'm stuck: if a user does not enter a fax number... I want the PDF preview to move phone: down 1 line and not show the word 'fax'.



I want to suppress a line with title if its blank.



Is this possible? Can I use ONE master template with all the field design and then format base on the information thats entered in the form?



Thanks in advance for any help. Also, if youre available to work on this; Id pay for your time.
1 Reply

Avatar

Level 5
I will give you simplest solution for you to understand.

1. Hide all the right side fields using Object pallet>>field tab>>visible property

2. Add new textField with name ContactInfo set multi line property and make it visible. Using paragraph pallet select push Bottom.



Then represented value is prepared dynamically based on the fetched values like in the following JavaScript example.



I would use the following code in initialize event for ContactInfo assuming you used following names for the fields that you make invisible earlier Phone, Fax, Cell, Email, AIM



var makeOutput = "";

if (!AIM.isNull) {

makeOutput = "AIM " + AIM.rawValue;

}

if (!Email.isNull) {

if (makeOutput != "") {

makeOutput = "Email " + Email.rawValue + "\n" +makeOutput;

}else {

makeOutput = "Email " + Email.rawValue;

}

}

if (!Cell.isNull) {

if (makeOutput != "") {

makeOutput = "Cell " + Cell.rawValue + "\n" +makeOutput;

}else {

makeOutput = "Cell " + Cell.rawValue;

}

}

if (!Fax.isNull) {

if (makeOutput != "") {

makeOutput = "Fax " + Fax.rawValue + "\n" +makeOutput;

}else {

makeOutput = "Fax " + Fax.rawValue;

}

}

if (!Phone.isNull) {

if (makeOutput != "") {

makeOutput = "Phone " + Phone.rawValue + "\n" +makeOutput;

}else {

makeOutput = "Phone " + Phone.rawValue;

}

}

this.rawValue = makOutput;



Good luck,

SekharN.