You need to sign in to do that
Don't have an account?
Lukasz Piziak
VF PDF Page - Controlling Each Line Individually.
Hi,
I have requirement to create a simple VF page rendered as PDF with two text lines only. So far I was able to create VF page + controller + custom button. My question is how I can controll my text lines separeatelly in sense of text alligment, font size and font colour? I have produced a css style sheet which actually is controlling the whle page behaviour. Please see below my VF Page and CSS style sheet.
VF
<apex:page standardController="SCMC__Receipt_Line__c" extensions="ReceiptLineController" renderAs="PDF" showHeader="false" sidebar="false">
<apex:styleSheet value="{!URLFOR($Resource.Label)}" />
<apex:panelGrid columns="1">
<apex:outputField value="{!receipt.SCMC__Item_Number__c}"/>
<apex:outputField value="{!receipt.SCMC__Item_Description__c}"/>
</apex:panelGrid>
</apex:page>
CSS Style Sheets
@page {
size: 3.93in 1.14in;
margin:8px 8px 8px 8px;
}
body {
font-family: sans-serif;
font-size: 125%;
text-align: left;
}
Thanks for any help.
I will appreciate any help with exact explannation as I'm very new to the VF.
Regards,
Lukasz
I have requirement to create a simple VF page rendered as PDF with two text lines only. So far I was able to create VF page + controller + custom button. My question is how I can controll my text lines separeatelly in sense of text alligment, font size and font colour? I have produced a css style sheet which actually is controlling the whle page behaviour. Please see below my VF Page and CSS style sheet.
VF
<apex:page standardController="SCMC__Receipt_Line__c" extensions="ReceiptLineController" renderAs="PDF" showHeader="false" sidebar="false">
<apex:styleSheet value="{!URLFOR($Resource.Label)}" />
<apex:panelGrid columns="1">
<apex:outputField value="{!receipt.SCMC__Item_Number__c}"/>
<apex:outputField value="{!receipt.SCMC__Item_Description__c}"/>
</apex:panelGrid>
</apex:page>
CSS Style Sheets
@page {
size: 3.93in 1.14in;
margin:8px 8px 8px 8px;
}
body {
font-family: sans-serif;
font-size: 125%;
text-align: left;
}
Thanks for any help.
I will appreciate any help with exact explannation as I'm very new to the VF.
Regards,
Lukasz
Maybe code like this...
If that doesn't work - wrap the outputFields in Div's
Thanks for code, I have tried and nothing is cjanging on the preview. I have changed text-align to right and still text is on the left side,
Wold you please advise of how I can wrap this text in Div's? Thanks
<apex:page standardController="SCMC__Receipt_Line__c" extensions="ReceiptLineController" renderAs="PDF" showHeader="false" sidebar="false">
<apex:outputField value="{!receipt.SCMC__Item_Number__c}" style="font-size:14pt;text-align:right;" />
<br/>
<apex:outputField value="{!receipt.SCMC__Item_Description__c}" style="font-size:14pt;text-align:left;" />
</apex:page>
Maybe something like that?