Last active
February 16, 2018 12:28
-
-
Save kevanmoothien/9be28563888f10736aea3293c51af920 to your computer and use it in GitHub Desktop.
Render a Visualforce as Pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page standardController="Contact" | |
applyHtmlTag="false" | |
showHeader="false" | |
renderAs="pdf"> | |
<html> | |
<head> | |
<style> | |
@page { | |
size: 6.4in 4.5in; | |
} | |
.center { | |
margin: auto; | |
width: 60%; | |
padding: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<div> | |
<img src="https://kevan-dev-ed--c.eu15.content.force.com/servlet/servlet.ImageServer?id=0151p000004v4JH&oid=00D24000000e1d4&lastMod=1518775947000" /> | |
</div> | |
<apex:outputPanel layout="block" styleClass="center"> | |
<apex:outputText value="{! Contact.Name }"></apex:outputText> | |
<br/> | |
<apex:outputText value="{! Contact.MailingStreet }"></apex:outputText> | |
<br/> | |
<apex:outputText value="{! Contact.MailingCity }"></apex:outputText> | |
, | |
<apex:outputText value="{! Contact.MailingState }"></apex:outputText> | |
| |
<apex:outputText value="{! Contact.MailingPostalCode }"></apex:outputText> | |
<br/> | |
<apex:outputText value="{! Contact.MailingCountry }"></apex:outputText> | |
<br/> | |
<apex:outputText value="{! Contact.Phone }"></apex:outputText> | |
</apex:outputPanel> | |
</body> | |
</html> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment