function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Quentin HenrotteQuentin Henrotte 

Change value from PDF render

Hello, I want to change an outputText value in my Visualforce page. I used this : 
<apex:outputText id="theText" value="bye"/>

<script>
document.getElementById('{!$Component.theText}').innerHTML = 'hello';
</script>
It's working well in a HTML render but it doesn't work for PDF, Do you ave an answer about this ? Thx
 
Best Answer chosen by Quentin Henrotte
Yiming ShenYiming Shen
Hi Quentin,
When your visualforce page is rendered as PDF, JavaScript code will be ignored due to PDF is not rendered by browser.
PDF is designed for data presentation and download.
So I think your idea could not be implemented in PDF, maybe you can try controller.
Good luck.

All Answers

Yiming ShenYiming Shen
Hi Quentin,
When your visualforce page is rendered as PDF, JavaScript code will be ignored due to PDF is not rendered by browser.
PDF is designed for data presentation and download.
So I think your idea could not be implemented in PDF, maybe you can try controller.
Good luck.
This was selected as the best answer
Quentin HenrotteQuentin Henrotte
Thank you