Viewing 11 replies - 31 through 41 (of 41 total)
  • alexblajan

    (@alexblajan)

    LewisR so should I use that snippet with bitly or what ? Sorry, I’m not a newbie but not a coder eighter.
    Also, should I use the plugin from the repo, the official one or should I wait for your version ?

    alexblajan

    (@alexblajan)

    (double post)

    Thread Starter Lewis Rosenthal

    (@lewisr)

    The code snippet was to illustrate my point; there’s nothing you can do with it, directly.

    As I said before, the Bitly plugin needs to be modified to allow WP Post to PDF to function, because right now, the Bitly plugin is likely overriding a function which WP Post to PDF needs to work.

    Grab my version 2.3.6, which is the current “stable” one from me:

    ftp://ftp.2rosenthals.com/pub/WordPress/plugins/wp-post-to-pdf.2.3.6.zip

    Good luck

    Lewis

    Thread Starter Lewis Rosenthal

    (@lewisr)

    2.4.0 (unofficial; refreshed 10 November, 2013):

    ftp://ftp.2rosenthals.com/pub/WordPress/plugins/wp-post-to-pdf.2.4.0.zip

    Diff against the latest official release (2.3.1):

    ftp://ftp.2rosenthals.com/pub/WordPress/plugins/wp-post-to-pdf.2.4.0-against-2.3.1.diff

    Diff against my previous version (2.3.6 unofficial):

    ftp://ftp.2rosenthals.com/pub/WordPress/plugins/wp-post-to-pdf.2.4.0.diff

    What’s new:

    Updated TCPDF to 6.0.043, including a huge number of new fonts (much larger package).

    Fixed tcpdf/config/tcpdf_config.php, which was apparently the cause of the missing images in the previous releases of this build.

    Added option to include tags in PDF, if present. Tags are presented under Categories, and as clickable links (what a job that was, as get_the_category_list works differently than get_the_tags). If no tags are present, the line is skipped in the resulting pdf.

    Added check for existence of category list, in case we are generating a pdf from a page vs a post. If none found, the line is skipped in the resulting pdf.

    Ugly workaround for:

    PHP Warning: array_push() expects parameter 1 to be array, null given in tcpdf.php on line nnnnn

    (Tweaked a line of code in tcpdf/tcpdf.php to allow for a conditional on the failing array statement. I suspect we are passing either some malformed or unexpected HTML to TCPDF.)

    To-do:

    Fix annoying truncation of certain PDFs due either to large size, large tables, or multiple images in posts/pages. Please advise if this is a problem.

    Fix image positioning to better respect the HTML layout.

    Add option to move date and/or category to the footer, with left, right, or center alignment.

    Add option to specify the separator in a list of categories & list of tags.

    Add option to remove paragraph break between author, categories, tags, date (to format better and waste less vertical space).

    Add option to specify first or all categories (presently, we display the list, via get_the_category_list) and tags (completely different mechanism involved).

    Add option to specify ordering/alignment (see above) of these items.

    Allow exception to site-wide image scaling factor via shortcode (and add other shortcodes as overrides for various options set in the admin panel).

    Allow for custom css definitions to apply to PDF (note that this is highly dependent upon css support in TCPDF class; this to-do list item refers to the ability to enter such css in the admin panel, and not to any specific css support). (This may be working better with the updated TCPDF build; please test and advise.)

    Thanks to Jenny Beaumont for additional testing of the previous releases of this version!

    Feedback is welcome and appreciated.

    Note that you may request support here or via the support page on my blog.

    I will likely fork this project to WP Post to PDF Enhanced. I’m currently weighing whether I really want to host my stuff on WordPress’ site (I am reticent to do that, as I don’t like other people having control over what I publish, though I realize that this will make updates easier). Stay tuned.

    Enjoy!

    Lewis

    ajg-cal

    (@ajg-cal)

    fantastic – Thanks Lewis

    I’ll test this now.

    It wouldn’t be that much harder to update manually by zip. If not using www.remarpro.com, it would be useful if the site had some sort of RSS feed or mailing list so that I know when updates have been made.

    2020media

    (@2020media)

    Personally I would recommend hosting on WordPress site.

    The plugin I rewrote, I really apreciate it being hosted by WordPress. This way all the updates work and are notified/pushed out to the users. I would feel bad if I thought there were people using my plugin that had bugs in it. Ok they don’t have to update it, but at least they’ve been ‘told’.

    From the user perspective, I am also really glad to have only one place to get my updates from – subscribing to lots of different sites for all the dozens of plugins I use is a pain in the neck (something I have done in the past on Joomla sites I used to build a lot of).
    I am still reluctant to use plugins from outside the WP site because of this issue – missing updates.

    The only weak part of the WP plugin repository IMHO is the support section (ironically I’m using it now) – I never used to get notified of there being queries on it about my plugin so users were getting annoyed at there being no response. Not sure if that was my own fault in setup or what though.

    rex

    ajg-cal

    (@ajg-cal)

    2.4.0 seems to work fine for me.

    I get the following messages when WP_DEBUG is true.

    at the top of the page:

    Notice: Use of undefined constant wpptopdf - assumed 'wpptopdf' in /srv/test.gunyon.co.uk/wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php on line 40
    
    Notice: Undefined index: format in /srv/test.gunyon.co.uk/wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php on line 121

    next to the pdf download link:

    Notice: Undefined index: nonPublic in /srv/test.gunyon.co.uk/wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php on line 429
    
    Notice: Undefined index: onSingle in /srv/test.gunyon.co.uk/wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php on line 432
    
    Notice: Undefined index: format in /srv/test.gunyon.co.uk/wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php on line 436
    
    Notice: Undefined index: query in /srv/test.gunyon.co.uk/wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php on line 457

    I’ve noticed that png images in the webpage are missing in the pdf, which isn’t a big problem as I can use jpeg instead.

    Also some custom styling in the webpage doesn’t appear in the pdf, although this might be expected. The styling comes from a simple plugin that makes noteboxes from shortcodes.

    PDF Formatting Options
    Other Plugins
    Process Shortcodes

    Also updating with zip upload via the wp-admin interface might not work for many people because of the large increase in plugin size.

    https://test.gunyon.co.uk/pdf-test/

    Thread Starter Lewis Rosenthal

    (@lewisr)

    Thanks, Alex; excellent points. Rex: also well taken, concerning hosting the plugin here. I will get things rolling in that direction ASAP.

    Back to your issues, Alex:

    Undefined constants & indexes when notices are enabled in logging (either through WP_DEBUG or in php.ini:

    Yech, what a mess. Talk about log spam! Okay, fixed. This was just some tidying that needed to get done (I should have looked several releases back, as this has been hanging around since before my work).

    If it’s easy for you to replace a single file, grab:

    ftp://ftp.2rosenthals.com/pub/WordPress/plugins/wp-post-to-pdf.php-2.4.0-1

    and save that over wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php .

    All downloadables have been refreshed.

    Now, as for the missing png files…

    It may be the placement on the page which is causing this. Can you try reversing he position of the jpg and the png on your page, Alex? There are indeed issues with some graphics, but I have not yet determined whether the issues are size-related, position-related, or something else. Likely I’ll need to enable debug output in TCPDF to find the actual culprit.

    It is also a known issue that the modifications from some plugins are not being respected. One of the reasons for updating the TCPDF component was that the newer ones are supposed to better handle css. That said, we do have lingering issues (for me, it’s with SyntaxHighlighter, but that’s likely only because that’s the only text-formatting plugin I’m using; the footnotes plugin I use seems to work just fine).

    Finally, I’m open to suggestions WRT breaking out the fonts and/or entire TCPDF component to make upgrades easier. Your point is again well taken that not everyone may be able to push 13MB each time, though this may be a moot point once I get the plugin hosted here.

    Thanks again!

    Thread Starter Lewis Rosenthal

    (@lewisr)

    BTW, the images on this page of my blog are both pngs. The pdf seems to render fine for me. However, while all of the images on this page rendered – also pngs – are intact, the pdf is indeed truncated after the first cell in the second table, so the last png is missing from the output. This may have something to do with the table (I’ve seen some reports about issues with TCPDF and tables) or something else (file size, size of images to that point, some buffer overflow, etc.); I am not sure as yet.

    Cheers

    Lewis

    ajg-cal

    (@ajg-cal)

    Hi Lewis

    I added more variations and content to the test page. I think more variations didn’t make a difference to the png problem.

    I updated wp-post-to-pdf.php with the file you linked. The pngs seem to be displaying in the pdf properly now.

    I didn’t test very carefully I’m afraid, so I’m not sure if it was changing the page content or updating the php file which solved the png display problem.

    All WP_DEBUG messages have gone after update.

    Different fonts work.

    The tables seem to disrupt the central alignment of the image directly after the table.

    I added a second table and it seems to be repeatable – a problem with tcpdf perhaps?

    let me know if there’s anything else I can test

    Thread Starter Lewis Rosenthal

    (@lewisr)

    Alex, you have been an immense help. Thanks so much for your time and valuable feedback (I certainly have the resources to set up a sandbox for this instead of my own live-fire testing; I should heed some of my own advice every now and again).

    Indeed, following onto what we suspected with tables having something to do with the issues, it seems that I’ve discovered/confirmed that TCPDF is quite persnickety about the HTML (in general), and tables seem to be real thorns in its side.

    In my case, I found that the second table on my page had embedded paragraph tags within a cell. These were not even meant for the cell itself, but rather, display in the footnotes (recall my earlier mention of the footnotes plugin I use). Changing those to line breaks, fixed the truncation of the pdf which I was seeing before. Also of note was the fact that I hadn’t set the alignment of that table or the one following, unlike the initial table. Setting those to left, I ultimately got the expected output (pagination could be better, but I’ll leave that for a subsequent enhancement via shortcode). Check your HTML near the “misaligned” image and see if indeed there is an alignment statement in the code. I have a hunch that your table is specified as left-aligned, and while WP is respecting your center-alignment of the subsequent image on-screen, something is either missing in between or otherwise keeping the center alignment statement from making it through to TCPDF. I have a page which similarly misbehaves; I’ll look at that, now that I have a better grasp on the whole tables thing.

    Thanks for confirming that the noise level has dropped since I fixed the initialization of those variables, though I doubt that the notices had anything to do with the lack of rendering that png for you. I suspect it was some edit, and perhaps the removal of a misplaced paragraph tag (tip: check the raw HTML for quirks), which made the difference.

    Great test page, BTW!

    Cheers, and again, many, many thanks.

    Lewis

Viewing 11 replies - 31 through 41 (of 41 total)
  • The topic ‘Contributed update available’ is closed to new replies.