0

I have a requirement to display attachment image in the word document, word document is generating from visual force page.

When i have created a visual force page with tag "apex:image url="/servlet/servlet.FileDownload?file={!attSigRec.Id}"/>" attachment i am querying in the constructor. Which is working as expected as i am able to see attachment image in the visual force page.

When i converted that page into word with "contentType="application/msword#GenerateProposal.doc"" the downlaoded document doesn't showing the image.

How can solve this?

Please help me on this thanks in advance.

  • contentType="application/msword#GenerateProposal.doc does not convert the page into Microsoft Word. It renders HTML and saves it with a .doc extension. You should be able to open the downloaded file and inspect its contents. What do you see? Are the image links accessible without an active Salesforce sessions? Are they correct? – David Reed Dec 5 '18 at 14:07
  • ok Thanks for the reply, right now i am getting braked images like with cross mark. – Ramesh Kopparapu Dec 6 '18 at 4:57
  • Can any one solve this please or needed any more explanation? – Ramesh Kopparapu Dec 12 '18 at 5:48
0

It's not possible to add attachment content directly in pdf/word generation visualforce page.

The alternative solution we created is creating a document for the attachment content and copying content from document.

In that way it is working fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.