I have a visualforce page renderas="PDF".
But I need to attach this pdf to a record in custom object.
I have custom button to open this pdf but this is just enabled if the checkbox field in record=true.
How can I create this button just if checkbox = true and attach the pdf?
If can help me I appreciate.