URGENT: How to read the content of a PDF-file in Java?
Hello
What I need are some classes which can read a pdf and translate it in normal Text, so that I can write the content of the pdf in my database.
Where can I find those classes? Or how else could I get there?
www.lowagie.com/itext
www.etymon.com/pj
www.retep.org.uk/pdf
www.pdflib.comwww.pdfzone.com
www.planetpdf.com
www.purepdf.com
www.adobe.com
www.pdfstore.com
www.adobe.com/proindex/acrobat/formsresources.html
www.partners.adobe.com/asn/developer/acrosdk/forms.html
www.rrsys.com
www.javafoundry.com/javapdf
www.novagraphix.com/internet_publishing_with_acrobat/forms/forms_tutorial.html
www.binarything.com
Similar Messages
-
How to read the content of a text file (by character)?
Guys,
Good day!
I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
Please help me. Thank you so much in advance.
Jojohttp://java.sun.com/javase/6/docs/api/index.html
package java.io
InputStream.read(): int
Reads the next byte of data from the input stream.
Implementation:
InputStreamReader
An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted. -
How to read the content of ms-word file use pure java???
how to read the content of ms-word file use pure java???
hi,
check this: http://jakarta.apache.org/poi/ -
Help on how to read the content of an XML file from the payload
I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
Im trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
In the Bean I want to read the content of the attached XML file, it could be the order number.
The filename should then be Order number.XML.
<u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
<i><b>Frank</b></i>hi,
check this: http://jakarta.apache.org/poi/ -
How to read the content of this excel file in LV
Hi could you please let me know how can I read the content of this excel file using the Read From Speardsheet function. It contains text and numbers
Thanks
The excel file is attached
Attachments:
Datalogging.zip 307 KBCheck attached VI.
I am not allergic to Kudos, in fact I love Kudos.
Make your LabVIEW experience more CONVENIENT.
Attachments:
ReadFromExcel.vi 27 KB -
How to read the contents of a text file and populate the data in a table ?
Hello All,
Can anyone advise on how to acheieve the above ? I am trying to read in a text file (CSV) and have the contents populated to the respective UI elements in a table. Any help is greatly appreciated.
from
Kwok WeiHi,
Let us consider you have list of names(Seperated by delimeter) in a text file and you want to display in a table.
1. Create Context Node "Names" and context attribute "Name"
2. Create Table and bind to the above context.
3.Write the following code in the "Init method.
try{
FileReader f =new FileReader("");
BufferedReader r=new BufferedReader(f);
String names=r.readLine();
Vector Names=new Vector();
// Use Tokenizer and store all the names i a vector//
for(int i=0;i<Names.size();i++){
IPrivate<<VieName>>.INameElement ele=wdContext.createNameElement();
ele.set<<Name>>( Names.get(i).toString());
wdContext.NodeName().addElement(ele);
Regards, Anilkumar
Message was edited by: Anilkumar Vippagunta -
How to read the name of a PDF file? - function module
Hi,
I have <b>some individual pdf documents in my desktop</b>.I need to <b>bulk-upload it to the content server and document related information to the SAP-DB</b>.
Need your guidance.
Regards,
John.try this code it will convert file to PDF file
REPORT ZWARUN_CONVERSION_PDF .
***********Tables***************
TABLES:VBRK.
***********Data Declaration***************
DATA: LV_NUMBYTES TYPE I,
LV_SPOOLNO TYPE TSP01-RQIDENT.
DATA:C_LAYOUT LIKE PRI_PARAMS-PAART VALUE 'X_65_132', "Layout
C_X TYPE C VALUE 'X'.
DATA: NUMBYTES TYPE I,
CANCEL.
***************Internal table of Pdf************
DATA: IT_PDF LIKE TLINE OCCURS 10 WITH HEADER LINE.
DATA:BEGIN OF IT_VBRK OCCURS 2,
FKART LIKE VBRK-FKART,
FKTYP LIKE VBRK-FKTYP,
VBTYP LIKE VBRK-VBTYP,
END OF IT_VBRK.
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME.
SELECT-OPTIONS: S_BUKRS FOR VBRK-BUKRS,
S_GJAHR FOR VBRK-GJAHR.
SELECTION-SCREEN END OF BLOCK BLK .
PARAMETERS:
spoolno like tsp01-rqident,
DOWNLOAD AS CHECKBOX DEFAULT 'X',
P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\warun1.pdf'.
START-OF-SELECTION.
SELECT FKART
FKTYP
VBTYP
INTO TABLE IT_VBRK
FROM VBRK
WHERE BUKRS IN S_BUKRS
AND GJAHR IN S_GJAHR.
END-OF-SELECTION.
DATA: LK_PARAMS TYPE PRI_PARAMS,
LV_VALID.
if not p_mailid is initial.
All the parameters passed are constants, so exceptions
doesn't get raised
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = ' '
LAYOUT = C_LAYOUT "'X_65_132'
NO_DIALOG = C_X
IMPORTING
OUT_PARAMETERS = LK_PARAMS
VALID = LV_VALID.
IF LV_VALID <> SPACE .
NEW-PAGE PRINT ON PARAMETERS LK_PARAMS NO DIALOG.
*--To display the final report
PERFORM PRINT_REPORT.
NEW-PAGE PRINT OFF.
*---To convert the download to PDF
PERFORM CONV_TO_PDF_DOWNLOAD.
PERFORM DOWNLOAD.
ENDIF.
endif.
*--To display the final report
PERFORM PRINT_REPORT.
*& Form print_report
FORM PRINT_REPORT .
*write:/ 'I will do it' color 4.
write:/ 'Yes' color 4.
write:/ 'we will do it' color 4.
write:/ 'lets talk abt changing life style' color 4.
write:/'By warun'.
LOOP AT IT_VBRK.
WRITE:/ IT_VBRK-FKART,IT_VBRK-FKTYP,IT_VBRK-VBTYP.
ENDLOOP.
ENDFORM. " print_report
*& Form conv_to_pdf_download
FORM CONV_TO_PDF_DOWNLOAD .
CLEAR IT_VBRK.
WAIT UP TO 2 SECONDS.
LV_SPOOLNO = SY-SPONO.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = LV_SPOOLNO
NO_DIALOG = ''
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
PDF_BYTECOUNT = LV_NUMBYTES
PDF_SPOOLID = pdfspoolid
LIST_PAGECOUNT =
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = IT_PDF.
ENDFORM. " conv_to_pdf_download
*& Form download
FORM DOWNLOAD .
download PDF file ***********
CHECK DOWNLOAD = 'X'.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
BIN_FILESIZE = LV_NUMBYTES
FILENAME = P_FILE
FILETYPE = 'BIN'
IMPORTING
ACT_FILENAME = P_FILE
FILESIZE = LV_NUMBYTES
CANCEL = CANCEL
TABLES
DATA_TAB = IT_PDF.
IF CANCEL = SPACE.
WRITE: / LV_NUMBYTES, P_FILE.
ENDIF.
ENDFORM. " download -
How to read the content in one node of XML in Java? Pls help
My dear brothers,
I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
1. Create a GUI form which gives the ability for user to choose a XML file (ok)
2. Load XML and return the file (ok)
3. Read the file from node to node to create the node in Tree View (?!)
Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
Hoang Yen BinhI hope this one helps you.
<ABC Type="ProductBased" ProdName="One" Location="India">
<CEO>Raj</CEO>
<Finance>Vikram</Finance>
<HR>Karthik</HR>
<Technical>Satish</Technical>
</ABC>
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Attr;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.DOMException;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
public class XmlReading {
Document doc;
Element element;
public static void main(String[] args) throws Exception{
XmlReading xr = new XmlReading();
xr.getXmlParser(args);
public void getXmlParser(String[] args) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
if(args.length != 1) {
System.err.println("Argument Required");
try {
DocumentBuilder builder = factory.newDocumentBuilder();
doc = builder.parse(new File(args[0]));
}catch(ParserConfigurationException e1) {
}catch(SAXException e2) {
}catch(IOException e3) {
getAttributes();
public void getAttributes() {
// Retrive the entire Document from the Dom Tree
element = doc.getDocumentElement();
// System.out.println(element);
NamedNodeMap attrs = element.getAttributes();
// Get number of attributes in the element
int numAttrs = attrs.getLength();
// Process each attribute
for (int i=0; i<numAttrs; i++) {
Node node = attrs.item(i);
// Get attribute name and value
String attrName = node.getNodeName();
String attrValue = node.getNodeValue();
System.out.println(attrName + ": " + attrValue);
String s1 = element.getTagName();
System.out.println(s1);
// To get all the elements in a DOM Tree
NodeList nl1 = element.getElementsByTagName("*");
int i2 = nl1.getLength();
System.out.println(i2);
for(int i=0; i<i2; i++) {
System.out.println(nl1.item(i) + "\n");
} -
How to read the contents of attached files
Hi,
I am designing a Form using LiveCycle Designer 8.0
Scenario:
User can attach the file through "Attachments" facility provided on Adobe Reader.
The requirement is to attach 3 documents and post it to SAP system using Web services.
I am using the following code(which i got from this forum only) to find the number of files user has attached.
d = event.target.dataObjects;
n = d.length;
xfa.host.messageBox("Number of Attachments: "+n);
//Displaying the names of the Attached files
for( i = 0; i < n; i++ )
xfa.host.messageBox("Name of the file: "+d[i].name);
My problem: is how to read the contents of the attached files so that I post it to SAP using Web services
Thanks in advance!!
Taha AhmedIn order to read the content of the Redo Log files, you should use Logminer Utility
Please refer to the documentation for more information:
[Using LogMiner to Analyze Redo Log Files|http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/logminer.htm#SUTIL019]
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com
[Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/] -
I am doing a project for internet control using Java,PHP and MySql.All sites should go through the proxy server only.If the HTTP header contains Content-Length,am getting the content length as below:
public class HTTPResponseReader extends HTTPMessageReader
String statusCode;
public HTTPResponseReader(InputStream istream) throws IOException, NoSuchElementException
BufferedInputStream distream = new BufferedInputStream(istream);
retrieveHeader(distream);
StringTokenizer st = new StringTokenizer(new String(HTTPMessageReader.toArray(header)));
versionProtocol = st.nextToken();
statusCode = st.nextToken();
String s;
while (st.hasMoreTokens())
s = st.nextToken();
if (s.equals("Transfer-Encoding:"))
transferEncoding = new String(st.nextToken());
if (s.equals("Content-Length:"))
contentLength = Integer.parseInt(st.nextToken());
if (s.equals("Connection:"))
connection = new String(st.nextToken());
if (connection.equals("keep-alive")) mustCloseConnection = false;
retrieveBody(distream);
}After getting the Content-Length,i used read method to read the content upto that content length.Then i concatenated the HTTP header and body and the requested site was opened.But some sites dont have Content-Length.Instead of that,Transfer-Encoding is used.I got the HTTP Response header as "Transfer-Encoding:chunked" for some sites.If this encoding is used how to get the length of the message body and how to read the content.
Can anybody help me.
Thanks in advance...
Message was edited by:
VeeraLakshmiWhy don't you use HttpUrlConnection class to retrieve data from HTTP server? This class already supports chunked encoding...
If you want to do anything by yourself then you need to read HTTP RFC and find all required information. Well in two words you may reject advanced encoding by specifying HTTP 1.0 in your request or download chunked answer manually. Read RFC anyway :) -
How to get the content in embed swf file in Swf Loader on run time
How to get the content in embed swf file in Swf Loader on run time
[Bindable]
[Embed(source="assets/index.swf")]
private var SWFSRC:Class;
<mx:SWFLoader id="_swfloader" source="{SWFSRC}" />Hi Flex harUI,
Throw the error.
Access of undefined property content -
Can a search engine read the contents of a Library file embedded in a page?
Can a search engine read the contents of a Library file
embedded in a page? Or would SSI be the way to go. I'm creating a
large library of text-based information and links, and I want to
have much of it modular so I can add a link and all the many pages
on my site updates to reflect the change. A big concern is that
when a search engine visits my site, can it read the content
embedded in the library item, or is SSI a better method to help the
search engine read my content?
ThanksYes, search engines can read Dreamweaver library items. The
library only exists on your own hard drive. Once you add the
library item to your pages it's in there as regular HTML.
If you have more than 20 pages on your site, they say SSI is
better, because when you update you only update the SSI. If you
stick with library items each page has to be uploaded every time
the library is updated. -
Error in reading the contents of a zip file
EHello Experts,
I want to read the contents of a zip file.I have written the following program which reads the contents of a file named "index.xml" which resides in ReadZip.zip.My problem is , it is reading only the first line of that file & after that it is giving this error.
java.io.IOException: Stream closed
at java.util.zip.ZipInputStream.ensureOpen(ZipInputStream.java:43)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:67)
at components.ReadZipFile2.main(ReadZipFile2.java:26)
public class ReadZipFile2 {
public static void main(String args[]) {
try {
FileInputStream fis = new FileInputStream("C:\\ReadZip.zip");
ZipInputStream zis = new ZipInputStream(fis);
ZipEntry ze;
while ((ze = zis.getNextEntry()) != null) {
System.out.println(ze.getName());
if (ze.getName().equals("ReadZip/index.xml")) {
long size = ze.getSize();
if (size > 0) {
System.out.println("Length is " + size);
BufferedReader br = new BufferedReader(
new InputStreamReader(zis));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
br.close();
} catch (IOException e) {
e.printStackTrace();
}It seems that zis is getting close after reading the first entry of file.I am unable to guess the reason for this.Please help.Thanx in advance.[redacted confused advice]
[_Compressing and Decompressing Data using Java - with many code samples_|http://java.sun.com/developer/technicalArticles/Programming/compression/|Yes Virginia, there really are code samples] -
How to download the content to a PDF source file.
Hi All,
I am using FileDownload UI element in the ADOBE interactive to download the content to a PDF file.
Please help me how to download content to a PDF file.
Thanks,
Archana.hi Archana,
you will get the byte format of the pdf form the pdf source attribute , create a resource using that byte data of type pdf as following
IWDResource iwdResource = WDResourceFactory.createResource(wdcontext.currentContextElement().getPdfSource(), "resource name", WDWebResourceType.PDF);
create a context element say fileresource of type iwdresource.
set it's value as following.
wdContext.currentContextElement().setFileResource(iwdResource);
and do the following code on the action of the download button.
public void downloadFile( )
//@@begin createExternalPopup()
// get the resource from the context
IWDResource resource = wdContext.currentContextElement().getFileResource();
//create an external window. A download dialog should appear
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getUrl(WDFileDownloadBehaviour.AUTO.ordinal()) ,"Title");
//@@end
with regards
shanto aloor -
Can we Read/Display the content of Word/PDF file in Flex 3/4 ?
Hello All,
Can we read/display the content of Word/PDF file in Flex 3 or Flex 4?. I have one word file containing Arabic and English content with some settings like Bold, Color, Align etc. I want to display the content of this word file as it is in the flex web application.
Awaiting for prompt reply.
Thanks and Regardsthank you for your immediate reply, but,
sorry, this does not work.
With this code:
<cfpdf action = "read" source = "dok_1.pdf" name =
"mypdf">
<cfdump var="#mypdf#"/>
I get this result:
Everything, but no text of the document.
PDFDocument
Application name of application
Author bimbam Verlag GmbH
CenterWindowOnScreen [empty string]
ChangingDocument Allowed
Commenting Allowed
ContentExtraction Allowed
CopyContent Allowed
Created D:20080710
DocumentAssembly Allowed
Encryption No Security
FilePath [empty string]
FillingForm Allowed
FitToWindow [empty string]
HideMenubar [empty string]
HideToolbar [empty string]
HideWindowUI [empty string]
Keywords [empty string]
Language [empty string]
Modified [empty string]
PageLayout SinglePage
Printing Allowed
Producer [empty string]
Properties [empty string]
Secure Allowed
ShowDocumentsOption [empty string]
ShowWindowsOption [empty string]
Signing Allowed
Subject [empty string]
Title Rheinische Angler-Zeitschrift
TotalPages 1
Trapped [empty string]
Version 1.3
Maybe i do not understand the cfpdf tag the right way.
What i want is a kind of pdf-to-text conversion.
Do I have to use the processddx action? I do not think so.
But there is a property DocumentText .. ?
Maybe you are looking for
-
Expand/Collapse of structure in Query using WAD command
Hi all, i have a query in which i have 3 selections inside a formula, and the formula is in collapsed state. Now my requirement is to expand the formula using a button in WAD so that the three selection columns inside the formula can be seen. How can
-
Trying to Rebuild and my scores keep tanking!
Hi, I've been working on my credit for a little over a year. Here's what I have: BankOpenedLimitStatusBalanceHigh Credit CommentsBofA2/13$500current$175$531AllPIF each moCapitalOne3/14$8001x30 10/14$46$439AllSm balance each moDiscover (AU only)3/87$
-
I am working in the hierarchy and re-naming fields names for reference when pointing to them in scripts. Everything has been working fine for days now. Now for some reason I cannot re-name an object. I am allowed to highlight the object, delete the e
-
Ipod could not be indentified by itunes store
http://puu.sh/61Qqc.png this happens when i try to open itunes. any suggestions? please help!
-
CAF CORE COLLECTION_ASPECT_KEY error
I have a simple entity "Approver" with attribute functions (string) and contacts (String), cardinality 0:n for both. I build UI object based on Object Editor pattern for this Approver Entity service. Also build the UI object based on Relationship Tab