how can i hide the component in pdf if the value/input is empty
UPDATE
There is now a "PDF Visibility" option available for all components. This option will allow you to select between visible, hidden and Hide if empty. So, to hide a component in the PDF if the input is empty you can simply tick the "Hide if empty" option.
To hide a component in the generated pdf only when it has no value you can use the advanced conditional feature to dynamically hide the component.
The instance.isHtmlRenderMode()
function will return true
for PDF rendering and the instance.getValue()
function will return the value of the component. Combining this into a conditional expression will allow you to hide the component in the PDF if there is no response to it as shown below.
if(instance.isHtmlRenderMode() && !instance.getValue()) show = false
UPDATE
There is now a "PDF Visibility" option available for all components. This option will allow you to select between visible, hidden and Hide if empty. So, to hide a component in the PDF if the input is empty you can simply tick the "Hide if empty" option.