1

i have uploaded a pdf file using document object in salesforce. i am using the below code to display that file in my browser. my requirement is to show only the first two pages of that file in the browser.

<apex:repeat var="dc" value="{!details}">
  <tr>
  <td><a target="_blank" href="https://c.ap1.content.force.com/servlet/servlet.FileDownload?file={!dc.id}" onclick="return windowpop(this.href, 545, 433)"> {!dc.Name} </a></td>
    <td>{!dc.Type}</td>
  </tr> </apex:repeat>

1 Answer 1

3

Unfortunately, this isn't possible. The browser controls how it renders a PDF. No code is loaded when that link is actually clicked. It is just a browser opening a PDF file. If you changed it to use a Visualforce page, there may be something you could do with some fancy CSS (although with renderAs="pdf" it may not work properly).

1
  • is there a solution to the above problem either with embed tag or iframe tag? Commented Sep 17, 2014 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .