Actually I am attempting to extract the data from a PDF file but I didn't find any example in the internet and I am asking if there is any possibility that I can use the JPedal library to open to read the data from a PDF file.
You can use PDFBox from Apache.
I am not familiar with JPedal, but I write lots of code that generates and processes pdf files. I use IText and highly recommend it. If you have a specific question on how to process a pdf file, let me know.
Related
I don't have much knowledge regarding PCL6 file format. I wanted to know if there is any way to extract text out of PCL6 file using Java.
Thanks,
Usman
Convert the file to PDF (see Ghostscript/GhostPDL) and then use Apache Tika.
The first step will require to use some Runtime.getRuntime().exec(...)
How can I open a Microsoft Word docx file in Java? furthermore, how can I open it if it is password protected?
For instance,
File f = new File("hello.docx");
Please try to avoid responding with things such as "you shouldn't do this." I have a good reason for this, so please stick to the question when you answer. thanks a lot!
There is Apache POI project for working with MS Office files. DOCX file is just a zip file with series of XML files inside, so you can unzip the file and work with XML. The XML spec (Open XML) is known.
I haven't personally used it, but it looks like Apache POI will work for you: http://poi.apache.org/
You can use docx4j too. http://www.docx4java.org/trac/docx4j
I have used both docx4j and Apache's POI libraries, if you are working with .docx I would recommend .docx4j. Automated alot of the process of creating a .docx.
There is a great exmaple here : http://java.dzone.com/articles/create-complex-word-docx
on how to create a .docx using the docx4j package.
If the docx is password protected, it won't be a zip file. It will be a compound file. See Overview of Protected Office Open XML Documents
To read a compound file in Java, use POIFS. POIFS is part of POI (docx4j uses it as well, so if you download the docx4j distribution, you'll be able to use the POIFS API)
Once you have decrypted the encrypted package, you can read it using docx4j or POI.
Edit: OK, now docx4j can handle password-protected docx automatically.
Have you tried to open it using the Open Office api? It can work with a lot of documents types.
I used it with MS Excel files .xls ( old version ) format.
Hope this can help you.
I want to convert .mxd file into .pdf file. I have google under this topic but I ended with nothing. I want to know that can I convert .mxd to .pdf directly or do I need to convert using intermediate conversions?
any help would be appreciate.....
thank you.
Typically .mxd files are mapping files created with ESRI ArcGIS. ArcMap has a tool to export a specific section to a pdf.
If you must do this programmatically (not by using a manual tool) you can do this I believe by publishing the MXD as a map service and then using the JavaScript, etc. APIs to make the conversions.
well i found this
http://arcscripts.esri.com/details.asp?dbid=15139
I am writing an application for searching the Content of Documents
i have already written the code for searching the documents which are editable by notepad.
I also wish to do the same for docx files. After some research i have come up with these two things
http://www.infoq.com/articles/cracking-office-2007-with-java
this method requires me to extract docx file and then search the xml files however this would involve an extra overhead on the extraction part and frankly i dont know how to process an xml file ( discarding attribute content etc)
http://www.javadocx.com/download
this method allows me to import a jar library to my project and supposedly i can create docx files with it, what i dont understand is how to open docx files using it
can anyone recommend me a alternate method to perform the same action or help with the above two mentioned methods?
Try http://tika.apache.org/ or docx4j or POI.
how to Parse a PDF file and write the content in word file using Java?
For parsing a PDF file in Java, you can use Apache PDFBox: http://incubator.apache.org/pdfbox/
For reading/writing Word (or other Office) file formats in Java, try POI: http://poi.apache.org/
Both are free.
Try the iText java library:
iText is an ideal library for developers looking to enhance web- and other applications with dynamic PDF document generation and/or manipulation.
It can be used for your parsing step.
As for generating word documents - the OpenOffice Java API might be able to generate Word compatible docs (no personal experience with this API).
You might want to try any of these:
http://incubator.apache.org/pdfbox/
https://pdf-renderer.dev.java.net/
Once you are reading the contents of the PDF file, you can as well store them in a ODT file or a text file. For ODT file, try http://odftoolkit.openoffice.org.
Best!
You could use iText if the source PDF is mostly text. Images and such are quite hard to handle while parsing. If it's text only, it's as easy as 10 lines of code. See the iText manual for examples.
For writing word files there's only Apache POI. It can be a little tricky to figure out, but for such a simple task it shouldn't be any problem.