WordPress.org

Ready to get started?Download WordPress

Forums

WP Post to PDF
[resolved] Custom css & html problems (4 posts)

  1. jennybeaumont
    Member
    Posted 1 year ago #

    Hello again,

    I'm back as I bang my head against the wall trying to do what seems like should be a simple task: add custom css and html to the template.

    I've been modifying wp-post-to-pdf.php to adapt my own page layout, following instructions from TCPDF.org - but the simplest css is not being applied, and am I'm having a terrible time aligning images in a simple table.

    Are there any parameters specific to this plugin that might hinder some of these basic functions?

    Authors, you giving support for this plugin?
    Many thanks!
    -jennyb

    http://wordpress.org/extend/plugins/wp-post-to-pdf/

  2. Lewis Rosenthal
    Member
    Posted 1 year ago #

    Hi again, Jenny...

    What are you trying to add, and where?

    It might be easier to include your css hacks to your site's stylesheet, instead (just a thought).

    Lewis

  3. jennybeaumont
    Member
    Posted 1 year ago #

    Hi again Lewis,

    Yes so I was able to find some discussion over on the SourceForge forums about how a lot of CSS attributes don't work in TCPDF, such as text-transform and text-margins. I've started doing some basic testing and am compiling a list of what works and what doesn't.

    The other issue that was (is) giving me trouble, was integrating images. I had wanted to include high-res images, but it seems that the only way to do so is by using absolute positioning. For my purposes, that was just way too labor intensive. I'm currently experimenting with tables for the page layout - and whereas going between mm and pixels is proving challenging, I am making progress!

    Will be happy to post some of my code when I'm further along. It's pretty cool as the content doesn't actually come from the published page, but other, non-published, custom-meta from the same post. :-)

    cheers,
    -jennyb

  4. Lewis Rosenthal
    Member
    Posted 1 year ago #

    Hi, Jenny...

    Yes, TCPDF is an odd package. I also discovered some CSS which it seems to want to ignore. I installed FD Footnotes, which displays correctly and even renders nicely in the PDF, however, the separator line is omitted in the PDF. The CSS for the line (in my theme's style.css) is:

    .footnotes .footnotedivider {
      width: 120px;
      border-bottom: 1px solid #ccc;
    }

    Note that the text formatting for the footnote numbering (superscript, bold, underlined) remains intact, and the footnotes themselves print as expected. Example post.

    I've also tried upgrading the TCPDF version in WP Post to PDF, but have not quite gotten it to work.

    Your image issue seems like an interesting puzzle to solve; I'm curious to see how you do that or work around it. I agree that the absolute positioning bit is a considerable amount of overkill, particularly if you have a good number of images.

    Good luck with it, and please do post your results!

    Cheers

    Lewis

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.