My Android app renders a WebView containing a canvas. Cloud Print wants a PDF. How can I generate a PDF with my WebView to send to Cloud Print?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Is there a limit to how many levels you can nest i
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
You could first capture the canvas as a png: (taken from stackoverflow answer)
Then next step get this into a pdf. I haven't seen a javascript based converter, but one could send the png to a custom web service (perhaps running on Google Apps, Amazon AWS or a traditional hosted machine) which simple returns a pdf. ImageMagick could be used here with a wrapper cgi script or you could use some library. Alternatively it might be possible to do the conversion within the android app.
there is also WebView.capturePicture() http://developer.android.com/reference/android/webkit/WebView.html#capturePicture()