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 - 16 through 30 (of 30 total)

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

 *  [ajg-cal](https://wordpress.org/support/users/ajg-cal/)
 * (@ajg-cal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416203)
 * Manual page breaks are working for me currently ([link](http://gunyon.co.uk/wp-p-pdf-manual-page-break/))
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416204)
 * About the logo, even when I rename the supplied logo wp-post-to-pdf-enhanced/
   assset/images/logo.png to wp-content/uploads/wp-post-to-pdf-enhanced-logo.png
   it does not work.
 * I’ll play with the alpha channel (variable transparency) but would think the 
   supplied logo would work with tcpdf. Or am I just doing something stupid with
   image naming?
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416205)
 * Great work, Alex; thanks so much for your time and thoroughness!
 * Revision: Hmmm… My transaction log shows 830379. Still, your svn commands look
   right. 🙂
 * Alpha channel issues: Indeed, there are a number of conflicting reports of problems
   with alpha channels in png images, ranging from not rendering at all to rendering
   in B&W. Some of these (which I have found) involve the nuances of ImageMagick’s
   creation/conversion (not sure how GraphicsMagick might differ, nor did I look
   closely at the version of IM being used). Looks like the current TCPDF is 6.0.052,
   and we are still using 6.0.043. I’ll need to review the changelog to see if this
   may have been addressed (an earlier alpha channel issue was apparently resolved
   in 6.0.041).
 * Indentation: I see this in your example. Interesting. Indeed, I would agree that
   this is something with either TCPDF or how we are wrapping the resulting HTML
   when handing it to TCPDF (meaning: I don’t think it’s a problem with the output
   from the visual editor or the code itself). I’ll have a closer look at this.
 * Thanks again!
 * PS – Manual page breaks: I take it you just used the normal page break in the
   visual editor for these? If so, that’s great, and takes something else off of
   my list, as there’s no need to add a shortcode if the standard page break works.
 *  [ajg-cal](https://wordpress.org/support/users/ajg-cal/)
 * (@ajg-cal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416206)
 * sorry I wasn’t clear
 * the “manual” page breaks was with `<tcpdf method="AddPage"></tcpdf>`
 * I’ve changed the name to [tcpdf page breaks](http://gunyon.co.uk/wp-p-pdf-tcpdf-page-break/)
   and added another page wich uses [“pagination” with <!–nextpage–>](http://gunyon.co.uk/wp-p-pdf-nextpage-break/).(
   was that what you were referring to?)
 * Unfortunately <!–nextpage–> pagination doesn’t cause page breaks in the pdf unlike`
   <tcpdf method="AddPage"></tcpdf>` which does.
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416207)
 * Thanks, Alex; that’s exactly what I was thinking (that <!–nextpage–> shouldn’t
   do anything for the PDF). What I do need to do is add a shortcode to insert the
   TCPDF method where the page break is desired (because people aren’t likely to
   dig into the code far enough to find the TCPDF syntax – nor should they have 
   to remember to do so).
 * Cheers
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416208)
 * This is a bit off topic, but do either of you know if TCPDF will honour [@print](https://wordpress.org/support/users/print/)
   queries in the CSS?
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416209)
 * Ellyn: There was indeed a fix for a png issue in TCPDF version 6.0.050. From 
   the changelog:
 *     ```
       6.0.050 (2013-11-27)
       	- A bug related to PNG images was fixed.
       ```
   
 * With no direct reference to a bug, I can’t exactly tell which bug was addressed.
   No matter; I’m pushing 6.0.052 to the 1.0.1 branch right now (internally). I’ll
   give it a whirl. If it works, I’ll push it to svn so that you may grab it and
   try it against the logo image you have (and the default one, because truth be
   told, I probably have not tested that very well, myself!).
 * Cheers
 *  [ajg-cal](https://wordpress.org/support/users/ajg-cal/)
 * (@ajg-cal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416210)
 * logos for testing
 * [no alpha](http://gunyon.co.uk/wp-content/uploads/2013/12/no-alpha-logo.png)
 * [alpha](http://gunyon.co.uk/wp-content/uploads/2013/12/alpha-logo.png)
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416211)
 * TCPDF and [@print](https://wordpress.org/support/users/print/): Unknown to me.
   Even a quick web search came up empty on that one.
 * Edit: Removed mention of 1.0.1 alpha on FTP site, as TCPDF is broken for logo
   image; needs more adjustment.
 *  Thread Starter [elarson](https://wordpress.org/support/users/elarson/)
 * (@elarson)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416212)
 * CSS3 / HTML 5 [http://www.w3schools.com/css/css_mediatypes.asp](http://www.w3schools.com/css/css_mediatypes.asp)
 * I’m rather new to them, but working with the WP 2014 theme, and want to incorporate
   them as much as possible.
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416213)
 * Happy New Year, all…
 * I’ll be pushing to trunk a fresh revision of the shortcodes.php which includes[
   wpptopdfenh_break]. Place this shortcode wherever you’d like the PDF to break
   between pages (it’s invisible on-screen).
 * The CSS shortcode is proving to be a bit more difficult than I’d hoped, but that’s
   only because of my own lack of skills. The logic is fairly straightforward:
 * Shortcode: `[wpptopdfenh_opts css="myfile.css"]`
 * where “myfile.css” is an external css uploaded to `/uploads/wp-post-to-pdf-enhanced-
   css/`
 * Expected Result: When building the html to hand off to TCPDF, we parse the argument
   and do a `file_get_contents( WPPT0PDFENH_CSS_DIR . $css );` to call the css at
   the top of the HTML, but after the other defined options in the admin panel.
 * You can see how this should work by checking out [this example](http://www.tcpdf.org/examples/example_061.phps).
 * Any suggestions are more than welcome. 😉
 * Lewis
 *  [ajg-cal](https://wordpress.org/support/users/ajg-cal/)
 * (@ajg-cal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416219)
 * Happy new year
 *     ```
       sudo svn up
       Rev 831583
       ```
   
 * `[wpptopdfenh_break]` works well ([link](http://gunyon.co.uk/wp-p-pdf-tcpdf-page-break/)).
   I noticed it only works when the plugin option **Process Shortcodes** is ticked,
   not sure if is this was intentional so I thought I mention it.
 * I’ve made a test css page which should work when the changes are pushed to the
   repository (if they haven’t been already) ([link](http://gunyon.co.uk/wp-p-pdf-custom-css/)).
   I’m afraid I’m not much help with development itself =]
 * steps
 * I’ve added the css file here
    `wp-content/uploads/wp-post-to-pdf-enhanced-css/
   pdf.css`
 *     ```
       h1 {
       color:blue;
       }
   
       h2 {
       color:red;
       }
   
       h3 {
       color:green;
       }
   
       h4 {
       color:yellow;
       }
       ```
   
 * and added the shortcode to the top of the custom css test page
    `[wpptopdfenh_opts
   css="pdf.css"]`
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416221)
 * Hi, Alex, and Happy New Year!
 * > [wpptopdfenh_break] works well (link). I noticed it only works when the plugin
   > option Process Shortcodes is ticked, not sure if is this was intentional so
   > I thought I mention it.
 * Hmmm… Well, it _should_ work even when that is turned off, because we always 
   want to process our own shortcodes. So, I’ll need to have a look at that. Good
   catch. 😉
 * CSS: Indeed, you have everything in place for when I actually get the kinks worked
   out. I am indeed able to inject the CSS if I specify it manually in wp-post-to-
   pdf-enhanced.php, so the real issue is with my callback and how I’m passing the
   file contents of the css to the function. the other interesting thing I ran into
   was the position of the css in the HTML output, as we may indeed want to get 
   the css included above the logo image, header info, separator line, and the rest
   of the document content. This would give complete flexibility to override all
   of the configuration settings (more on this in Ellyn’s thread concerning css,
   as this one is getting a bit long in the tooth!). Anyway, I’ll keep everyone 
   posted when I get the opts shortcode implemented.
 * Meanwhile, if you (or anyone else) have/has any specific suggestions for items
   to add to the opts shortcode, please post a request.
 * Cheers
 * Lewis
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416222)
 * Re: stripping all shortcodes except wpptopdfenh (and friends) – I think the answer
   here lies in coded developed for [bbPress2 shortcode whitelist](http://wordpress.org/plugins/bbpress2-shortcode-whitelist/).
   The greater issue this raises, of course, is whether we may need some sort of
   whitelist and/or blacklist functionality in the admin panel, anyway, vs the current
   all-or-nothing approach.
 * Check out [this post](http://wordpress.org/support/topic/process-only-certain-shortcodes?replies=1)
   on the original WP Post to PDF plugin support page for a use case for this.
 * Lewis
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-118/page/2/#post-4416249)
 * Marking this issue as resolved, only because we have basic shortcodes working.
   For specific shortcode options to be added, please open separate requests.

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

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

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