如何在钛中创建 webview 内容的 pdf 文件 [英] How to create pdf file of the webview content in titanium

查看:34
本文介绍了如何在钛中创建 webview 内容的 pdf 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是钛的新手.我有一个 webview.webview 的内容可以是 pdf 文件,也可以是 url.我想将 webview 内容保存为 pdf 文件.我使用以下代码创建了 webview:

I am new to Titanium. I have a webview. The content of the webview can be a pdf file, or a url. I want to save the webview content as a pdf file. I have created webview using the below code:

    var webViews = Ti.UI.createWebView({
    left : 0,
    top : 0,
    right : 0,
    bottom : 0, 

    url : 'http://www.appcelerator.com'
    });

请任何人帮助我...

推荐答案

webview 数据不能直接转换成 pdf 格式,必须先解析 html 再用 js pdf 创建 pdf.这里是示例代码

You cant directly convert the webview data in pdf but you have to first parse html and then use the js pdf to create the pdf.Here is the code with example

https://github.com/Mindelusions/TiJSPDF

谢谢

这篇关于如何在钛中创建 webview 内容的 pdf 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆