It‘s probably obvious to many other people but it took me a while to figure it out and it really makes GDE all that more useful, in my case.
As you probably all know, you can use the GDE shortcode in PHP files (say, in a template) by using do_shortcode([gview file="http://example.com/file.pdf"]). What wasn’t clear to me is how to pass a link to that PHP version of the shortcode. Again, it must be really obvious, but I got stuck on it, because my knowledge of PHP is rather minimal.
What worked, though, is this:
$docview = '[gview file="'. $custom["document-link"][0] . '" width="75%" save="1"]';
echo do_shortcode($docview);
$custom["document-link"][0] is the content of a custom field which is supposed to be a link to an appropriate file. By creating a variable to include the full shortcode, I’m able to use GDE to display that file.
That’s what I’m using in my “syllabus database”, for instance displaying a PDF in a syllabus post (using a syllabus template).
Relevant files for my syllabus database are available on my main blog, if anyone is interested.