Hello , I need to know how to convert the multiple image into a PDF ?
I have seen the Guides for Android PDF Library and set up like what it said, but when I set up to this part https://www.pdftron.com/documentation/android/guides/conversion/convert-multiple/ui/
I can’t understand how to use this part.
Also I have seen the sample code too , but still can’t figure it out.
I am using Android Studio with kotlin, and I hope you can help me out. Thanks.
system
May 25, 2021, 11:31pm
2
Hello, I’m Ron, an automated tech support bot
While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:
Guides:
APIs:
Forums:
Hi,
To convert multiple images to a single PDF, you can use the Convert.toPdf API as mentioned here: https://www.pdftron.com/documentation/android/guides/conversion/convert-multiple/api/ .
For example:
// Converts multiple images into one PDF document
private fun convertImagesToPDF(images: List<File>, outputPath: String) {
val doc = PDFDoc()
images.forEach {
// Convert image to a PDF page and adds it to the doc
Convert.toPdf(doc, it.absolutePath)
}
doc.save(outputPath, SDFDoc.SaveMode.INCREMENTAL, null)
}
Thanks for reply.
I will try this out right now , thank you very much.