WordPress.org

Ready to get started?Download WordPress

Forums

POST2PDF Converter
[resolved] won't use photos in PDF creation? (6 posts)

  1. CrtWatcha
    Member
    Posted 2 years ago #

    Is POST2PDF supposed to be bringing along photos that are in the page as well as the html text? I have WP ver 3.3 now and when I output to PDF it only grabs the html text and none of the images.

    http://wordpress.org/extend/plugins/post2pdf-converter/

  2. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, CrtWatcha san

    Is POST2PDF supposed to be bringing along photos that are in the page as well as the html text?

    POST2PDF Converter supports <img> tag.

    Are your images defined by <img> tag in your post?

  3. CrtWatcha
    Member
    Posted 2 years ago #

    Yes, all of the images on the site are installed with <img> tags.

    I thought there would be some preference feature like include <img> tags or include images in posts, but there isn't. If it is supposed to bring along <img> tags it isn't working. I outputted from Chrome 15 OS X and tried Safari of the latest version too, and they did the same thing. One web page it included the first image but none of the others; they are one after the other in the code string. So it's not picking up all image tags as it should. Mostly it doesn't even pick them up. It does a great job of picking up all of the html formatted text and links, and the links are working, but it is sucking right now at bringing along the images. I hope this can be fixed soon, this is a sweet plug-in so far.

  4. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, CrtWatcha san

    POST2PDF Converter can handle multiple <img> tags.
    Howerver It can't handle all and every tags.

    Maybe, A specified tag encumbers converting HTML to PDF.

    If you can, Let me know your site URL.
    I want to check source of your posts.

    Here is contact form
    http://www.near-mint.com/blog/contact

  5. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, CrtWatcha san

    I checked your source of posts and now I know the problem.

    The Following code is your simplified post source.

    <p>Description 1</p>
    
    <h1><a href="http://www.sample.com/xxx" target="_blank">Title</a></h1>
    <p>
    Description 2<br />Description 3
    </p>
    
    <h4>Description 4</h4>
    
    <p><a href="http://www.sample.com/wp-content/uploads/2011/10/1.jpg"><img class="MYclass" title="Image1" src="http://www.sample.com/wp-content/uploads/2011/10/1.jpg" alt="" width="672" height="924" /></a><br />
    
    <a href="http://www.sample.com/wp-content/uploads/2011/10/2.jpg"><img class="Myclass" title="Image2" src="http://www.sample.com/wp-content/uploads/2011/10/2.jpg" alt="" width="672" height="924" /></a><a href=http://www.sample.com/wp-content/uploads/2011/10/3.jpg"><img class="Myclass" title="Image3" src="http://www.sample.com/wp-content/uploads/2011/10/3.jpg" alt="" width="672" height="924" /></a><a href="http://www.sample.com/wp-content/uploads/2011/10/4.jpg"><img class="Myclass" title="Image4" src="http://www.sample.com/wp-content/uploads/2011/10/4.jpg" alt="" width="672" height="924" /></a></p>

    A <br /> tag is placed after 1st image block.(That is a critical point.)

    Look 2nd-4th image blocks.
    No <br /> tags are placed after each image block.

    POST2PDF Converter places them in same one row and fails.

    As your images is large, POST2PDF Converter can't place them in same one row and they will appear as some blank pages on the PDF.

    As below, If you place <br /> tag after each image blocks, POST2PDF Converter can convert properly.

    <p>Description 1</p>
    
    <h1><a href="http://www.sample.com/xxx" target="_blank">Title</a></h1>
    <p>
    Description 2<br />Description 3
    </p>
    
    <h4>Description 4</h4>
    
    <p><a href="http://www.sample.com/wp-content/uploads/2011/10/1.jpg"><img class="MYclass" title="Image1" src="http://www.sample.com/wp-content/uploads/2011/10/1.jpg" alt="" width="672" height="924" /></a><br />
    
    <a href="http://www.sample.com/wp-content/uploads/2011/10/2.jpg"><img class="Myclass" title="Image2" src="http://www.sample.com/wp-content/uploads/2011/10/2.jpg" alt="" width="672" height="924" /></a><br />
    
    <a href=http://www.sample.com/wp-content/uploads/2011/10/3.jpg"><img class="Myclass" title="Image3" src="http://www.sample.com/wp-content/uploads/2011/10/3.jpg" alt="" width="672" height="924" /></a><br />
    
    <a href="http://www.sample.com/wp-content/uploads/2011/10/4.jpg"><img class="Myclass" title="Image4" src="http://www.sample.com/wp-content/uploads/2011/10/4.jpg" alt="" width="672" height="924" /></a><br /></p>

    In addition, you need to modify following file to make images smaller on the PDF.

    Line 218 /wp-content/plugings/post2pdf-converter/tcpdf/config/tcpdf_config.php

    define ('PDF_IMAGE_SCALE_RATIO', 1.25);

    ->

    define ('PDF_IMAGE_SCALE_RATIO', 1.3.5);

    I will add new option to change image size(ratio) in next release.

  6. CrtWatcha
    Member
    Posted 2 years ago #

    Alright, when I get around to it I'll follow your instructions and let you know how things go. I really appreciate your help, thank you very much. Keep up the good work!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic