Viewing 15 replies - 16 through 30 (of 30 total)
  • Manual page breaks are working for me currently (link)

    Thread Starter elarson

    (@elarson)

    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

    (@lewisr)

    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.

    sorry I wasn’t clear

    the “manual” page breaks was with <tcpdf method="AddPage"></tcpdf>

    I’ve changed the name to tcpdf page breaks and added another page wich uses “pagination” with <!–nextpage–>.(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

    (@lewisr)

    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

    (@elarson)

    This is a bit off topic, but do either of you know if TCPDF will honour @print queries in the CSS?

    Plugin Author Lewis Rosenthal

    (@lewisr)

    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

    logos for testing

    no alpha

    alpha

    Plugin Author Lewis Rosenthal

    (@lewisr)

    TCPDF and @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

    (@elarson)

    CSS3 / HTML 5 https://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

    (@lewisr)

    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.

    Any suggestions are more than welcome. ??

    Lewis

    Happy new year

    sudo svn up
    Rev 831583

    [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.

    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). 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

    (@lewisr)

    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

    (@lewisr)

    Re: stripping all shortcodes except wpptopdfenh (and friends) – I think the answer here lies in coded developed for 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 on the original WP Post to PDF plugin support page for a use case for this.

    Lewis

    Plugin Author Lewis Rosenthal

    (@lewisr)

    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)
  • The topic ‘Shortcode?’ is closed to new replies.