Read PDF file in specific order - android

I need to convert this PDF into a spreadsheet that looks something like THIS. But when I copy and paste all the text from the PDF (CTRL+A), the layers are in some weird unpredictable order and looks like THIS.
Is there anyway to copy and paste the text in some kind of predictable way so I can turn it into the spreadsheet I linked to? (I should mention that I'm making an android app, so id prefer the solution to be inside an Android Studio Project, but that might not be necessary)
Any suggestions are appreciated, thanks.

Related

Is there any where I can upload two strings xml files to be translated?

My app is going to be translated by several amateur translators for several languages. I can send them the xml file with all the strings that need to be translated. But, is there a cleaner way to have two files uploaded, the one in English and the one to be translated, to easily identify the strings that are still missing? Basically is like having the Translation Editor of Android Studio but online.
Maybe using google docs? How do you do this?
You can use Google Docs, but that's quite an outdated way to handle this.
The major cons:
it would be cumbersome to update strings this way
no easy way to make sure the new ones have new translations, not the old ones, etc.
no good way to provide context, if needed (typically translators have questions). You can create a column with context and take any discussions into comments, but it can get messy
A few pros:
it's fast to create (although slow to keep up-to-date)
you cooperate online and have shared access
Most developers use localization platforms, which makes updating content and online cooperation much faster.
Main pros:
it's easy to identify strings that are missing
any number of translators can translate simultaneously
track work that is done by each of translators
you can add a review/proofreading step to the process to ensure the quality of translations
leverage Machine Translations and then just have translators review them (saves lots of time)
update content, as most platforms support agile workflow
you can see who's the top translator (give some rewards, invite to other projects, etc.)
integrations (with your Git tool, Android Studio, etc), so you can automate content updates, no manual copy-pasting
Cons:
some of them are paid (still, if you're open source, you can expect a free plan)
Regarding the tools, I can suggest looking at Crowdin or Poedit.
There are many alternatives you can research, some are listed on Wikipedia.
At my work we had to translate english into Norwegian, we've done that by working with an python script that generated an ui from an csv file, after that the file could be exported in several formates as well. But your question indicates that you would like to deploy only on android, so this might be an overkill.
a simple python xml filter would fit your aproach and you could work as well with git as long as the lines stays in the same order.
if you need an quick example please comment, and ill edit this answer as soon as i get time.
At one point I have also had the same question. I need the translation for my vernacular app, also I had the requirement to maintain such that I could easily compare the translation. Here I could suggest a few things that worked out for me.
First, take the string XML file and convert it in an Excel sheet, You may generate multiple excel sheet and having a copy, paste and merge all the translations into a single sheet.
Going forward it will be easy for you to maintain all the translation. Just share a single sheet which has a string key and multiple language column. So you could easily have a look at all language translations.
In the long run, it will be helpful to you.
Few links for the conversion of XML to excel -
Convert string XML to Excel sheet
Using the below online tool works for me. Free and Opensource easy and best.
https://asrt.gluege.boerde.de/

How to create buttons dynamicly based on file/folder structure in android

im new to android and im trying to make a "simple" app.
However i would like to know if, what i have planned, is possible in android.
Basicly it's a crude database reader/navigator.
I made a folder structure in the assets folder with a few directories and *.txt files.
Now the plan is to read/scan the folder structure on startup of the program and dynamicly create buttons labeld based on the folder,- and file names.
The buttons have to link to the files and folders so the user can navigate the folder structure and open a *.txt file and read it. Also the idea is that the buttons reflect the folder structure as it is in the assets folder.
The idea is that the user can easly retrieve info from the app and i can add info to the app trough *.txt files and adjust the structure just by adding/removing directories and files in the assets folder.
i am using android studio but like i already say'd: i am a beginner with programming and would like to know if this is even possible with android.
And if it is: could someone please tell me how i should start this project or link me to some example code on how this could be done?
Thanks in advance.
If i read your idea correctly, what you are trying to achieve is very much possible. I would start looking at the AssetManager class and I believe what you are looking for is the list() command which should give you what you need.
https://developer.android.com/reference/android/content/res/AssetManager.html
You can obtain the AssetManager from everywhere within your app through the Context object which you will find to be everywhere around. ;)
From there on you can build your hierarchy and open files.
There are some useful wizard projects in Android studio, which will basically setup a general structure of an Android App. I would recommend starting with a Single Activity application and move on from there.
It sounds like ListView is something that could be beneficial for you here. ListView allows you to dynamically create buttons, or whatever you need. ListView has the added advantage that you can use an XML file to inform the ListView of how to display the buttons, images or whatever you want to display for each element of the list. There are loads of videos demonstrating how to use ListView, but here is a link to its documentation: https://developer.android.com/guide/topics/ui/layout/listview.html
Also, if you'd like a structured way of learning how to develop apps, I'd recommend the Android courses on Udacity to help you out.
Best of luck!

Android OCRSample using tesseract in Android

I want to make an application in that text is extracted and converted into another language like below app at time of camera is viewing like below screen shot of below app in play store CamDictionary
Below is the screen shot
Look in this camera is scanning and translating is done at real time can anybody suggest me example like this
I googled and find out one library
https://github.com/komamitsu/Android-OCRSample
but in that it suggested that
checkout http://code.google.com/p/tesseract-ocr/ and copy traineddata file(s) into "/mnt/sdcard/ocrsample/tessdata/" on your Android like this:
adb push ~/src/tesseract-ocr-read-only/tessdata/eng.traineddata /mnt/sdcard/ocrsample/tessdata/
I have searched out whole thing but there is no any file that should i have to put in /mnt/sdcard/ocrsample/tessdata/ can any body suggest me what is that file because i have checkout following link
svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr-read-only
but it contain so many source code for windows app also and there is like more than 700 MB
i want just andorid files that should i have to put in SDCARD please any body help me
is there any other solution than also please suggest me

Targetting to multiple file format file (eg. pdf, doc, ppt)

In Iphone you can open pdf and other file format using WebView. so, why android is not having similar functionality, for online mode we can use
"http://docs.google.com/gview?embedded=true&url= "
but in offline mode(without the internet access) how u'r going to do.
-- so, any how you are going to manage for pdf. file also then how you are going to target for other file format. It's really a biggest issue... I am struck with these things and aspect better solution. Thank you.
There are no JAR's that I'm aware of at the moment, but there is a project here that allows you to view PDF's, maybe you wanna give that a try?!
In Android the only way is using Intent and set the setContentType for the particular file format which will redirect to the number of application support the file format.

Create PDF / Word (Doc) file within app

Is there a definitive method of creating either a PDF or a MS Word Doc file within the app and email it immediately (and possibly, also store it).
I have been trying for quite some time and have found out the JAVA libraries: apwlibrary and iText. But both of them dont provide any tutorials of sorts.
Could anyone point me in the right direction?
EDIT: Come to think of it, is could an online PDF generator be used, first by sending the data to the service, then retrieve the result and save it on the phone?
I would recommend apache fop http://xmlgraphics.apache.org/fop/
you can use standard FOP to generate pdf.
Unless it is a core feature of your device to create a pdf file I would suggest not to do it yourself. Adding PDF creation is going to be quite a lot of work potentially depending on your performance needs. Java libraries will be easier to add but less performant. Native libraries combined with Java will be more hazzle to maintain build and bug fixing wise.
If you just need to email some information why dont you create a message text in html and use a intent to email it with the build in email program instead? Or if you want you could e.g. put the PDF generation on a server and just email a link..
I'm working right now with JasperReports, an open source library to create reports in Java and export them to PDF, DOC, XLS... Using it in conjunction with iReport to create a group of templates makes it really easy to create files filled with content from different types of sources (I'm using JavaBeans).
If you don't like the idea of having static templates (That's a bit annoying depending on your needs), you can always take a look at DynamicJasper (The examples on the website are great).
Good Luck!
I have used Apache POI. It seemed to work well. http://poi.apache.org/
This actually, http://poi.apache.org/hwpf/

Categories

Resources