I am working on a contract module in package. As you all know contract for diffreant companies are diffrent, I mean their logo, their way of data representation etc.
So I am createing a vf page which shows contract details to user. How can I create a vf page that can change its content.
I am thinking of saving an word file of contract and then reading it in visualforce page.
Visualforce Page
<apex:page controller="UploadDocumentController" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel value="Resume" />
<apex:outputPanel >
<div class="requiredInput">
<div class="requiredBlock"></div>
<apex:inputFile value="{!attachment1Blob}" /><br/>
<div class="note"> doc, docx, txt, and pdf. Max 800 KB </div>
</div>
</apex:outputPanel>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:commandButton value="Save" action="{!save}"/>
<apex:outputText value="{!tempString}"></apex:outputText>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller
public with sharing class UploadDocumentController {
transient public Blob attachment1Blob {get;set;}
public String tempString {get;set;}
Public void save(){
Document resume = new Document();
tempString= EncodingUtil.base64Encode(attachment1Blob);
system.debug('##'+tempString);
resume.body = attachment1Blob;
resume.name = 'test';
resume.Folderid = UserInfo.getUserId();
insert resume;
}
}
I have tried this but getting a long string as 0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAACAAAAtgAAAAAAAAAAEAAAuAAAAAEAAAD+////AAAAALQAAAC1AAAA//////////////// in output
How can I read the content of visualforce page and display in visualforce page. Also how can I embed my values from controller to visualforce page.
Please help, Thanks in advance