zoukankan      html  css  js  c++  java
  • Salesforce随笔: 将Visualforce Page渲染为PDF文件(Render a Visualforce Page as a PDF File)

    参照 : Visualforce Developer Guide 第60页 <Render a Visualforce Page as a PDF File>

    你可以用PDF渲染服务生成一个可以下载或者打印为PDF 文件的 Visualforce Page.

    通过更改<apex:page>标签属性将页面转换为PDF。

    1 <apex:page renderAs="pdf">

    已经被渲染为PDF文件的VF Page,是被显示在浏览器页面中还是被下载成为文件,这个行为取决于浏览器设置,不受Visualforce控制.

    下记是包含Account情报且渲染为PDF文件的页面代码:

     1 <apex:page standardController="Account" renderAs="pdf">
     2 <apex:stylesheet value="{!URLFOR($Resource.Styles,'pdf.css')}"/>
     3 <h1>Welcome to Universal Samples!</h1>
     4 <p>Thank you, <b><apex:outputText value=" {!Account.Name}"/></b>, for
     5 becoming a new account with Universal Samples.</p>
     6 <p>Your account details are:</p>
     7 <table>
     8 <tr><th>Account Name</th>
     9 <td><apex:outputText value="{!Account.Name}"/></td>
    10 </tr>
    11 <tr><th>Account Rep</th>
    12 <td><apex:outputText value="{!Account.Owner.Name}"/></td>
    13 </tr>
    14 <tr><th>Customer Since</th>
    15 <td><apex:outputText value="{0,date,long}">
    16 <apex:param value="{!Account.CreatedDate}"/>
    17 </apex:outputText></td>
    18 </tr>
    19 </table>
    20 </apex:page>
    例2

    A Visualforce Page Rendered as a PDF File

  • 相关阅读:
    python for selenium 数据驱动测试
    iframe 处理
    百度登录、退出示例
    js弹框处理
    window.alert弹出处理
    通过网页内容识别和处理弹出窗口
    通过识别标题处理弹出窗口
    通过名称识别和处理弹出窗口
    发现github官网进不去了
    开发环境的搭建-记录一下
  • 原文地址:https://www.cnblogs.com/qiaosx/p/10330241.html
Copyright © 2011-2022 走看看