在下面的代码中打印工作正常,但我无法创建svg image的pdf。如果我生成pdf然后生成空白输出(空白pdf)。我试过capture,js.pdf,dompdf,tcpdf但不适合我。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js"></script>
<script src="http://html2canvas.hertzen.com/build/html2canvas.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<div class="main_div">
<div>
<div class="nav_div">
<input type="button" value="Print Map" onclick="PrintElem('.parent')" />
<input type="button" value="Download Map" onclick="pdf()" />
</div>
</div>
<div class="parent">
<div class="panzoom" >
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%"
height="400px" xml:space="preserve">
<g id="LWPOLYLINE_45_">
<polygon id="1" style="fill:#78AB46;stroke:#231F20;stroke-miterlimit:10;" points="300,250 350,200 400,250 500,250 500,300 300,300" />
</g>
<g id="LWPOLYLINE_44_">
<polygon id="2" style="fill:#78AB46;stroke:#231F20;stroke-miterlimit:10;" points="350,200 400,150 500,250 400,250" />
</g>
<g id="LWPOLYLINE_43_">
<polygon id="3" style="fill:#78AB46;stroke:#231F20;stroke-miterlimit:10;" points="400,150 600,150 580,250 600,300 500,250"/>
</g>
</svg>
</div>
</div>
<div class="pop_up_div">
<div id="header_lot">
</div>
<div id="show_form"></div>
</div>
</div>
SetUnhandledExceptionFilter