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 & 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]
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 Verticalis3d (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%
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?
Keep it within the shortcode.
Example:
[dearpdf id="123"]Your text can go here[/dearpdf]
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.
Please share the link to your page. We will check which version you are using and please add the syntax you have used.
It is working in our version:
https://dearpdf.com/popup-examples/#button_popup
Third button
[dearpdf id="189" type="button"]Open Meat Atlas[/dearpdf]
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.
Hi,
Please share the link to your page so that we can check.
https://lakerlutznews.com/lln/e-editions-land-o-lakeslutz/
code used:
[dearpdf type= "link" source= "https://lakerlutznews.com/lln/wp-content/uploads/E_Editions/2022/LOL/landolakes011222.pdf"]January 12, 2022[/dearpdf]
[dearpdf type= "link" source= "https://lakerlutznews.com/lln/wp-content/uploads/E_Editions/2022/LOL/landolakes010522.pdf"]January 5, 2022[/dearpdf]
This should be recreatable.
Hi,
Thanks for your feedback and link.
Please try updating to version 1.1.77
Much better, works with version 1.1.77, Thank you for your QUICK response.
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?
Hi,
Please try upgrading to 1.1.80
Best Regards,
DearHive
Can I close the download file via shortcode?
Hi,
No this is not available through shortcode.
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
Yes it is working in PRO.
We updated the page with some examples:
https://dearpdf.com/docs/shortcode-options/#viewer-type
Hi there, how do I make the thumbnail size bigger?
https://dearpdf.com/docs/customizing-popup-thumbs/
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?
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.