Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image tag is not capturing #144

Closed
gitbala opened this issue Dec 17, 2012 · 1 comment
Closed

Image tag is not capturing #144

gitbala opened this issue Dec 17, 2012 · 1 comment

Comments

@gitbala
Copy link

gitbala commented Dec 17, 2012

Hi,

I tried to convert html to image using html2canvas, its working fine. But the image tag inside html elements is not converting, Given below one example:

yellow green green green yellow red red yellow green ## Working HTML Element
    <tr class="cldr-row-heading">
            <th>Mo</th>
            <th>Tu</th>
            <th>We</th>
            <th>Th</th>
            <th>Fr</th>
            <th>Sa</th>
            <th class="last">Su</th>
        </tr>
        
        <tr class="cldr-row-date">
            <td class="disable"><div class="date-box"><span class="date">26</span></div></td>
            <td class="disable"><div class="date-box"><span class="date">27</span></div></td>
            <td class="disable"><div class="date-box"><span class="date">28</span></div></td>
            <td class="disable"><div class="date-box"><span class="date">29</span></div></td>
            <td class="disable"><div class="date-box"><span class="date">30</span></div></td>
            <td class="disable"><div class="date-box"><span class="date">31</span></div></td>
            <td class="last"><div class="date-box"><span class="date">1</span></div></td>
        </tr>
       <tr class="cldr-row-date">
        
            <td>
            <div class="date-box"><span class="date">2</span>
            
            <span class="color-lines">
            <img src="assets/images/icons/color-line/blue.png" alt="yellow"/>
            <img src="assets/images/icons/color-line/green.png" alt="green"/>
            <img src="assets/images/icons/color-line/green.png" alt="green"/>
            <img src="assets/images/icons/color-line/green.png" alt="green"/>
            <img src="assets/images/icons/color-line/blue.png" alt="yellow"/>
            <img src="assets/images/icons/color-line/red.png" alt="red"/>
            <img src="assets/images/icons/color-line/red.png" alt="red"/>
            <img src="assets/images/icons/color-line/blue.png" alt="yellow"/>
            <img src="assets/images/icons/color-line/green.png" alt="green"/>
            </span> 
            
            <span class="bell">bell</span> 
            <span class="calsnap">snap</span>
            </div>
            </td>

Here is my script for converting html2canvas:

var html2obj = html2canvas($('table'));
var queue = html2obj.parse();
var canvas = html2obj.render(queue);
var img = canvas.toDataURL();
$('#calendar_to_canvas').attr('src', img);

Thanks,
Bala

@niklasvh
Copy link
Owner

closing duplicate, see #145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants