dsgs8208 2017-07-24 04:22
浏览 124

HTML2pdf / tcpdf使用php无法正常工作

I want to get content from html and want to create pdf file based on it.
I have tried html2pdf as well tcpdf.But somehow in both places i didn't get working as i expected.

I am working on invoice template which can be modified from web.But right now issue i am facing like showing in GUI with proper output but when i am trying to use html2pdf showing me different output than GUI.

Is there anyway to achieve it ?

Code :

<link rel="stylesheet" type="text/css" href="plugins/bootstrap-3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="plugins/font-awesome-4.5.0/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="../dist/css/keditor-1.1.4.css" />
<link rel="stylesheet" type="text/css" href="../dist/css/keditor-components-1.1.4.min.css" />
<link rel="stylesheet" type="text/css" href="css/examples.css" />
<script src="plugins/jquery-1.11.3/jquery-1.11.3.min.js"></script>
<script src="../examples/plugins/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script src="plugins/jquery.nicescroll-3.6.6/jquery.nicescroll.min.js"></script>
<script src="plugins/ckeditor-4.5.6/ckeditor.js"></script>
<script src="plugins/ckeditor-4.5.6/adapters/jquery.js"></script>
<script src="../dist/js/keditor-1.1.4.min.js"></script>
<script src="../dist/js/keditor-components-1.1.4.min.js"></script>
<div id="keditor-content-area-1500637983301" class="keditor-content-area ui-droppable ui-sortable">
        <section class="keditor-container keditor-initialized-container" id="keditor-container-1500637983322"><section class="keditor-container-inner">
            <div class="row">
                <div class="col-md-12 keditor-container-content ui-droppable ui-sortable" data-type="container-content" id="keditor-container-content-1500637983324">
                    <section data-type="component-text" class="keditor-component existing-component keditor-initialized-component" id="keditor-component-1500637983336"><section class="keditor-component-content cke_editable cke_editable_inline cke_contents_ltr cke_show_borders" id="keditor-component-content-1500637983337" tabindex="0" spellcheck="false" role="textbox" aria-label="false" aria-describedby="cke_49" contenteditable="true"><div class="page-header"><h1 style="margin-bottom: 30px; font-size: 50px;"><b class="text-uppercase">Welcome to KEditor</b> <small>Kademi Editor</small></h1><p class="lead"><em>It's open source editor based-on CKEditor with support drag and drop snippets. This example is using <a data-cke-saved-href="http://getbootstrap.com/" href="http://getbootstrap.com/" target="_blank">Bootstrap 3.3.6</a> for styling</em></p></div></section><div class="keditor-toolbar keditor-toolbar-component">   <a href="#" class="btn-component-reposition"><i class="fa fa-arrows"></i></a>   <a href="#" class="btn-component-duplicate"><i class="fa fa-files-o"></i></a>   <a href="#" class="btn-component-delete"><i class="fa fa-times"></i></a></div></section>
                    <section data-type="component-text" class="keditor-component existing-component keditor-initialized-component" id="keditor-component-1500637983350"><section class="keditor-component-content cke_editable cke_editable_inline cke_contents_ltr cke_show_borders" id="keditor-component-content-1500637983350" tabindex="0" spellcheck="false" role="textbox" aria-label="false" aria-describedby="cke_87" contenteditable="true"><div class="row"><div class="col-md-4 text-center"><img class="img-circle img-responsive" data-cke-saved-src="snippets/default/img/somewhere_bangladesh_squared.jpg" src="snippets/default/img/somewhere_bangladesh_squared.jpg"><h3>Lorem ipsum</h3><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel, alias, temporibus? Vero natus modi ipsa debitis, accusamus accusantium cum quam. Saepe atque quisquam pariatur voluptatem expedita nesciunt reprehenderit et vitae.</p></div><div class="col-md-4 text-center"><img class="img-circle img-responsive" data-cke-saved-src="snippets/default/img/wellington_newzealand_squared.jpg" src="snippets/default/img/wellington_newzealand_squared.jpg"><h3>Lorem ipsum</h3><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat, aut, earum. Quod, debitis, delectus. Maxime eius ipsam sit dolorum perspiciatis obcaecati consectetur, explicabo reprehenderit repellat tempore veniam eos ducimus! Dignissimos.</p></div><div class="col-md-4 text-center"><img class="img-circle img-responsive" data-cke-saved-src="snippets/default/img/yenbai_vietnam_squared.jpg" src="snippets/default/img/yenbai_vietnam_squared.jpg"><h3>Lorem ipsum</h3><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil voluptatibus dicta corrupti aliquam, natus voluptatem pariatur quidem nostrum nisi corporis id ratione exercitationem et recusandae incidunt assumenda soluta qui odit.</p></div></div></section><div class="keditor-toolbar keditor-toolbar-component">   <a href="#" class="btn-component-reposition"><i class="fa fa-arrows"></i></a>   <a href="#" class="btn-component-duplicate"><i class="fa fa-files-o"></i></a>   <a href="#" class="btn-component-delete"><i class="fa fa-times"></i></a></div></section>
                </div>
            </div>
        </section><div class="keditor-toolbar keditor-toolbar-container">   <a href="#" class="btn-container-reposition"><i class="fa fa-sort"></i></a>   <a href="#" class="btn-container-duplicate"><i class="fa fa-files-o"></i></a>   <a href="#" class="btn-container-delete"><i class="fa fa-times"></i></a></div></section>
    </div>

Output of above code

But when i am trying html2pdf or tcpdf both are not showing content as i can see in web page.

It is showing one image and then its content and then another image and its content.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测