Create PDF that Android devices could read - java

I use Apache PDFBox library to create pdf-files. It creates files with the XFA structure. Applications on PC, Mac or Linux can read these files without any problems. But Android devices cannot do it. I see the following error message in the pdf-file:
"Please wait... If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document".
I am trying to find a solution to create pdf files that could be read by Android devices. I cannot find any information how to do it.
Did anyone do something like that?

If you generate a non-XFA PDF you'll probably have more luck with it. The XFA spec is large, complicated and not well supported. Adobe Reader supports it but not many other readers (on Android or on desktop).

Related

What are some libraries/ways of manipulating MSWord formats in Android?

I've been working on ways to load/edit and then create .docx files for the past week now. I just need to manipulate text within a template and later down the track add pictures. I've tried the following libraries and will explain where i got to for each.
Apache POI (library for android https://github.com/andruhon/android5xlsx)
I imported all the libraries necessary and was able to create an empty .docx then when i went to load a docx then write it again and recieved this error
Apache POI (library for android https://github.com/andruhon/android5xlsx)
org.apache.poi.xwpf.usermodel.XWPFFootnote.init(XWPFFootnote.java:64)
I know that it will lead me around a circle again and will result in someone saying (these classes can't be used in android). The link is only made for xlsx (an excel format). I've already tried.... "import org.apache.poi.usermodel.*;" This is because the classes used for the function are designed for not android and reference the JDK classes
Docx4j (android branch)
I was able to get write the load and save code but it hits this error as soon as it needs the JAXB.jar, which i had imported (its this one ae-jaxb-2.2.5 for android) but the problem is that it's still trying to read the javax folder in the java JDK.
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/JAXBContext;
Please only respond to my errors if you've experienced my trauma and are living proof that this is possible. Otherwise please do recommend some other libraries or ways around me getting a Document manipulation function happening.
I'm using java 1.7_79 SDK and that latest android studio.
What are some libraries I can use to manipluate MSWord formats in Android?
Else, how, other than editting straight xml copies of the template can I program a way to alter text in a document from android?

Is there any Api in android for ms office word(.doc/.docx) to (image/html/xml/pdf) conversion

I am trying to make android application which should take ms word files i.e.(.doc/.docx) files as input and convert it into pdf as final output.
I searched for pdf conversion in android but the output i got was not proper. i tried with jWordConvert(Qoppa software library),it converts word to pdf in java very well but if we try in android it giving error,
conversion to dalvik format failed with error 1.
also i tried with apache poi library but again it is not showing proper output if my word files contains images or tables..also if we tried with apache tika with apache poi, again same results.
Itext is also there but its main use is to convert from images/html to pdf, but again output is different from outr expectation..
So my request is, Is there any api which should support android application for word to html/pdf/image conversion with proper output if my word file contains tyables, images etc.
also can i go for JNI, is there any anather way to do it.
please reply. thanx in advance.
Here is an app which does what you want to realize.
If there is an app already in app store, for me is very easy to know what that use and how is using...
I hope it helps for you a bit!

How can I open doc and ppt files without any app installed in device in Android?

How can I open doc, ppt files without any app installed in device in Android?
I am developing a document to go and I would like suggestions on how can I open doc, ppt, pdf file without any app installed.
if you want a readable output for those files, you kinda need another app. To my knowledge, stock android doesnt have a way to read any of those files nativly.
if you can manage one app, kingston office i know personally can open those types(pdf is iffy)
https://play.google.com/store/apps/details?id=cn.wps.moffice_eng&hl=en
The other way i think is if you had an external interpreter that can make a web page out of it. Maybe using drive.google.com would serve for that, but i dont know how far the browser on your device can go with it.

Native Java document parser and converter library / linux based document converters

I'm looking for a Java library which can do the following:
parse emails in *.eml or *.msg format for attachments of type DOC,DOCX,JPEG,PNG,GIF,TXT,XLS,XLSX,PPT,PDF and convert the attachmens to the TIFF format.
It can be either open source or a comercial library. Alternatively I'm looking for command line tools for linux doing this. We already tried open office, but there are too many problems with some document formats.
UPDATE:
What I found out by research up to now:
For parsing emails and extracting attachments, JavaMail (http://www.oracle.com/technetwork/java/javamail/index.html) is a good choice.
For converting documents, JodConverter (http://code.google.com/p/jodconverter/) is a confortable library. However it's only a wrapper for open office, so if there are issues with open office (and I do have often trouble with openoffice) to convert a document, you will have them also with JodConcerter.
In conclusion I had no luck (up to now) to find any document conversion library implemented in native java, which handels all common document formats, neither open source or even commercial. It seems to be a real market gap.
RainbowPDF may fit: its a commercial server based conversion tool with Java API.
If you've got a Windows server, have a look at NEEVIA Document Converter Pro. It has some mail functionality.
Apace POI is an interface to read the content of Microsoft Office documents. You will have to code the image generating and layouting components on your own. Nervertheless it reads Outlook MSG format.
Apache POI - the Java API for Microsoft Documents. However I don't know how to easily convert parsed document to TIFF.
May be a mix of different approaches could be useful? Depending on your requirements, could be possible to use several libraries to convert all the formats you need to manage: Microsoft Office, Adobe PDF, some different image formats and simple text files.
I mean, you can create a process that, depending on the type of the file extracted (using Java Mail), you could recognize what kind of format the file has and continue processing with the right conversion mechanism using the suitable library. Then you will idenfity if a file it's an image to convert, try Java Advanced Imaging, if it's a Microsoft Office file, try Apache POI and so on. For managing PDF files, you can try Apache PDFBox it's another good and opensource solution.
By the way, if you are looking not only for a Java approach, may be this thread may help you.
I don't know if there are better commercial solutions than #ChrisGer commented.
Do not waste your time looking at Apache POI, as it can only parse the content of the Office files but is not suitable for rendering it.
Since there are OpenOffice servers available, I suggest you do this. I also know you can easily use DCOM to talk with Microsoft Office apps, maybe a Java->DCOM bridge is more up to the task. However, this is not even recommended by Microsoft (so I suppose the JodConverter thing is equally unstable).

How to convert AutocadDWG To PDF?

Is there another way to convert AutocadDWG To PDF but to use third party programs? Thanks for any suggestions.
If you are looking to do it without AutoCAD then Open Design Alliance is one of the few options that I have found. If you have AutoCAD installed there is a PDF driver in the newer versions.
You could use DWG Trueview (free from AutoDesk) and print through a PDF print driver. PDF Xchange is the best PDF printer I have found for AutoCAD. Most others, including AutoCAD's own implementation bloat the PDF to about 10x the size and render text as line objects. That's a total FAIL.
You used to be able to hook into bits of Trueview programmatically but it never had a documented API as such and certaily wasn't officially sanctioned. Try Google for solutions along those lines.

Categories

Resources