How to read the and Write the PDF file give me the solution

Hi all,
How to read the and Write the PDF file give me the solution
My coding is
import java.io.File;
import com.asprise.util.pdf.PDFImageWriter;
import com.asprise.util.pdf.PDFReader;
import java.io.*;
import java.io.FileOutputStream;
public class example {
// public example() {
     public static void main(String a[])
          try
          PDFReader reader = new PDFReader(new File("C:\\AsprisePDF-DevGuide.pdf"));
               reader.open(); // open the file.
               int pages = reader.getNumberOfPages();
               for(int i=0; i < pages; i++) {
               String text = reader.extractTextFromPage(i);
               System.out.println("Page " + i + ": " + text);
// perform other operations on pages.
PDFImageWriter writer = new PDFImageWriter(new FileOutputStream("c:\\new11.pdf"));
               writer.open();
               writer.addImage("C:\\sam.doc");
               writer.close();
               System.out.println("DONE.");
reader.close();
          catch(Exception e){System.out.println("error:"+e);
          e.printStackTrace();
I get the pdf content then it returns the string value but ther is no option to write the string to PDF, and we only add a image file to PDF,but i want to know how to wrote the string value to PDF file,
Please give response immtly
i am waiting for your reply.
thanks,
Suresh.G

I have some question flow
How library to use this code.
I try runing but have not libary.
Please send me it'library
Thank you very much!

Similar Messages

  • How do I download and print a pdf file in osx mountain lion

    How do I download and print a pdf file?

    control click on your PDF to download option
    Open it on your desktop Command-P is the short cut for print option.

  • How can I copy and paste a pdf file from my picture file and paste onto a document?

    How can i copy and paste a pdf file onto a document.  I am trying to place and article onto my
    Reverbnation Press page.  They only give you the option to either place a url link or paste a document.  There
    is no uploading for the Press page.  thanks, elena

    The Digital Editions forum is here, in case this is what you are talking about:
    http://forums.adobe.com/community/adobe_digital_editions
    If you are not, I apologize for the misunderstanding.

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • How to Zoom in and Out on PDF files in Safari?

    Safari help is not helpful since it gives inaccurate information on how to Zoom in and Out on a PDF file that has opened in Safari. The help says to control click the page and choose the zooming level you desire. However control clicking the PDF file in Safari brings up a save page box. I tried some of the other keys with clicking and they did not work. Thanks in advance to those who helped me save a PDF file to the desktop so I can view in Preview.- But often I just need to be able to zoom in to read the tiny text that is displayed.

    Thanks for getting back to me-
    the website I am trying to zoom into a PDF on is:
    http://www.beedocuments.com/software/Timeline/screenshots.html
    I click on one of the screenshots- it loads into a safari window.
    When I control key click on the image- a pop up menu comes up asking me to save the image to deskotp- add it my image library and 2 other save options. No zoom in or Zoom out. I only have an apple pro mouse and my track pad- so right clicking isn't an option.

  • How can I repair and open damaged PDF files?

    I need to download every online issue of ASOS magazine, which are all PDF files, and I have already downloaded at least five to my USB stick, and they have all worked perfectly. However, there are five more issues that I have not downloaded, and I need to download them. To my frustration, every time that I download any of these files to the same USB stick, a box appears saying that the file cannot be open because it is damaged and cannot be repaired. I have followed your instructions and saved these files to my hard drive instead, but they are still damaged and do not open properly. Please tell me how I can open my files without Adobe Reader saying that they are damaged.
    Steps to reproduce the bug:
    I download an online issue of ASOS magazine from ASOS.com or Publitas.com; the latter is the official website for bask issues of ASOS magazine.
    The file downloads as normal.
    I open the file in Adobe Reader.
    Result: A box appears saying that the file is damaged, and that Adobe Reader is trying to repair the file. Only a second later, another box appears, saying that the file cannot be repaired, thus not allowing me to view the file as normal.
    The result that I want: No boxes appear saying that the file is damaged, and it opens as normal.

    The download links of the problem PDF files are:
    http://epub02.publitas.com/ASOS/11/magazine.php
    http://epub02.publitas.com/ASOS/10/magazine.php
    http://epub02.publitas.com/ASOS/17/magazine.php?spread=88#/spreadview/
    http://epub02.publitas.com/ASOS/19/magazine.php?spread=90#/spreadview/0/
    http://epub02.publitas.com/ASOS/23/magazine.php?spread=88
    The latest issue of the ASOS online magazine can always be downloaded at:
    http://www.asos.com/au/Women/Magazine/Womens-Magazine-Asos/Cat/pgehtml.aspx?cid=6200&WT.ac =Nav_Magazine
    My OS is WIndows Vista with Service Pack 2. The browser that I use is Internet Explorer.
    The way I download these files is quite simple:
    I open any one of the webpages whose URLs I have listed.
    I wait a few minutes for the software that allows the magazine to be read online to load fully. Publitas.com allows entire magazines to be viewed online, and also, among many other features, provides viewers with a search engine which allows them to search for certain words or phrases in the magazine.
    Once the software has fully loaded, on the toolbar at the top of the webpage (in the case of ASOS.com, the toolbar is underneath the various toolbars and boxes found on www.asos.com) there is a button featuring the Adobe Reader logo; when you hover your mouse over the logo, it will say 'download PDF'. To download the PDF file, you first click on the logo.
    The 'View Downloads- Windows Internet Explorer' window will open. The name of the PDF file, and the URL on which it was found, will both appear in the window, under the Name column. Under the Location column, it will say, 'Do you want to open or save this file?'. Under the Actions column, there will be two buttons, saying Open and Save. I click on the arrow on the save button and choose to save the PDF to my hard drive, in the Documents folder (which is currently the default folder for saving PDF files).
    That is how I download a PDF.

  • How to get Header and footer in PDF file from a report program

    I am generating spool from ALV GRID DISPLAY. Only the body of a report is coming in the SPOOL. I mean content of the TOP_UP_PAGE event is not coming in the SPOOL. Please suggest me.
    Coding I am pasting here.
    * Begin of modification(+) by I080845 ( Prasanta Maiti ) 12/23/2011 Defect# 17821
        IF sy-batch IS NOT INITIAL
    * Begin of modification(+) by I080845 ( Prasanta Maiti ) 01/19/2012 Defect# 18155
        and i_final is NOT INITIAL.
    * End of modification(+) by I080845 ( Prasanta Maiti ) 01/19/2012 Defect# 18155
    * The print parameters are retrived and validate
          CALL FUNCTION 'GET_PRINT_PARAMETERS'
            EXPORTING
    *           ARCHIVE_TEXT          = c_check
    *           AR_OBJECT             = c_check
    *          ARCHIVE_REPORT         = c_check
    *          COVER_PAGE             = c_check
              in_archive_parameters  = v_arcpar
              in_parameters          = v_pripar
              destination            = 'LOCL'
              layout                 = 'X_65_512/2'"c_layout
              line_count             = '65'  "60
              line_size              = '1024'
              no_dialog              = c_check
            IMPORTING
              out_archive_parameters = v_arcpar
              out_parameters         = v_pripar
              valid                  = v_val
            EXCEPTIONS
              archive_info_not_found = 1
              invalid_print_params   = 2
              invalid_archive_params = 3
              OTHERS                 = 4.
    IF v_val  NE space AND sy-subrc = 0.
            v_pripar-prrel = space.
            v_pripar-primm = space.
            NEW-PAGE PRINT ON NEW-SECTION PARAMETERS v_pripar
            ARCHIVE PARAMETERS v_arcpar NO DIALOG.
            NEW-PAGE.
    **    displaying output in PDF
    *    PERFORM f_show_record.
    *   ALV Display
            PERFORM f_alv_display.
            NEW-PAGE PRINT OFF.
            CALL FUNCTION 'ABAP4_COMMIT_WORK'.
          ENDIF.
          IF NOT sy-spono IS INITIAL.
            "Declarations
            v_spool_id = sy-spono.
    * Checking the flag for too large spool
    *    IF v_too_large IS INITIAL.
            CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
              EXPORTING
                src_spoolid              = v_spool_id
                no_dialog                = space
              IMPORTING
                pdf_bytecount            = v_bytecount
              TABLES
                pdf                      = i_pdf
              EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
    Edited by: Thomas Zloch on Feb 10, 2012

    Hi,
    Try with ALV LIST DISPLAY. I dont thing so its possible with ALV GRID DISPLAY.

  • How can I store and view a pdf file ?

    I have an iphone 3GS 32Gb and want to store a pdf file on my phone so that I can view it later.
    Email is the only way I have been able to view my pdf file, but I dont really want to do it this way.
    On previous phones I could save a file on the phones memory card and then open the file in the necessary app.
    This is something I know the iphone doesnt do, but I was wondering if there is a way around it or an app.

    sky_rat wrote:
    Which is the best of those apps, can you recommend any ?
    [File Magnet|http://itunes.apple.com/gb/app/filemagnet-read-and-e-mail-your/id2847971 61?mt=8] is pretty good.
    I did find one app (I cant remember the name, thought it was Air Share) and it said Apple had told them to change the app so that you cant transfer files over USB, only Wi-Fi.
    I think that was [FileApp|http://itunes.apple.com/gb/app/fileapp-previously-fileaid-document/id2 97804694?mt=8], (previously File Aid).
    Apple dont like people being able to use their phone like this.... bloody control freaks.
    You can vote with your feet remember.

  • How do I download and save a pdf file on iPad2

    I just got and love my iPad2 and am learning a lot.  What I can't do is download a pdf file that is an attachment to my gmails.  It won't open the attachment nor when I click on it will it download.  I have installed both the iBook app and pdf-notes free also.  I have a number of large cross stitch charts which I have purchased in pdf format.  Several people I know use the iPad instead of printing all the pages ( can be 20+ or much more), can easily enlarge portions of the chart and with pdf-notes can highlight sections that have been stitched.  My Comcast email will open the pdf attachment using the xfinity app, but there is nothing that tells me to save it in either iBook or pdf.  I don't know what I am doing wrong.  If I have to do something to the settings, I can't figure out or find out what to do.  Its not a critical problem, but one I would like to solve. 
    Thanks

    Just figured it out while I was typing more detail for you.  If I go to gmail through Safari, not using the mail app (which is what I have been doing) I then get the open in iBooks or open in pdf-notes options when I  open the pdf attachment.  There isn't a little box in the corner of the PDF that has a "send to" icon with either email program.  I don't know why it doesn't work with the email apps, but I've bookmarked gmail in Safari so I can get there.
    Thank you for your help and your quick response.  I really appreciate it.

  • Using Windows 7, now Reader XI and now SOME pdf files won't display. Try: 'PDF of Reader XI Help'!!!

    After installling Reader XI SOME pdf files will not display. Using Windows 7 and all worked fine until installation of XI. Esample: when I try to display YOUR file 'PDF of Reader XI Help' all I get is a blank screen with an X in the upper right corner. Works just fine with Windows XP and Reader 8.5.1. Any ideas ????? Thanks.

    http://helpx.adobe.com/acrobat/kb/cant-view-pdf-web.html

  • How to install tamil fonts to read and write non pdf files

    Hi,
       i bought a new mac book pro...i want to edit my documents which are typed in vanavil avvaiyar a tamil font...but i dont know how to install it..and i hav a duobt that whether this mac may support tamil fonts in mac office.....

    The Mac supports Tamil input Method and lists Anjal and Tamil99.
    Microsoft Office probably does not.

  • What is the best way to read, process, and write an Excel File Server side...SQL Server Agent Job

    So I was using dynamic Excel commands to open and save as using...
    Microsoft.Office.Interop.Excel.Application
    and
     workbook.SaveAs(StringDestinationFile, XlFileFormat.xlExcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
    which worked all fine and dandy client side. Then when I attempted to create a SQL Server Agent Job, this failed as a result of SQL Server side not being able to execute dynamic Excel commands.
    So do I need to therefore try and do this function via Microsoft.ACE.OLEDB.12.0 commands? And where can I find the commands and syntax to open and save as? I have to Open a .xlsx file, save it as a .xls file, and then open this newly created .xls file and
    then save it as a .csv file.
    Thanks for your review and am hopeful for a reply.
    ITBobbyP85

    I think you might be over complicating things.
    You can use SSIS with Excel Source/Destination connections to read in, or output to an excel sheet/file.

  • How to read from and write to remote data file?

    Hi there
    I have two variables that I would like to store in a remote data file which can be accessed by my Flash file. It is for a voting system, so the first variable would be a counter that is incremented each time a user votes, and the second would be the total rating. The average rating would then be calculated from these.
    How would one store, retrieve, and then update these variables from the data file?
    I can create the system within a single Flash file for a single session, but obviously I'd like multiple users opening the file simultaneously to be able to access the data and update it.
    I'm using AS2 in CS3. Any help would be appreciated.

    Right, I've made significant progress since I started this topic. I now have my Flash and php files set up, and the communication between them is working. I'm having difficulty now retaining my variables in the php and updating them for the next session. The script that I have is as follows:
    <?
    $totalRating1 += $_POST['latestRating1'];
    $ratingCount1 ++;
    $averageRating1 = $totalRating1 / $ratingCount1;
    echo "&averageRating=$averageRating1";
    ?>
    The first line receives the variable "latestRating1" from the SWF. The new average rating is calculated and returned to the SWF as "averageRating". When I run it, however, the variables are reset each time. The average rating is always the same as the latest rating. How can I retain the variables so that they are updated and available for the next user?
    Any advice would be appreciated. I am very new to php, and don't have any experience with other scripting languages. I'm using ActionScript2.

  • How to create a table with datatype blob and insert a pdf file (ravi)

    how to create a table with datatype blob and insert a pdf file,
    give me the explain asap
    1.create the table?
    2.insert the pdffiles into tables?
    3.how to view the files?
    Thanks & Regards
    ravikumar.k
    Edited by: 895044 on Dec 5, 2011 2:55 AM

    895044 wrote:
    how to create a table with datatype blob and insert a pdf file,
    give me the explain asapPerhaps you should read...
    {message:id=9360002}
    especially point 2.
    We're not just sitting here waiting to answer your question as quickly as possible for you.

  • How to read from one file and write into another file?

    Hi,
    I am trying to read a File and write into another file.This is the code that i am using.But what happens is last line is only getting written..How to resolve this.the code is as follows,
    public String get() {
         FileReader fr;
         try {
              fr = new FileReader(f);
              String str;
              BufferedReader br = new BufferedReader(fr);
              try {
                   while((str= br.readLine())!=null){
                   generate=str;     
              } catch (IOException e1) {
                   e1.printStackTrace();
              } }catch (FileNotFoundException e) {
                   e.printStackTrace();
         return generate;
    where generate is a string declared globally.
    how to go about it?
    Thanks for your reply in advance

    If you want to copy files as fast as possible, without processing them (as the DOS "copy" or the Unix "cp" command), you can try the java.nio.channels package.
    import java.nio.*;
    import java.nio.channels.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    class Kopy {
         * @param args [0] = source filename
         *        args [1] = destination filename
        public static void main(String[] args) throws Exception {
            if (args.length != 2) {
                System.err.println ("Syntax: java -cp . Kopy source destination");
                System.exit(1);
            File in = new File(args[0]);
            long fileLength = in.length();
            long t = System.currentTimeMillis();
            FileInputStream fis = new FileInputStream (in);
            FileOutputStream fos = new FileOutputStream (args[1]);
            FileChannel fci = fis.getChannel();
            FileChannel fco = fos.getChannel();
            fco.transferFrom(fci, 0, fileLength);
            fis.close();
            fos.close();
            t = System.currentTimeMillis() - t;
            NumberFormat nf = new DecimalFormat("#,##0.00");
            System.out.print (nf.format(fileLength/1024.0) + "kB copied");
            if (t > 0) {
                System.out.println (" in " + t + "ms: " + nf.format(fileLength / 1.024 / t) + " kB/s");
    }

Maybe you are looking for