1.使用官方的方式 使用官方的方式也就是PdfDocument类的使用 /*** * 将tv内容写入到pdf文件 */ @RequiresApi(api = Build.VERSION_CODES.KITKAT) private void newPdf() { // 创建一个PDF文本对象 PdfDocument document = new PdfDocument(); //创建当前页的信息,Builder中的参数表示页面的宽高,以及第几页 PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(binding.pdfTv.getWidth(), binding.pdfTv.getHeight(), 1) .create(); // 生成当前页 PdfDocument.Page page = document.startPage(pageInfo); // 在当前页上画画,即把所需要的view的视图画到page的画布上 View content = pdfTv;...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with binding.getRoot
Contact binding.getRoot, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack