Good day! I have few image files and each of them contains only one single page of one big document. I need to join those image files and produce only one file (image or pdf) that has to include all pages of this document.
I've implemented this functionality with KIO4_Pdf extension (as a multi page PDF) but the quality of images in the resulting pdf file is becoming too poor for zooming.
Maybe somebody can suggest me another method/extension for image files joining without image quality decrease? Thanks. Alex
It sounds like your images include a certain amount of text. If you start with super-large images and then scale them to the required size, you might get acceptable results but it is best to store the images and text separately in PDF. All the image preparation should be done on your PC before being loaded by your App when starting with large images - Android could struggle to cope, depending on device.
Even with images only, they must start-off as high quality. The PNG format is best for scaling.
Thank you Chris. I have mainly JPG images of scanned pages of the documents in A4 or A5 format that are about 0.5-1.5 MB each (scanned at 200-300 dpi.) There are pages with texts, diagrams, documents and pictures.
I was using KIO4_pdf extension for creating a multipage pdf joining few image files. This extension is saving as a page in a multipage pdf file everything that there is inside one arrangement but only it's visible part. It means that you are obliged to scale the original image to the dimension of the screen before asking the extension to save it as a page in multipage pdf. But then comparing the original image with the result in pdf, you see a big lost of image quality (often it's even difficult to read a text on the page).
Maybe there is another extension that permits to save as a PDF page original image (not scaled to the dimension of the screen)?
Or you know a way not to scale images to screen before saving them with KIO4_pdf?
I found Taifun's extension that permits overlap two images producing another image and maybe there is similar solution to take two image files and join them in one image file without scaling?
Thank you again. Alex
Does the pdf build have to happen on the app ? Could you use something online like google docs ?
If possible, build the PDF on a PC. The combination of JPG format, low dpi and text in the images means that the quality is low from a Smart Phone point of view as they generally have high resolution.
I have to implement this elaboration in app and of course it will be better not to use external services but if Google docs is the only solution to keep the original image quality - I'll try to implement it but I've never used Google docs. Could you recommend me specific example? Thanks
If possible, it would be a good idea to produce images of better quality.
But the original images are easily readable and their quality is enough good. I'm loosing the image quality saving it in multipages pdf using pdf extension.
It's inside the new multipages pdf that those images are becoming much less readable because I'm obliged to rescale them to fit the smartfone screen dimensions. That's why the increasing of the quality of original images can't solve the problem. As I understood I need or another extension that can join in one new file few original image files without any scaling or to use other methods (like Google docs). Is it right?
...which is why they need to be high quality in the first place - the better the quality, the better they will scale. JPG is not a good format for images that contain text. You may see some additional improvement if the files are not compressed.
As I said before, a PC is a better tool for this type of task than a Smart Phone is, but the PC can prepare good files for Smart Phones. Unfortunately nothing in your task is easy
Thank you Chris. I understood Unfortunately I can't use pc and I can't produce a new scan of those documents in order to increase the original quality.
Maybe I can try to convert jpg to PNG before scaling it to multipage pdf? Can it help?
Or maybe there is an extension that could try to increase the image quality?
Unfortunately that will not work
I'm afraid not. The easiest way to maintain image quality is to start with a large high-resolution file and only ever scale it down. An Android App would have to load such files one-at-a-time from external storage to process successfully and in an ideal world the originals would be of the same height-width ratio as the final size images to fit the device (that is of course not practical if the App is going to be used by several different devices, hence why it's such a bad idea to have text in images).
How do your images look in a Web Browser? If they look good, then scaling down to work with a Web View component in the App, but not re-sizing to fit the Screen might help - the Web View will allow the image to be over-size in height or width and the User can scroll the page. This would mean they would not consist of a multi-page file but stored in a folder (or within the App if they are the only images the App is to display), the User would not see any difference.
Thank you very much Chris. Maybe it's the simplest solution to store all files inside one document folder and then simply show it to the user one by one as single pages. Thank you again. I'll do it!
A simple html file for displaying images, using the webviewstring.
image.html.txt (611 Bytes)
(remove the ".txt" from the filename)
Place this html file in the same folder as the image files, then set image files to the webviewstring.
Credits @SHUBHAMR69 for the original file
It's simply genius!! Thank you very much!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.