Reputation: 9541
I am trying to use PDFjet library to print a page to PDF in Android.
The documentation tells me that in order to print an image to PDF, I need to get a handle on the image filename like:
String fileName = "images/myimage.png";
So now i want to print an image from the res/drawable
folder. In Android the resources are referenced through R.id which returns an int.
My question is:
How do i get a handle on the image from the drawable folder as string ?
Upvotes: 0
Views: 603
Reputation: 481
try this:
String fileName = "android.resource://your.package.name/" + R.drawable.xxx;;
Upvotes: 2