Title: Shortcode?
Last modified: August 21, 2016

---

# Shortcode?

 *  Resolved [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-118/)
 * So far, from initial testing, it looks to be a nice plugin. I would like to be
   able to use a shortcode to allow PDF output only for the pages I want it on. 
   Is that possible?
 * [http://wordpress.org/plugins/wp-post-to-pdf-enhanced/](http://wordpress.org/plugins/wp-post-to-pdf-enhanced/)

Viewing 15 replies - 1 through 15 (of 30 total)

1 [2](https://wordpress.org/support/topic/shortcode-118/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/shortcode-118/page/2/?output_format=md)

 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4415956)
 * Currently, you need to specify pages to include or exclude in the admin dialog.
   I do plan to implement shortcodes, however, so stay tuned for this feature (likely
   by version 1.1).
 * In my own setup, I want the ability to generate pdfs on most pages, so I have
   an exclude list specified. However, I could see where the reverse might be true.
   This is logic inherited from the original plugin, and I haven’t had time to re-
   think it.
 * Cheers
 * Lewis
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416038)
 * I am trying to produce basic product documentation, e.g., installation instructions.
   Pages are created and then duplicated and edited for specific product variations.
   Shortcode is the preferred method, as this will be authors/editors and not administrators
   who edit the pages.
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416043)
 * I just sent an e-mail on your website with a bit more information.
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416190)
 * Hi, Ellyn!
 * This afternoon, I landed the initial shortcode feature [on trunk](http://plugins.svn.wordpress.org/wp-post-to-pdf-enhanced/trunk/).
   If you’d care to test, you may update your existing wp-post-to-pdf-enhanced.php(
   and readme.txt) and add wpptopdfenh_shortcodes.php to the main plugin directory.
 * The shortcode is [wpptopdfenh] and you may place it anywhere in the post/page
   where you would like the icon/PDF link to appear, and it will obey paragraph 
   formatting (right/left, etc.)
 * The plugin ignores include/exclude directives set in the admin panel, except 
   for the single page option and the public option.
 * Please test and report your findings.
 * Still to implement for this: options for the shortcode (fonts, etc.), different/
   no icon image, and additional shortcodes for PDF formatting (manual page breaks,
   etc.).
 * Enjoy!
 *  [ajg-cal](https://wordpress.org/support/users/ajg-cal/)
 * (@ajg-cal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416191)
 * [shortcode-as-a-widget works perfectly for me](http://gunyon.co.uk/consequat-interdum-dignissim/)
 * **functions.php**
 *     ```
       // allow shortcodes in widgets
       add_filter('widget_text', 'do_shortcode');
       ```
   
 * **text widget**
    `[wpptopdfenh]`
 * Let me know if there’s anything specific to test. I’m not really sure how to 
   properly check out things with subversion. I just installed subversion and did
 * `sudo svn co http://plugins.svn.wordpress.org/wp-post-to-pdf-enhanced/trunk/`
 * `sudo mv trunk wp-post-to-pdf-enhanced`
 * [text-align CSS takes effect well too](http://gunyon.co.uk/wp-to-pdf/)
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416192)
 * Hi Lewis,
 * I am not having any luck, after downloading and installing the files you mentioned.
   For example, if you go to the home page and click on the PDF, the following is
   returned: [http://dslocks-hoc.pitlarson.com/?format=pdf](http://dslocks-hoc.pitlarson.com/?format=pdf)
 * Here is the system info in case it helps:
    WP Version: 3.8 WP Multisite Enabled:
   No Web Server Info: Apache PHP Version: 5.4.22 MySQL Version: 5.5.35-log
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416193)
 * Sorry for the late follow-up:
 * Alex – I’m interested in various paragraph formatting options and include/exclude
   combinations in the admin area, to make sure that the icon shows up where we 
   want it and on which page/post.
 * Ellyn – I will have a look right now. I might expect that from a preview of a
   post, as we need a permalink to generate the pdf. The result posted indicates
   the lack of a permalink, and thus, an invalid url passed to TCPDF. I’ll know 
   more when I look more closely.
 * Thanks for the feedback!
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416194)
 * Okay, Ellyn, I see the problem. It’s an include/exclude thing, which is exactly
   what we’re testing. If I specifically include page 5 (what you are using as the
   home page), then both the default icon and the shortcode generate the pdf as 
   expected. If I remove that page from the inclusion list, then I get a return 
   false, which re-renders the original page (sans the icon, which indicates that
   the shortcode is working, and my logic is flawed – LOL).
 * Let me see what I can do to tweak the logic, here, and I’ll follow up later on.
 * Thanks again for testing!!
 * Lewis
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416195)
 * Version 2 of the patch going to svn shortly. If this works, the final version
   will incorporate these changes and some streamlined code for the initial change(
   which was rather ugly before, IMO).
 * This patch does the following:
 * If we detect a shortcode on the page, we skip the checks for excluding pdf generation
   for the given page. (Originally, I was only checking for the inclusion/exclusion
   for displaying the icon, not creating the content.) I think I have one more tweak
   to make after this, however, as we need to factor in the setting for caching (
   i.e., if we have included the page for caching, but excluded it for showing the
   icon, we’ll want to fetch the cached version of the page, assuming it has not
   expired).
 * Stand by, and please check for an updated wp-post-to-pdf-enhanced.php shortly!
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416196)
 * Alex – Re: Subversion – While I host a Subversion repo for an organization, I
   am by no means an expert. You might want to have a look at [SmartSVN from WAN Disco](http://www.wandisco.com/smartsvn/home).
   It’s Java-based, so it runs on just about everything, and I find that the GUI
   makes things a whole lot easier for things I don’t do all the time.
 * Cheers
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416198)
 * Good to hear you have thought about the caching. In my view, having an option
   in the shortcode for caching would be great.
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416199)
 * Ah, that’s not exactly what I was discussing, but it’s something I _should_ add
   to my “shortcode feature list.”
 * I was referring to the admin option for including/excluding pages from the pdf
   cache. I want to make sure that when we request the pdf from the shortcode, while
   we ignore the include/exclude pdf generation options for that page, we _obey_
   the caching option set.
 * The feature you mention is a good override, though, as it should allow us to 
   specifically bypass a cached version for a fresh one, e.g., [wpptopdfenh cached
   =”no”], so that even if a cached version exists, we force a refresh from the 
   shortcode.
 * Other shortcode modifiers on my list include:
 * icon=”path-to-different-icon-image”
    link=”text” | “icon” to override the default
   setting, and where “text” is any string you’d like, such as, “click here for 
   PDF” or “download this as PDF” header-logo=”off” | “on” to override the visibility
   of the header logo image logo=”path-to-different-header-logo-image”
 * and of course, the various font overrides. 🙂
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416200)
 * Sounds good. I’d like to test out the logo image path when you have it, because
   for some reason, I’ve never been able to get this to work from my wp-content/
   uploads directory.
 *  [ajg-cal](https://wordpress.org/support/users/ajg-cal/)
 * (@ajg-cal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416201)
 * Hi elarson
 * I _think_ you may have to remove the alpha layer from the png logo you wish to
   use – often this helps.
 * You can use GIMP to remove the alpha layer.
 *  [ajg-cal](https://wordpress.org/support/users/ajg-cal/)
 * (@ajg-cal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/#post-4416202)
 * hi Lewis
 * Just getting into the swing of things thanks for the help.
 * The commands that work well for me are
 *     ```
       mkdir wp-post-to-pdf-enhanced
   
       cd wp-post-to-pdf-enhanced
   
       sudo svn co http://plugins.svn.wordpress.org/wp-post-to-pdf-enhanced/trunk/ .
   
       svn info
       ```
   
 * I’m on Revision 830443 if that helps.
 * Alignment seems to work well ([link](http://gunyon.co.uk/wp-p-pdf-alignment/)).
 * In my case, PNG logo only works when there is no alpha channel not sure if that’s
   particular to me or not. I guess that’s due to the TCPDF.
 * V minor issue: it doesn’t seem to reproduce paragraph indentation create from
   the wordpress visual editor. See paragraph starting “Vestibulum blandit, eros
   eu facilisis aliquet” [here](http://gunyon.co.uk/wp-p-pdf-images-typography/).
   Another TCPDF prob perhaps. Everything else topography style wise looks preeetty
   good.

Viewing 15 replies - 1 through 15 (of 30 total)

1 [2](https://wordpress.org/support/topic/shortcode-118/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/shortcode-118/page/2/?output_format=md)

The topic ‘Shortcode?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-post-to-pdf-enhanced_d24b30.svg)
 * [WP Post to PDF Enhanced](https://wordpress.org/plugins/wp-post-to-pdf-enhanced/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-post-to-pdf-enhanced/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/reviews/)

 * 30 replies
 * 3 participants
 * Last reply from: [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416249)
 * Status: resolved