Many thanks
public PageReference redirectQ(id qid){
System.debug('STARTING redirectQ: '+qid);
quote q = [SELECT id, name FROM QUOTE WHERE id=:qid];
System.debug('quote q: '+ q);
PageReference QuotePage = new PageReference(qid);
System.debug('QuotePage: ' + QuotePage);
QuotePage.setRedirect(true);
return QuotePage;
}
Here's a catch! From the vf page, savePDF button is getting called but, this method is returning void. You need to either write the code of redirectQ method inside the savePDF method or simply call the redirectQ method as following with changing the return type from void to Pagereference of the savePDF method.
public Pagereference savePDF() {
//Your existing logic
return redirectQ(aid);
}