BACK-PORTING can use PdfDocument (API 19) in jellybean API 16? [closed]

情到浓时终转凉″ 提交于 2019-12-06 16:29:12

问题


I'm compiling using Android 4.4.2 (API19) but running on Android 4.1.1 API 16. Is there an Android support library,or something, so I can use PdfDocument.java (API 19) in Jellybean API 16 ?

code:

import android.graphics.pdf.PdfDocument;
import android.graphics.pdf.PdfDocument.Page;
import android.graphics.pdf.PdfDocument.PageInfo;

        PdfDocument doc = new PdfDocument();

Error log:

07-22 14:58:41.869: E/dalvikvm(4165): Could not find class
'android.graphics.pdf.PdfDocument', referenced from method com.example.html2pdf.Html2pdfActivity.button1onClick

07-22 14:59:33.965: E/AndroidRuntime(4165): Caused by: java.lang.NoClassDefFoundError: android.graphics.pdf.PdfDocument

Can I package up the required system library and put it in my App ? (or somehow bypass/relocate the system call) ?


回答1:


No, sorry, Google has not published a backport of PdfDocument or pretty much anything related to the Android 4.4+ printing APIs.




回答2:


Still, google has not backported the PdfDocument API (API 19). But you can use pdfium library from AOSP or the fork from PdfiumAndroid for PDF document.



来源:https://stackoverflow.com/questions/38527965/back-porting-can-use-pdfdocument-api-19-in-jellybean-api-16

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!