-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An error will be reported when the output path has ".". #4
Comments
Now you must set the width and height of the picture. Can you add a choice to make it use the original width and height. CreateImageFromPDF.kt fun create(path: String?, outputDirPath: String?, maxWidth : Int?, maxHeight : Int? // val bitmap: Bitmap = page.renderBitmap(maxWidth!!, maxHeight!!, rectF) |
Or scale the picture according to the maximum width and height as IOS.
// UIGraphicsBeginImageContext(rect.size)
// img.draw(in:rect) |
android 10
pdf_merger 0.0.6
code:
final outputDirPath= '/data/user/0/com.auc.pdf_merger_example/cache/TestPDFMergerABCEFG5.png';
CreateImageFromPDFResponse response = await PdfMerger.createImageFromPDF(
path: singleFile, outputDirPath: outputDirPath, createOneImage: false);
An error will be reported when the output path has ".".
error log:
W/System.err(28691): java.io.FileNotFoundException: /data/user/0/com0.auc: open failed: EACCES (Permission denied)
W/System.err(28691): at libcore.io.IoBridge.open(IoBridge.java:496)
W/System.err(28691): at java.io.FileOutputStream.(FileOutputStream.java:235)
W/System.err(28691): at java.io.FileOutputStream.(FileOutputStream.java:125)
W/System.err(28691): at com.ril.pdf_merger.CreateImageFromPDF$create$pdfFromMultipleImage$1.invokeSuspend(CreateImageFromPDF.kt:67)
W/System.err(28691): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/System.err(28691): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
W/System.err(28691): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
W/System.err(28691): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
W/System.err(28691): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
W/System.err(28691): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
W/System.err(28691): Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
W/System.err(28691): at libcore.io.Linux.open(Native Method)
W/System.err(28691): at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
W/System.err(28691): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
W/System.err(28691): at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
W/System.err(28691): at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8464)
W/System.err(28691): at libcore.io.IoBridge.open(IoBridge.java:482)
CreateImageFromPDF.kt
log:
E/----MainActivity outputDirPath(28691): /data/user/0/com.auc.pdf_merger_example/cache/TestPDFMergerABCEFG5.png
E/----MainActivity splitPath(28691): /data/user/0/com
E/----MainActivity splitPathExt(28691): auc
The text was updated successfully, but these errors were encountered: