How to read a PDF file content???
Hi Experts,
I need to read the pdf file content.
Pdf file is in some repository
I m unable to read pdf data with getContent() function.
Please suggest me a way to read the pdf file
Help will be appreciated and rewarded
Hi Pankaj,
Are you able to achieve the above said functionality? Even I too have the similar requirement.
Can you pls let me know the solution or alternatives for your requirement you have followed...
Thanks in advance.
Nandu.
Similar Messages
-
How to read from pdf file using VB
I have a PDF file which contains three columns, emp no, designation, contact_info. I have 10 rows in that pdf file. I want to read row by row from the pdf file and write into another text file(tab delimited) using VB.
Could you please help me reading the pdf file?
Thanks,
ArindamWithout reading it in detail, this seems to be automating a save as text function in Acrobat. This will not give you any position information.
If you want position information without writing a plug-in, you need to use the getPageNthWord and getPageNthWordQuads methods in JavaScript.
If you have not already done so, you will need to download the Acrobat SDK which has the documentation you need.
Writing in C# makes even very simple things complicated; if you have a choice, consider VB. -
Hi,
I want to do something pretty basic: open a PDF file and
programmatically process its contents. Fundamentally, I would
like to
just have something that can get the text and do readLine and
return a
string for each line of text.
I searched everywhere for something that can do this. Just
reading a
PDF in raw will not work b/c it contains a good deal of
binary.
AlivePDF
http://alivepdf.bytearray.org/
appears to only be able to
create new PDF files.
The Core AS3 libraries appear to only be able to display PDF
content
in a browser:
http://livedocs.adobe.com/flex/3/html/help.html?content=PDF_1.html
Is there anything out there that can do this, or am I just
going to
have to write my own?
Thanks in advance,
DavisThanks for the info. I'm pretty new to AS/Flex, etc.
Incidentally, I'm looking to build an application using Flex, and a
good portion of it I've already written in Java. I actually have
this code done as a java library. What I'd really like to do is
just have the Flex App call that. Now, I know you can call out to
Java using RemoteObject, HTTP, WebService, etc, but the target for
this app is more likely to be Air -- i.e. a local desktop
application. As such, I don't really want to require a user to run
a J2EE web container locally just to call into a Java library.
So far, that is the only way I can figure out how to
communicate between AS and Java. The alchemy thing is what I'm
looking for -- but as a Java version. I don't really want to port
my code to C/C++ now, and then use the alchemy bridge. I'd either
port it to AS directly or use some bridge to Java.
As a Flex newbie -- can anyone tell me if there is an easier
way to integrate with Java code that doesn't require a web
container?
Thanks!
Davis -
How to Read whole pdf file in ios7 email
I recently installed iOs7 on my Ipad. I only see the first page of any pdf attachment in the emails received. How do I read a multi page pdf file in email app
Hi,
Check standard program RSTXPDFT4. It is supplied in 4.6C, you can see how to do what you want. -
How to read from pdf file?
I am new to reading pdf using C# where I have below function in my project. How to recognize text position in pdf file?
Here _dblRect has 151.0, 696.0, 400.0, 500.0
_strFileName is txt file name.
Can someone explain how this function works?
private string fcnTextFromCrop(string _strFileName, double[] _dblRect, CAcroPDDoc _docOriginal, int _intPage)
string str = "";
try
object jSObject = _docOriginal.GetJSObject();
System.Type type = jSObject.GetType();
object target = null;
object[] args = new object[] { _intPage };
target = type.InvokeMember("extractPages", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, jSObject, args);
object[] objArray2 = new object[] { "Crop", 0, 0, _dblRect };
type.InvokeMember("setPageBoxes", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, target, objArray2);
object[] objArray3 = new object[] { _strFileName, "com.adobe.acrobat.plain-text" };
type.InvokeMember("saveAs", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, target, objArray3);
object[] objArray4 = new object[] { true };
type.InvokeMember("closeDoc", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, target, objArray4);
using (StreamReader reader = new StreamReader(_strFileName))
str = reader.ReadToEnd();
reader.Close();
System.IO.File.Delete(_strFileName);
catch
str = "";
return str;Without reading it in detail, this seems to be automating a save as text function in Acrobat. This will not give you any position information.
If you want position information without writing a plug-in, you need to use the getPageNthWord and getPageNthWordQuads methods in JavaScript.
If you have not already done so, you will need to download the Acrobat SDK which has the documentation you need.
Writing in C# makes even very simple things complicated; if you have a choice, consider VB. -
How to read a PDF file in ABAP
We are on <u><b>46C</b></u>
I searched sdn and found couple of solutions which might work in higher versions of SAP but not in 46C. The classes used in the examples are not available in 46C. Could anybody please share the code to read a PDF in ABAP.
Regards
KasiHi,
Check standard program RSTXPDFT4. It is supplied in 4.6C, you can see how to do what you want. -
How to read a PDF file from server
Hi All,
I am strucked while creating new file instance .
Here i know the URL.
How to create the File instance by using this URL.
I tried the following way:
URI uri = url.toURI();
File f = new File(uri);
Here i got the following exception :
<code>
Exception in thread "main" java.lang.IllegalArgumentException: URI scheme is not "file"
</code>
Can any one help me?
Thanks in advance......Can any one help me how can i down load a file
from server by using URL?RTFAPI. Url.openStream(). -
Hi
I am trying to read contents of a pdf file .I used pdfbox it worked but the problem ,is for large pdf files it throws OutofMemory Exception
so i want to know how to read a pdf file line by line using pdfbox or any other API's
Thanksgkraju wrote:
It will work but
String x1= stripper.getText(doc);reads the whole document .so it will also throws exception if the file size is large.It might be an idea if you spent a few minutes considering the code fragment which was kindly posted. Your problem is that reading the whole file's text into memory uses up all the memory. Okay, that's a problem. So instead of whining here, why not consider what might fix that problem? The ridiculously obvious idea is to not read the whole file's text into memory. Can you figure out how to change the posted code to read, for example, only one page? If you can't figure that out then, really, perhaps you ought to consider doing something else instead of programming. -
Using a servlet to read a pdf file that is in remote server
Hi,
I read some topics about how to read a pdf file using a servlet...but my issue is that my pdf files are on a remote Sun solaris server (intranet) and my servlet will be in a public network (internet), so my question is, still be possible to use this solution to read my remote file ? how i can access the remote file ??
any idea from where I can start ??
best regards,
carlos.You may use a FTP client component to connect with your servlet to the Sun server, retrieve the bytes and serve them to the browser. Instead of reading the stream from a local file, you will be reading from a network socket, but the code -if well written and designed- may be very similar.
There are many good ftp client components for java, you may also use other protocols like HTTP or SCP (ssh file transfer).
Regards,
Martin Cordova
http://www.martincordova.com
Dinamica framework for J2EE
- the easiest way to Java webapps... -
how can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?
As has been mentioned Adobe Reader cannot export PDF page content. Nor can it create PDF or manipulate PDF page content.
What you can do is use one of Adobe's online subscription services. Two provide for PDF to Word export.
There's ExportPDF and PDF Pack.
Be well... -
How to print PDF file content from ABAP in background?
Hi,
Is it possible to print PDF file content from ABAP in background?
I have some PDF content which I need to print it, these PDF files are generated outside the SAP.
Please have you any suggestions?
Thank you
Tomas<b><u>Solution:</u></b><br>
<br>
The target output device must support PDF print, this is only one limitation.<br>
<br>
REPORT z_print_pdf.
TYPE-POOLS: abap, srmgs.
PARAMETERS: p_prnds LIKE tsp01-rqdest OBLIGATORY DEFAULT 'LOCL',
p_fname TYPE file_table-filename OBLIGATORY LOWER CASE,
p_ncopi TYPE rspocopies OBLIGATORY DEFAULT '1',
p_immed AS CHECKBOX.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
DATA: lv_rc TYPE i,
lv_filter TYPE string.
DATA: lt_files TYPE filetable.
FIELD-SYMBOLS: <fs_file> LIKE LINE OF lt_files.
CONCATENATE 'PDF (*.pdf)|*.pdf|' cl_gui_frontend_services=>filetype_all INTO lv_filter.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
file_filter = lv_filter
CHANGING
file_table = lt_files
rc = lv_rc
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0 AND lv_rc EQ 0.
MESSAGE 'Error' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
READ TABLE lt_files ASSIGNING <fs_file> INDEX 1.
IF sy-subrc EQ 0.
p_fname = <fs_file>-filename.
ENDIF.
AT SELECTION-SCREEN.
DATA: lv_name TYPE string,
lv_result TYPE boolean.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file = lv_name
RECEIVING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
IF lv_result NE abap_true.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
START-OF-SELECTION.
END-OF-SELECTION.
PERFORM process.
FORM process.
DATA: lv_name TYPE string,
lv_size TYPE i,
lv_data TYPE xstring,
lv_retcode TYPE i.
DATA: lt_file TYPE srmgs_bin_content.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lv_name
filetype = 'BIN'
IMPORTING
filelength = lv_size
CHANGING
data_tab = lt_file
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Read file error!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_size
IMPORTING
buffer = lv_data
TABLES
binary_tab = lt_file
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE 'Binary conversion error!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
PERFORM print USING p_prnds lv_data CHANGING lv_retcode.
IF lv_retcode EQ 0.
WRITE: / 'Print OK' COLOR COL_POSITIVE.
ELSE.
WRITE: / 'Print ERROR' COLOR COL_NEGATIVE.
ENDIF.
ENDFORM. " PROCESS
FORM print USING iv_prndst TYPE rspopname
iv_content TYPE xstring
CHANGING ev_retcode TYPE i.
DATA: lv_handle TYPE sy-tabix,
lv_spoolid TYPE rspoid,
lv_partname TYPE adspart,
lv_globaldir TYPE text1024,
lv_dstfile TYPE text1024,
lv_filesize TYPE i,
lv_pages TYPE i.
CLEAR: ev_retcode.
CALL FUNCTION 'ADS_SR_OPEN'
EXPORTING
dest = iv_prndst
doctype = 'ADSP'
copies = p_ncopi
immediate_print = p_immed
auto_delete = 'X'
IMPORTING
handle = lv_handle
spoolid = lv_spoolid
partname = lv_partname
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ADS_GET_PATH'
IMPORTING
ads_path = lv_globaldir.
CONCATENATE lv_globaldir '/' lv_partname '.pdf' INTO lv_dstfile.
OPEN DATASET lv_dstfile FOR OUTPUT IN BINARY MODE.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
TRANSFER iv_content TO lv_dstfile.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CLOSE DATASET lv_dstfile.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ZBAP_RM_PDF_GET_PAGES'
EXPORTING
iv_content = iv_content
IMPORTING
ev_pages = lv_pages.
lv_filesize = XSTRLEN( iv_content ).
CALL FUNCTION 'ADS_SR_CONFIRM'
EXPORTING
handle = lv_handle
partname = lv_partname
size = lv_filesize
pages = lv_pages
no_pdf = ' '
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ADS_SR_CLOSE'
EXPORTING
handle = lv_handle
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
ENDFORM. " PRINT -
How do I read a pdf file in Acrobat Reader (vs. Preview)?
How do I read a pdf file in Acrobat Reader (vs. Preview)? I have a Mac OS, need to know the process to read a pdf file document in Acrobat Reader instead of Preview. Much thanks for suggestions.
Right click the PDF. Choose "Open With..." Select Reader.
Or.
Right click and "Get Info"
under "Opens with" change the default app to Reader, and click "Change all" to set the preference for ALL PDFs. -
How do I convert a read only word doc to a read only pdf file?
How do I convert a read only word doc to a read only pdf file?
Thanks, LindaHi Linda,
I just tried it, and was able to convert a Word .doc to to PDF, in spite of the fact that it was marked Read Only. Here are the instructions for uploading and converting to PDF with Acrobat.com:
http://help.adobe.com/en_US/Acrobat.com/Acrobat/WS396AAA88-4AA4-4a40-87B8-004A5DC1E131.htm l
Kind Regards,
Michelle -
How do I save PDF files on my iPad to read later?
How can I save PDF files from a website on iBooks to read later?
Open the PDF in Safari and then tap it and you should get a bar at the top of it with 'open in iBooks' as an option - tap that and it should be copied to the iBooks app.
-
How read a pdf file and change TableCell height after reading it using itext api
I have created a pdf form file using itext ( see class CreatingFormClass ) with itext PdfPTable and PdfPCell. It is done successfully .
Now I read this pdf file and filling this pdf file(see class FillingFormClass ) and at this point i want to change PdfPCell height () according to Items.
It is possible or Not???
My code is given below.
Thanx in advance
public class FillPdfFormMainClass {
public static String RESULT1 = "E:/BlankForm.pdf";
public static String RESULT2 = "E:/FilledForm.pdf";
public static void main(String[] args) throws DocumentException, IOException {
String empName="Rakesh Kumar Verma";
// This part is Dynamic. It can be 1 item Or can be 25 items
String listOfItem="Item 1 \n Item 2 \n Item 3\n Item 4 \n Item 5 \n Item 6 \n Item 7 \n Item 8 \n Item 9";
CreatingFormClass example = new CreatingFormClass(0);
example.createPdf(RESULT1);
FillingFormClass class1 = new FillingFormClass();
class1.manipulatePdf(RESULT1, RESULT2,empName,listOfItem);
public class CreatingFormClass implements PdfPCellEvent {
protected int tf;
public CreatingFormClass(int tf) {
this.tf = tf;
public void createPdf(String filename) throws DocumentException, IOException {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream(filename));
document.open();
PdfPCell cell;
PdfPTable table = new PdfPTable(2);
table.setWidths(new int[]{1, 2});
table.addCell("Name:");
cell = new PdfPCell();
cell.setCellEvent(new CreatingFormClass(1));
table.addCell(cell);
table.addCell("Item List:");
cell = new PdfPCell();
cell.setCellEvent(new CreatingFormClass(2));
cell.setFixedHeight(60);
table.addCell(cell);
document.add(table);
document.close();
public void cellLayout(PdfPCell cell, Rectangle rectangle, PdfContentByte[] canvases) {
PdfWriter writer = canvases[0].getPdfWriter();
TextField text = new TextField(writer, rectangle, String.format("text_%s", tf));
text.setBackgroundColor(new GrayColor(0.95f));
switch (tf) {
case 1:
text.setText("Enter your name here...");
text.setFontSize(8);
text.setAlignment(Element.ALIGN_CENTER);
break;
case 2:
text.setFontSize(8);
text.setText("Enter Your Address");
text.setOptions(TextField.MULTILINE);
break;
try {
PdfFormField field = text.getTextField();
writer.addAnnotation(field);
} catch (IOException ioe) {
throw new ExceptionConverter(ioe);
} catch (DocumentException de) {
throw new ExceptionConverter(de);
public class FillingFormClass {
public void manipulatePdf(String src, String dest,String empName,String listOfItem) throws IOException, DocumentException {
PdfReader reader = new PdfReader(src);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(String.format(dest, empName)));
AcroFields form = stamper.getAcroFields();
form.setField("text_1", empName);
form.setField("text_2", listOfItem);
stamper.close();
reader.close();Hi,
I am facing the same problem. Please help me out. I just want to read a PDF file as bytes from one location and write it as another pdf file in some other location with a diolog box prompting to open or save in the location where we want.
I executed the following code:
try{
File report =new File(location);
BufferedInputStream in=new BufferedInputStream(new FileInputStream(report));
response.setContentType("application/x-download");
response.setHeader("Content-Disposition", "attachment; filename=" + report.getName());
OutputStream outs = response.getOutputStream();
int readlen;
byte buffer[] = new byte[ 256 ];
while( (readlen = in.read( buffer )) != -1 )
outs.write( buffer, 0, readlen );
outs.flush();
outs.close();
in.close();
response.setStatus(HttpServletResponse.SC_OK);
} catch (FileNotFoundException fileNotFoundException) {
PrintWriter out= response.getWriter();
out.print("<center><Font color = 'RED'><b>"+PxDSLUtils.getApplicationProperty("label.error.CTM_E017")+"</b></Font></center>");
Though it prompts with open, save dialog box when i try to open directly or when i save it some where locally and then open it i am getting the following message " File is repaired ot damaged.Operation failed." Any idea about what can be done??? Its very urgent.Please suggest.
I am not convetin to string just reading and writng as bytes itself.
Thanks in advance,
Mani
Maybe you are looking for
-
Multiple VPN connection question
I want to connect two on-premise locations to azure. The hardware in these locations only support static routing so per the documentation I can only connect on site to site tunnel to the vpn connection in azure. Im curious what my options are, can I
-
SQL2 | How to add condition on multi-value field?
Hello, I am trying to perform a JCR query using SQL2 in CQ5.6. For one of the conditions, I wish to compare a multi-value field (E.g. cq:tags). How would that be possible? Currenlt, I only managed to compare my query item's cq:tags to a single value
-
Control key is set for u2018Process manufacturing with Inspectionu2019
Hi, Which control key is set for u2018Process manufacturing with Inspectionu2019? What is the meaning of FS Relationship
-
New message output determination after changed a PO
Hello experts. When we create a purchase order a message output is triggered automatically according to customizing done in MN04. Ok for that. In which part of customizing can we define the output conditions of trigger again a PO? For example, I want
-
Can I customize the appicon to change per profile?
I would like to have the appicon.ico to show a custom ico file on select profiles. I know I can place a custom ico in the main directory: "Firefox\chrome\icons\default". That affects all instances of firefox regardless of the profiles being used. I'm