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
Shaker Kuncham 1Shaker Kuncham 1 

Getting blank PDF without content (using VF Template )

Original question:
Hi All

I have creaed approval process on custom object where i need to submit a PDF document for approval process. Once I attached the PDF file and submitted for Approval, am geeting email  with PDF, however without content, getting blank PDF.
Below is my code for VF email template. Please suggest....

<messaging:emailTemplate subject="Document Submitted" recipientType="User" relatedToType="Compliance_Documents__c">
<apex:image url="/servlet/servlet.FileDownload?file=015W0000000Dmru"
height="64" width="64"/>
    <messaging:htmlEmailBody >
        <img src=""/>
            <p>Dear {!},</p>
            <p>Attached is document related to Compliance Document "{!relatedTo.Compliance_Document_Name__c} ". </p>
            <p>Please Review the document and <B> Approve/Reject.</B> To approve or reject this item, click this link </p>
                <apex:outputLink value="{!}">
                    Approve / Reject
                <Br/><Br/>or <Br/><Br/>
                <B> To Approve through email :</B> reply to this email with one of these words in the first line of the email message: APPROVE, APPROVED.
                <B> To Reject :</B> Please click on the above link.
                <B>For Comments: </B>
If replying via email, you can also add comments on the second line. Comments will be stored with the approval request in Salesforce CRM.
            <br/> <br/>
           <b> Previous approval history </b>

        <c:ApprovalItem recordId="{!relatedTo.Id}" />
            Kind Regards, <br/>
            Document Compliance Team
    <messaging:attachment filename="{!}" renderAs="PDF">
        <apex:repeat var="cx" value="{!}">