{"id":576,"date":"2021-10-27T15:02:58","date_gmt":"2021-10-27T09:17:58","guid":{"rendered":"https:\/\/dearpdf.com\/?post_type=docs&#038;p=576"},"modified":"2024-01-12T12:15:22","modified_gmt":"2024-01-12T06:30:22","password":"","slug":"shortcode-options","status":"publish","type":"docs","link":"https:\/\/dearpdf.com\/docs\/shortcode-options\/","title":{"rendered":"ShortCode Options"},"content":{"rendered":"\n<p>DearPDF PDF Viewer plugin for WordPress uses shortcode to display PDFs. The shortcode can be used in various combinations to achieve your requirements.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Options<\/th><th>Description<\/th><th>Remarks<\/th><\/tr><\/thead><tbody><tr><td><code>id<\/code><\/td><td>ID of DearPDF Post or PDF attachment Post<\/td><td>Lite &amp; Pro <\/td><\/tr><tr><td><code>source<\/code><\/td><td><br>Source of the PDF file, Use if id is not available.<\/td><td>Lite &amp; Pro<\/td><\/tr><tr><td> <code>type<\/code> <\/td><td><br>Sets the type of lightbox(popup)<br>Possible values are  <code>button<\/code>, <code>thumb<\/code>, <code>link<\/code>, <code>custom<\/code><\/td><td><code>button<\/code> is available in Lite version<\/td><\/tr><tr><td><code>viewertype<\/code><\/td><td><br>Sets the Viewer Type for PDF Viewer.<br>Possible values are <code>reader<\/code> , <code>flipbook<\/code> <\/td><td>Upcoming (PRO)<\/td><\/tr><tr><td> <code>is3d<\/code> <\/td><td><br>If viewer is flipbook, turns 3D on or off.<br>Possible values are <code>true<\/code>, <code>false<\/code><\/td><td>Upcoming (PRO) <\/td><\/tr><tr><td> <code>height<\/code><\/td><td><br>Sets height of the viewer. Default value is auto. <br>Example values are  <code>100px<\/code>, <code>100%<\/code> <\/td><td>Upcoming (PRO)  <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"id\">id<\/h2>\n\n\n\n<p>You can add id of the WordPress Flipbook post or WordPress PDF attachment post to create PDF viewer using dearpdf shortcode. <\/p>\n\n\n\n<p>Example:  <code>[dearpdf id=\"12\"][\/dearpdf]<\/code> <\/p>\n\n\n\n<pre class=\"wp-block-verse\">Id of other posts will not create any viewer. It will result in: <em><span class=\"has-inline-color has-neve-link-color-color\">ERROR: Set a Valid Document Source.<\/span><\/em><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"source\">source<\/h2>\n\n\n\n<p>Instead of ID, you can add source URL PDF file to create PDF viewer using dearpdf shortcode. <em>But without ID, share links won&#8217;t work properly. They cannot open the shared page.<\/em><\/p>\n\n\n\n<p>Example:  <code>[dearpdf source=\"http:\/\/www.abc.com\/mypdf.pdf\"][\/dearpdf]<\/code> <\/p>\n\n\n\n<pre class=\"wp-block-verse\">Make sure the PDF is accessible and has proper CORS access if the file is from different domain.\n<\/pre>\n\n\n\n<p><strong>Demo:<\/strong> <div class=\"df-element dvcss dvcss_e_eyJzb3VyY2UiOiJodHRwczpcL1wvZGVhcnBkZi5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzA0XC9nbGZ3LnBkZiIsImlkIjoicmFuZDg5NDM3MTIxIiwibGlnaHRib3giOiJidXR0b24iLCJ2aWV3ZXJUeXBlIjoiZmxpcGJvb2sifQ==  \">Viewer from Source<\/div><script class=\"df-shortcode-script\" type=\"application\/javascript\">if(window.DEARPDF && window.DEARPDF.parseElements){window.DEARPDF.parseElements();}<\/script><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>With custom id: <\/strong> By using a custom id, non numeric, share URL can retarget the process of opening certain page on load:<\/p>\n\n\n\n<p><code>[dearpdf source=\"https:\/\/dearpdf.com\/wp-content\/uploads\/2021\/04\/glfw.pdf\" viewertype=\"vertical\" type=\"button\"<strong> id=\"custom_test_id\"<\/strong>]Source Type with custom ID[\/dearpdf]<\/code><\/p>\n\n\n\n<div class=\"df-element dvcss dvcss_e_eyJzb3VyY2UiOiJodHRwczpcL1wvZGVhcnBkZi5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzA0XC9nbGZ3LnBkZiIsImlkIjoidGVzdF9pZCIsImxpZ2h0Ym94IjoiYnV0dG9uIiwidmlld2VyVHlwZSI6InZlcnRpY2FsIn0=  \">Source Type with custom ID<\/div><script class=\"df-shortcode-script\" type=\"application\/javascript\">if(window.DEARPDF && window.DEARPDF.parseElements){window.DEARPDF.parseElements();}<\/script>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"type\">type<\/h2>\n\n\n\n<p>With type option you can determine what kind of lightbox(popup) trigger will be created.<\/p>\n\n\n\n<p>Example:  <code>[dearpdf id=\"12\" type=\"button\"][\/dearpdf]<\/code> <\/p>\n\n\n\n<p>Possible values are <code>button <\/code>, <code>thumb<\/code> (PRO), <code>link<\/code> (PRO), <code>custom<\/code> (PRO)\n<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"viewer-type\">viewertype (PRO)<\/h2>\n\n\n\n<p>Sets the Viewer Type for PDF Viewer.  <\/p>\n\n\n\n<p>Example:  <code>[dearpdf id=\"12\" viewertype=\"reader\"][\/dearpdf]<\/code> <\/p>\n\n\n\n<p>Possible values are <code>reader<\/code> , <code>flipbook<\/code> <\/p>\n\n\n\n<p><strong>Demo:<\/strong><\/p>\n\n\n\n<div class=\"df-element dvcss dvcss_e_eyJzb3VyY2UiOiJodHRwczpcL1wvZGVhcnBkZi5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzA0XC9nbGZ3LnBkZiIsImlkIjoicmFuZDEzNjg1MTk1NzEiLCJsaWdodGJveCI6ImJ1dHRvbiIsInZpZXdlclR5cGUiOiJmbGlwYm9vayJ9  \">Viewer Type Flipbook<\/div><script class=\"df-shortcode-script\" type=\"application\/javascript\">if(window.DEARPDF && window.DEARPDF.parseElements){window.DEARPDF.parseElements();}<\/script>\n\n\n\n<div class=\"df-element dvcss dvcss_e_eyJzb3VyY2UiOiJodHRwczpcL1wvZGVhcnBkZi5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzA0XC9nbGZ3LnBkZiIsImlkIjoicmFuZDcxNzQ1MDI2OCIsImxpZ2h0Ym94IjoiYnV0dG9uIiwidmlld2VyVHlwZSI6InZlcnRpY2FsIn0=  \">Viewer Type Vertical<\/div><script class=\"df-shortcode-script\" type=\"application\/javascript\">if(window.DEARPDF && window.DEARPDF.parseElements){window.DEARPDF.parseElements();}<\/script>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"is3d-pro\">is3d (PRO)<\/h2>\n\n\n\n<p> If viewer is flipbook, turns 3D on or off.   <\/p>\n\n\n\n<p>Example:  <code>[dearpdf id=\"12\" viewertype=\"flipbook\" is3d=\"true\"][\/dearpdf]<\/code> <\/p>\n\n\n\n<p>Possible values are <code>true<\/code>, <code>false<\/code> <\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"height-pro\">height (PRO)<\/h2>\n\n\n\n<p> Sets height of the viewer. It only applies to embedded viewer. Lightboxes(buttons\/thumb popups) always use 100% height of the browser screen when open in popup.<\/p>\n\n\n\n<p>Example:  <code>[dearpdf id=\"12\" height=\"500px\"][\/dearpdf]<\/code> <\/p>\n\n\n\n<p> Example values are  <code>100px<\/code>, <code>100%<\/code>  \n<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DearPDF PDF Viewer plugin for WordPress uses shortcode to display PDFs. The shortcode can be used in various combinations to achieve your requirements. Options Description Remarks id ID of DearPDF Post or PDF attachment Post Lite &amp; Pro source Source of the PDF file, Use if id is not available. Lite &amp; Pro type Sets&hellip;&nbsp;<a href=\"https:\/\/dearpdf.com\/docs\/shortcode-options\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">ShortCode Options<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"doc_category":[6],"doc_tag":[],"class_list":["post-576","docs","type-docs","status-publish","hentry","doc_category-customizations"],"year_month":"2026-05","word_count":452,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"admin","author_nicename":"admin_l5enayeh","author_url":"https:\/\/dearpdf.com\/author\/admin_l5enayeh\/"},"doc_category_info":[{"term_name":"Customizations","term_url":"https:\/\/dearpdf.com\/docs-category\/customizations\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/docs\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":55,"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/docs\/576\/revisions"}],"predecessor-version":[{"id":1217,"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/docs\/576\/revisions\/1217"}],"wp:attachment":[{"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/media?parent=576"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/doc_category?post=576"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/dearpdf.com\/wp-json\/wp\/v2\/doc_tag?post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}