WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: POST2PDF Converter] won't use photos in PDF creation?

[Resolved] [Plugin: POST2PDF Converter] won't use photos in PDF creation?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author redcocker

    @redcocker

    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?

    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.

    Plugin Author redcocker

    @redcocker

    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

    Plugin Author redcocker

    @redcocker

    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.

    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!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: POST2PDF Converter] won't use photos in PDF creation?’ is closed to new replies.