{"id":127,"date":"2013-11-08T13:54:13","date_gmt":"2013-11-08T13:54:13","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/salesforce\/?p=127"},"modified":"2025-06-20T04:59:07","modified_gmt":"2025-06-20T04:59:07","slug":"pdf-export-in-salesforce","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/11\/08\/pdf-export-in-salesforce\/","title":{"rendered":"PDF Export in Salesforce"},"content":{"rendered":"\n<p>As Salesforce developers, we know that salesforce has the feature to render a page into PDF format using <b>renderAs=\u201dpdf\u201d<\/b> in &lt;apex:page&gt; tag feature. Few days back we had gone through a situation where we wanted to allow users to enter input and based on that input PDF document should be downloaded without redirecting to another page.<\/p>\n\n\n\n<p>In main page we need to set the value of <b>exportDataString<\/b>. The <b>exportDataString<\/b> is the text\/html that you need to export that we are assigning in JavaScript .<\/p>\n\n\n\n<p><span style=\"color: #800000;\"><span style=\"color: #000000;\"><em><strong>New Stuff<\/strong><\/em><\/span>:&nbsp;<\/span>&nbsp;<a title=\"Changing the date range in standard Salesforce Calendar\" href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/11\/07\/changing-the-date-range-in-standard-salesforce-calendar\/\" target=\"_blank\" rel=\"noopener\">Changing the date range in standard Salesforce Calendar<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2013\/11\/Fig.12.jpg\"><img decoding=\"async\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2013\/11\/Fig.12.jpg\" alt=\"Fig.1\" class=\"wp-image-128\"\/><\/a><\/figure><\/div>\n\n\n<p>Below is sample code for main VF page and its controller.Next we create a <b>pdfdemowrapper<\/b> Page that will be returned to the main page to download the data in PDF format.<\/p>\n\n\n\n<p>We need to create another page called <b>demo_pdfexport <\/b>showing the contents of <b>exportDataString<\/b> . Note that we have used the set <b>escape<\/b> attribute to false.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2013\/11\/Fig.2..jpg\"><img decoding=\"async\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2013\/11\/Fig.2..jpg\" alt=\"Fig.2.\" class=\"wp-image-129\"\/><\/a><\/figure><\/div>\n\n\n<p>Soon we will be writing another Blog post for Export to excel in Salesforce.<\/p>\n\n\n\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><br><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> as a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners across the globe. We offers Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that requires apex code incorporation into the Salesforce platform.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> has some unique solutions for Cloud CRM such as Salesforce integration with <a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Sage Enterprise Management (Sage X3<\/a>), Sage Intacct, <a href=\"https:\/\/www.greytrix.com\/product\/sage-100-erp\/gumu-100-salesforce-integration\">Sage 100 <\/a>and <a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/gumu-300-salesforce-integration\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM <a href=\"https:\/\/www.greytrix.com\/product\/crm-development\/salesforce-com\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/data-migration-services\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/integrated-application-development\">Integrated App development<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/custom-development\">Custom App development<\/a> and <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/maintenance-support\">Technical Support<\/a> to business partners and end users.<\/p>\n\n\n\n<p>Greytrix GUMU&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star app listed on <a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<\/p>\n\n\n\n<p>For more information, please contact us at <a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n\n\n\n<p><strong><span style=\"font-size: Medium;\">Related Posts<\/span><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a title=\"Get Key Prefix\/Object id of Object in JavaScript\" href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/11\/02\/get-key-prefixobject-id-of-object-in-javascript\/\" target=\"_blank\" rel=\"noopener\">Get Key Prefix\/Object id of Object in JavaScript<\/a><\/li>\n\n\n\n<li><a title=\"Mapping custom lead fields to standard contact fields\" href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/11\/01\/mapping-custom-lead-fields-to-standard-contact-fields\/\" target=\"_blank\" rel=\"noopener\">Mapping custom lead fields to standard contact fields<\/a><\/li>\n\n\n\n<li><a title=\"Overriding standard visual page styling in Salesforce\" href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/10\/23\/overriding-standard-visual-page-styling-in-salesforce\/\" target=\"_blank\" rel=\"noopener\">Overriding standard visual page styling in Salesforce<\/a><\/li>\n\n\n\n<li><a title=\"Assign custom object permissions to Standard User in Salesforce\" href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/06\/11\/assign-custom-object-permissions-to-standard-user-in-salesforce\/\" target=\"_blank\" rel=\"noopener\">Assign custom object permissions to Standard User in Salesforce<\/a><\/li>\n\n\n\n<li><a title=\"Mapping Custom Lead Fields in Salesforce\" href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/08\/23\/mapping-custom-lead-fields-in-salesforce\/\" target=\"_blank\" rel=\"noopener\">Mapping Custom Lead Fields in Salesforce<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>As Salesforce developers, we know that salesforce has the feature to render a page into PDF format using renderAs=\u201dpdf\u201d in &lt;apex:page&gt; tag feature. Few days back we had gone through a situation where we wanted to allow users to enter input and based on that input PDF document should be downloaded without redirecting to another\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2013\/11\/08\/pdf-export-in-salesforce\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[557,258,556],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-exportdatastring","tag-pdf-export","tag-pdf-export-in-salesforce"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":4,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":10966,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/127\/revisions\/10966"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}