+ Start a Discussion
dwwrightdwwright 

Displaying PDF attachments when using renderas="pdf"

I have a custom object which serves as a data entry form. The "output" of this object is a visualforce page that displays the fields niceley formatted and set to renderas="pdf". A requirement I have is for users to be able to attach pdfs to this object and print them along with the contents of the object itself. I need to be able to display the attached pdf's in the visualforce page. Currently I'm attempting to do it using the following code:

 

<apex:repeat var="att" value="{!Quality_Document__c.attachments}">
<apex:iframe src="/servlet/servlet.FileDownload-file={!att.Id}"/>
</apex:repeat>

 

 Where Quality_Document__c is my custom object. When I try this, the pdf page displays nothing. When I remove the renderas="pdf", it shows whitespace. If anybody has any ideas as to why this is, or has suggestions for alternate methods of doing this, please let me know!

 

Message Edited by dwwright on 03-04-2010 11:10 AM