Folks, I have a few queries on how to do this in ...
# announcements
m
Folks, I have a few queries on how to do this in Kotlin. 1. I have a bunch of urls as input. Need to iterate over them and download PDF's 2. Merge all these PDF's into one single PDF what are the relevant libraries for both downloading and merging? and is it advisable to do the merge on server? Worst case there can be 300, 400 urls at once. Also, since it is IO bound to download, will coroutines help in performance?
stackoverflow 2
m
To the guys hinting to StackOverflow: This question would be closed there, because questions asking for recommendations for some resource or library are off topic.
m
Thank you 🙂 You understood my pain!
m
Thanks for the merge related libs. I've looked at it. Could you please advise me if its the right way to do this. I need to download all these files as well.
m
In short, you could use any HTTP client lib you like (here’s a few https://kotlin.libhunt.com/categories/5616-http-clients) to download the file and yes, using coroutines to make parallel requests will speed up the execution.
s
or you fall back on std-java-lib
Copy code
val pdfInputStream = URL(pdfUrl).openConnection().inputStream
m
Thank you both. This should help 🙂