Skip to content
View Categories

ShortCode Options

1 min read

DearPDF PDF Viewer plugin for WordPress uses shortcode to display PDFs. The shortcode can be used in various combinations to achieve your requirements.

OptionsDescriptionRemarks
idID of DearPDF Post or PDF attachment PostLite & Pro
source
Source of the PDF file, Use if id is not available.
Lite & Pro
type
Sets the type of lightbox(popup)
Possible values are button, thumb, link, custom
button is available in Lite version
viewertype
Sets the Viewer Type for PDF Viewer.
Possible values are reader , flipbook
Upcoming (PRO)
is3d
If viewer is flipbook, turns 3D on or off.
Possible values are true, false
Upcoming (PRO)
height
Sets height of the viewer. Default value is auto.
Example values are 100px, 100%
Upcoming (PRO)

id #

You can add id of the WordPress Flipbook post or WordPress PDF attachment post to create PDF viewer using dearpdf shortcode.

Example: [dearpdf id="12"][/dearpdf]

Id of other posts will not create any viewer. It will result in: ERROR: Set a Valid Document Source.

source #

Instead of ID, you can add source URL PDF file to create PDF viewer using dearpdf shortcode. But without ID, share links won’t work properly. They cannot open the shared page.

Example: [dearpdf source="http://www.abc.com/mypdf.pdf"][/dearpdf]

Make sure the PDF is accessible and has proper CORS access if the file is from different domain.

Demo: Viewer from Source

With custom id: By using a custom id, non numeric, share URL can retarget the process of opening certain page on load:

[dearpdf source="https://dearpdf.com/wp-content/uploads/2021/04/glfw.pdf" viewertype="vertical" type="button" id="custom_test_id"]Source Type with custom ID[/dearpdf]

Source Type with custom ID

type #

With type option you can determine what kind of lightbox(popup) trigger will be created.

Example: [dearpdf id="12" type="button"][/dearpdf]

Possible values are button , thumb (PRO), link (PRO), custom (PRO)


viewertype (PRO) #

Sets the Viewer Type for PDF Viewer.

Example: [dearpdf id="12" viewertype="reader"][/dearpdf]

Possible values are reader , flipbook

Demo:

Viewer Type Flipbook Viewer Type Vertical

is3d (PRO) #

If viewer is flipbook, turns 3D on or off.

Example: [dearpdf id="12" viewertype="flipbook" is3d="true"][/dearpdf]

Possible values are true, false


height (PRO) #

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.

Example: [dearpdf id="12" height="500px"][/dearpdf]

Example values are 100px, 100%


19 thoughts on “ShortCode Options”

  1. How can I set the button label text? I do not want it to be the same as the post title. I thought there would be an option in the shortcode like title=’Performance’. What are my options?

  2. I did try that because I figured it should work that way, but it shows the title of the post and text within the shortcode. So it displays PerformancePerformance on my button.

  3. When using two shortcodes on the same page It only displays the last one. Both are different when displayed separately. When together January 12 looks like January 5

    [dearpdf type= "link" source= "https://xxx/wp-content/uploads/E_Editions/2022/LOL/landolakes011222.pdf"]January 12, 2022[/dearpdf]

    [dearpdf type= "link" source= "https://xxx/wp-content/uploads/E_Editions/2022/LOL/landolakes010522.pdf"]January 5, 2022[/dearpdf]

    Source= fits my needs, but not working the way I think it should.

  4. Notice: Undefined index: thumb-layout in /var/www/vhosts/bertvogels.nl/httpdocs/wp-content/plugins/dearpdf-pro/dearpdf-pro.php on line 860

    I see this line on my website, what is wrong?

  5. Hi,

    is this working on PRO version?

    viewertype
    Sets the Viewer Type for PDF Viewer.
    Possible values are reader , flipbook Upcoming (PRO)

    We need this usage:

    [dearpdf source= "https://www.website.com/link-to-pdf.pdf" viewertype="flipbook"]

    Cheers

  6. In flipbook mode it will show side by side pages, but the same file in viewer mode I cannot make it show side by side, even when the pdf “Initial View” has been set in Adobe Acrobat to “Double page (with cover)”. Is there any way to do side by side in Viewer mode?

    1. Sided by side mode is what flipbook provides. Viewer mode won’t have side by side mode.
      Adobe reader doesn’t have flipbook so side by side mode make sense there.

Leave a Reply

Your email address will not be published. Required fields are marked *