0
votes

I was looking the HTML to PDF Conversion in android app

I have a problem to do the "it must be in package ".../java/android/print/" from solution number 1. How can I add the PdfConverter.java in android.print packages and the android studio recognise it ?

When I add it manually, fixing an PdfConverter.java and add it to the directory, the android studio do not recognise it and i got "Unresolved Reference : PdfConverter".

Is there another way, appropriate, to add the PdfConverter.java in the android.print package without getting the above error ?

Thank you in advance.

2
please share the code for convenience. thanks - Haseeb Mirza
@HaseebMirza I updated - chaviaras michalis

2 Answers

2
votes

Add the java class in such own-made package tree (right-click on java directory -> New -> Package -> name it "android", then do the same with "print", then add to this package the PdfConverter):

enter image description here

1
votes

PdfConverter class is accessing PrintDocumentAdapter, from Android SDK's android.print package. You should made a package in project named android.print and I put PdfConverter class there and there would be no errors from lint in IDE.

Structure should be same as on this github repo https://github.com/blink22/react-native-html-to-pdf/tree/master/android