+ Start a Discussion

How to get printable view when clicked on Custom Button for a VF page which renders as PDF.

My VF Page:
<apex:page controller="MyController" renderAs="{!isPDF}" applyBodyTag="false" >

    body { font-family: 'Arial Unicode MS'; }

        size: letter;
            content: "My Content";
            font-family: Helvetica, Arial, sans-serif;
            font-size: 24px;
            font-weight: bolder;
            content: "Yours Sincerely,";
            font-family: Helvetica, Arial, sans-serif;
            font-size: 10px;
body {
        font-family: Helvetica, Arial, sans-serif;
        font-size: 14px;
    <div align="right"><strong>Date</strong>: {!DAY(Today())} {!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')} {!YEAR(Today())}</div>
    <div align="left">Dear,</div>
 <p>My Text</p>

    <p>My Text</p>    


The above VF page renders as PDF, a custom button PDF is created for it.


This shoes a PDF of the VF page req when the button is clicked. Now I need the same pdf in print view (CTRL+P) when the pdf button is clicked.
So I have changed window.open to window.print("apex/Letter?Id={!Letter__c.Id}","_blank"); , but the print view which i got is of the current page not the pdf rendered.

Can anyone just help or guide me on how to generate print view when my pdf button is clicked

Raj VakatiRaj Vakati
I dnt think so you can able to do it with the same page .. 

Refer this link 

sd asssd ass
What is the best way to integrate the whole script in dynamic website (https://www.footwearguider.com/best-basketball-shoes-for-wide-feet/)?