Infeasible
Status Update
Comments
js...@android.com <js...@android.com>
mo...@google.com <mo...@google.com> #2
PrintDocumentAdapter as described in the stackoverflow link is indeed the way to go. Android does not currently provide APIs to edit PDFs. If you need such functionality I would recommend to embed a pdf library such as https://pdfium.googlesource.com/pdfium/ into your app.
Description
It is possible to hack together a solution like:
However, this solution assumes that you know the number of pages in the PDF file, and it assumes that we can safely ignore the PageRange[] supplied to onWrite() and just blindly write all pages out to the ParcelFileDescriptor.
It would be useful if PrintHelper had a printPdf() method, or there were some other way of just handing a PDF file to Android to be printed.
Thanks!