Once the plug-in is successfully installed and activated in WordPress (this is straightforward – see the installation instructions if needed), you can embed your document into either a page or a post using the syntax below. GDE integrates with the WordPress visual editor, and to a lesser degree the Media Library and HTML (text) editor, to automate many of these functions.
[gview file="http://full-path.to/file.pdf"]
The shortcode uses the following attributes. For information about setting defaults (so you don’t have to use most of these shortcode options), see the Settings page.
file= |
(required) The fully qualified URL pointing to the file you wish to embed. If many of your files start with the same root directory, you can set a File Base URL in your viewer profile and only enter the unique part of the filename here instead of the full URL. |
width= |
(optional) Enter a number (in px) or a percent value to override the program’s default document width. |
height= |
(optional) Enter a number (in px) or a percent value to override the profile’s default document height. Because of the way CSS works, you probably want to enter a pixel value here as a percentage may not function as you expect. |
page= |
(optional) Specify a page number to begin viewing the embedded document. |
profile= |
(optional) Enter the profile ID or name from the profile list for the settings you want to use for the document. If none is specified, the default profile is used. |
save= |
(optional) Enter a value (1 to show, 0 to hide) to override the default display setting for the download link. Note that this setting is ignored on private documents. |
cache= |
(optional) Add cache="0" to disable integrated document caching (useful only for frequently overwritten files). |
authonly= |
(deprecated) Add authonly="1" to only show the download link to logged-in users on an individual file. This feature will be removed in a future version as it is now redundant; please set your download link preferences in your viewer profiles instead. |
lang= |
(deprecated) Enter a supported language’s ISO 639-1 Language Code to override the global Default Language setting. This feature will be removed in a future version as it is now redundant; please set your language preferences in your viewer profiles instead. |
force= |
(removed) This feature is no longer relevant or supported in GDE 2.5+. If needed, you can turn off error checking globally from the Advanced tab in GDE Settings. |
CSS Styling
If you wish to use CSS to style the plug-in’s output, each element has its own class name you can add to your theme’s stylesheet:
.gde-frame – the embedded viewer itself
.gde-text – the download text
.gde-link – the download link
.gde-error – inline error messages, if enabled (2.3+)
Just about every aspect of the viewer’s appearance can be modified to match your site if you are savvy with CSS and developer tools like Firebug. The Enhanced Viewer will let you easily change page background and border colors as well as modify or hide the toolbar. For full customization, you can provide your own CSS file. You can use the sample “dark” profile provided with the plugin to get started.