account acc =[select id,name from account where id='myrecordid'];
pagereference pgref = page.mypdfpage;
pageref.getParameters().put('id',acc.Id);
pageref.setRedirect(false);
blob body;
body= pageref.getContentAsPDF();
Attachment attach = new Attachment();
attach.body = body;
attach.Name = 'myattachpage';
attach.Isprivate = false;
attach.ParentId = acc.Id;
attach.ContentType = 'pdf';
insert attach;
1 resposta

Hi Rajasekhar,Please try this Pass your Attachment Id in this<apex:repeat value="{!Case.attachments}" var="att"> <apex:panelgrid columns="1"> <h1>Image/h1> <apex:image url="{!URLFOR($Action.Attachment.Download, att.id)}"/> </apex:panelgrid></apex:repeat>I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.Thanks and Regards,Deepali Kulshrestha