Closed muhammadn closed 2 years ago
It sounds like you did not call PDFBoxResourceLoader.init(getApplicationContext())
. You need to add this somewhere before you use any PdfBox-Android functions
@TomRoush Thank you! I missed that part. added it and it works.
here is an example for others who are using flutter to call this library:
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler {
call, result ->
if (call.method == "printIpp") {
val ippUrl = call.argument<String?>("ippUrl")
val mode = call.argument<String?>("mode")
val document = call.argument<String?>("document")
val numCopies = call.argument<Int?>("copies")
val pages = call.argument<String?>("pages")
// here is the solution
PDFBoxResourceLoader.init(getApplicationContext())
// send document to printer to print
printIpp(ippUrl, mode, document, numCopies, pages)
// successful operation, return to app
result.success(null)
} else {
result.notImplemented()
}
}
}
Describe the bug cannot load glyphs
To reproduce Code snippet to reproduce the behavior:
PDF example (20 APRIL 2021M) KENYATAAN AKHBAR KEBENARAN SOLAT JUMAAT, SOLAT FARDU DAN SOLAT SUNAT TERAWIH SERTA AKTIVITI-AKTIVITI PENGIMARAHAN MASJID KELANTAN 2021. - Copy (3) (1) (1).pdf
Expected behavior No error when initialising pdfbox Actual behavior NullException error when initialising pdfbox
Environment details:
Additional context Stacktrace: