Conversion of .txt file to pdf file

Hi Experts,
I want to convert a text file to pdf.
I was able to create a pdf document but unable to open.
I have followed the following logic
1) uploaded the file using GUI_UPLOAD
2)used the FM GET_PRINT_PARAMETERS to set printer settings
3)Then  used three function modules in order
       a) RSPO_OPEN_SPOOLREQUEST
       b) RSPO_WRITE_SPOOLREQUEST
       c) RSPO_CLOSE_SPOOLREQUEST
I was able to see the data which I uploaded with the spool id  created in  'SP01'
4)Then I used the FM CONVERT_ABAPSPOOLJOB_2_PDF followed by
5) GUI_DOWNLOAD.
whatever the file size I upload I was able to get just five entries in the table obatined from CONVERT_ABAPSPOOLJOB_2_PDF
The error which I got when trying to  open the pdf created is "This file cannot be opened becuase it has no pages".
could any one suggest some solutions

check the below code if it helps you.
   DATA:    LV_ARCPAR TYPE ARC_PARAMS,
            LV_PRINT_PARMS TYPE PRI_PARAMS,
            LV_BYTECOUNT   TYPE I,
            LV_RQIDENT     TYPE TSP01-RQIDENT,
            LV_MI_RQIDENT   TYPE  TSP01-RQIDENT,
            LV_TEXT TYPE PRI_PARAMS-PRTXT.   "List Text
   DATA:    LV_GD_BUFFER TYPE STRING.
   DATA :   LT_MESS_ATT TYPE STANDARD TABLE OF SOLISTI1,
            LT_MTAB_PDF TYPE STANDARD TABLE OF TLINE,
            LT_OBJPACK  TYPE STANDARD TABLE OF SOPCKLSTI1,
            LT_OBJTXT   TYPE STANDARD TABLE OF SOLISTI1,
            LT_OBJBIN   TYPE STANDARD TABLE OF SOLISTI1,
            LT_RECLIST  TYPE STANDARD TABLE OF SOMLRECI1,
            LT_DOC_CHNG TYPE  SODOCCHGI1,
            LT_OBJHEAD TYPE SOLI_TAB,
            LV_L_ATTACHMENT  TYPE I,
            LV_L_TESTO TYPE I.
   DATA:  LWA_MTAB_PDF TYPE TLINE,
          LWA_OBJPACK  TYPE SOPCKLSTI1,
          LWA_MESS_ATT TYPE SOLISTI1,
          LWA_OBJTXT   TYPE SOLISTI1,
          LWA_OBJBIN  TYPE SOLISTI1,
          LWA_RECLIST TYPE SOMLRECI1.
   DATA : LV_VAL(1).
   CONSTANTS : LC_LINES TYPE PRI_PARAMS-LINCT VALUE 65,  "Line count
               LC_ROWS  TYPE PRI_PARAMS-LINSZ VALUE 255,  "Rows
               LC_TEMP_PRINT_PAART TYPE PRI_PARAMS-PAART VALUE
               'X_65_255'.
   CALL FUNCTION 'GET_PRINT_PARAMETERS'
     EXPORTING
       NO_DIALOG              = 'X'
     IMPORTING
       OUT_PARAMETERS         = LV_PRINT_PARMS
       OUT_ARCHIVE_PARAMETERS = LV_ARCPAR
       VALID                  = LV_VAL
     EXCEPTIONS
       ARCHIVE_INFO_NOT_FOUND = 1
       INVALID_PRINT_PARAMS   = 2
       INVALID_ARCHIVE_PARAMS = 3
       OTHERS                 = 4.
   IF SY-SUBRC <> 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
   LV_PRINT_PARMS-PAART = LC_TEMP_PRINT_PAART.
   CALL FUNCTION 'GET_PRINT_PARAMETERS'
     EXPORTING
       IN_ARCHIVE_PARAMETERS  = LV_ARCPAR
       IN_PARAMETERS          = LV_PRINT_PARMS
       LAYOUT                 = 'X_65_255'
       LINE_COUNT             = LC_LINES
       LINE_SIZE              = LC_ROWS
       LIST_TEXT              = LV_TEXT
       NO_DIALOG              = 'X'
     IMPORTING
       OUT_ARCHIVE_PARAMETERS = LV_ARCPAR
       OUT_PARAMETERS         = LV_PRINT_PARMS
       VALID                  = LV_VAL
     EXCEPTIONS
       ARCHIVE_INFO_NOT_FOUND = 1
       INVALID_PRINT_PARAMS   = 2
       INVALID_ARCHIVE_PARAMS = 3
       OTHERS                 = 4.
   IF SY-SUBRC <> 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
   LV_MI_RQIDENT = P_SPOOL.
   CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
     EXPORTING
       SRC_SPOOLID              = LV_MI_RQIDENT
       NO_DIALOG                = 'X'
       DST_DEVICE               = LV_PRINT_PARMS-PDEST
     IMPORTING
       PDF_BYTECOUNT            = LV_BYTECOUNT
       PDF_SPOOLID              = LV_RQIDENT
     TABLES
       PDF                      = LT_MTAB_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.
   IF SY-SUBRC <> 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
   LOOP AT LT_MTAB_PDF INTO LWA_MTAB_PDF.
     TRANSLATE LWA_MTAB_PDF USING ' ~'.
     CONCATENATE LV_GD_BUFFER LWA_MTAB_PDF INTO LV_GD_BUFFER.
     CLEAR LWA_MTAB_PDF.
   ENDLOOP.
   TRANSLATE LV_GD_BUFFER USING '~ '.
   DO.
     LWA_MESS_ATT = LV_GD_BUFFER.
     APPEND LWA_MESS_ATT TO LT_MESS_ATT.
     CLEAR LWA_MESS_ATT.
     SHIFT LV_GD_BUFFER LEFT BY 255 PLACES.
     IF LV_GD_BUFFER IS INITIAL.
       EXIT.
     ENDIF.
   ENDDO.
   CLEAR:  LWA_RECLIST, LT_RECLIST[],
           LT_OBJHEAD, LT_OBJHEAD[],
           LWA_OBJTXT,  LT_OBJTXT[],
           LWA_OBJBIN,  LT_OBJBIN[],
           LWA_OBJPACK, LT_OBJPACK[].
Object with PDF.
   "   CLEAR LT_OBJBIN.
   REFRESH LT_OBJBIN.
   LT_OBJBIN[] = LT_MESS_ATT[].
   DESCRIBE TABLE  LT_OBJBIN LINES LV_L_ATTACHMENT.
Object with main text of the mail.
   LWA_OBJTXT = ''.
   APPEND LWA_OBJTXT TO LT_OBJTXT.
   CLEAR LWA_OBJTXT.
   DESCRIBE TABLE LT_OBJTXT LINES LV_L_TESTO.
Document information.
   LT_DOC_CHNG-OBJ_NAME   = 'STATUS_REPORT'.
   LT_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
   LT_DOC_CHNG-OBJ_DESCR  = 'Generated File'.               "#EC NOTEXT
   LT_DOC_CHNG-SENSITIVTY = 'F'.
   LT_DOC_CHNG-SENSITIVTY = 'O'.
   LT_DOC_CHNG-OBJ_PRIO   = '1'.
   LT_DOC_CHNG-DOC_SIZE   = LV_L_TESTO * 255.
Pack to main body.
   CLEAR LWA_OBJPACK-TRANSF_BIN.
   LWA_OBJPACK-HEAD_START = 1.
   LWA_OBJPACK-HEAD_NUM   = 0.
   LWA_OBJPACK-BODY_START = 1.
   LWA_OBJPACK-BODY_NUM   = LV_L_TESTO.
   LWA_OBJPACK-DOC_TYPE   = 'RAW'.
   APPEND LWA_OBJPACK TO LT_OBJPACK.
   CLEAR LWA_OBJPACK.
Pack to PDF.
   LWA_OBJPACK-TRANSF_BIN = 'X' .
   LWA_OBJPACK-HEAD_START = 1.
   LWA_OBJPACK-HEAD_NUM   = 1.
   LWA_OBJPACK-BODY_START = 1.
   LWA_OBJPACK-BODY_NUM   = LV_L_ATTACHMENT.
   LWA_OBJPACK-DOC_TYPE   = 'PDF'.
   LWA_OBJPACK-OBJ_NAME   ='SPOOL'.
   LWA_OBJPACK-OBJ_DESCR = 'Generated File details'.       
   LWA_OBJPACK-DOC_SIZE = LV_L_ATTACHMENT * 255.
   APPEND LWA_OBJPACK TO LT_OBJPACK.
   CLEAR LWA_OBJPACK.
   CLEAR LWA_RECLIST.
   LWA_RECLIST-COPY = 'X'.
   LWA_RECLIST-RECEIVER   = P_EMAIL.
   LWA_RECLIST-REC_TYPE   = 'U'.
   LWA_RECLIST-NOTIF_DEL  = 'X'.
   LWA_RECLIST-NOTIF_NDEL = 'X'.
   APPEND LWA_RECLIST TO LT_RECLIST.
   CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
     EXPORTING
       DOCUMENT_DATA              = LT_DOC_CHNG
       PUT_IN_OUTBOX              = ' '
       COMMIT_WORK                = 'X'
     TABLES
       PACKING_LIST               = LT_OBJPACK
       OBJECT_HEADER              = LT_OBJHEAD
       CONTENTS_BIN               = LT_OBJBIN
       CONTENTS_TXT               = LT_OBJTXT
       RECEIVERS                  = LT_RECLIST
     EXCEPTIONS
       TOO_MANY_RECEIVERS         = 1
       DOCUMENT_NOT_SENT          = 2
       DOCUMENT_TYPE_NOT_EXIST    = 3
       OPERATION_NO_AUTHORIZATION = 4
       PARAMETER_ERROR            = 5
       X_ERROR                    = 6
       ENQUEUE_ERROR              = 7
       OTHERS                     = 8.
   IF SY-SUBRC <> 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
    REFRESH : LT_OBJPACK, LT_OBJHEAD, LT_OBJBIN, LT_OBJTXT,
             LT_RECLIST.

Similar Messages

  • Conversion of .txt file to .aud file

    How to convert a text file to audit file,MD5(.aud) in sap-abap?Please provide me the code if possible.

    sasirohit,
    A .csv is usually a comma seperated file, where each field is seperated by a comma. It is also generally common to have text qualifiers surrounding each field to keep comments containing commas to not seperate fields. Example:
    "field 1","comments, here and there","the end"
    Think CSV as a spreadsheet (like Excel) where each cell/field is seperated by a comma.
    The text file has to contain SOMETHING to help you, the programmer, identify what a field represents. If not colon, piped, semi-colon, or other delimiter is used, also fixed-length may be an option.
    Is this what you are asking?

  • Conversion of DB files Berkley DB v3.0 to newest version

    Dear specialist of Berkley BD,
    I have a veritable problem created by my hosting provider and I need the friend advice.
    The provider have move to new data center and change all software for « newest versions » , including Berkley DB .
    But my site was created by one programmer in 2001 / 2002 (« don’t visible now» ) . He use probably the version 3.0. This DB play the role not biggest, but important: document's title and heading . The programmer leave just one tools of conversion of .txt file to .db. file (db_load.exe, libdb32.dll, loadtree.bat).
    In the new data center this DB can’t open. The hosting provider (à mon avis peu compétent en Berkley) make just this remarque about problem :
    « Since we are running a newer version of berkley db on our new servers something things may have changed which are giving you errors. Try exporting your old data from your berkley db on europa.your-site.com to a flat file and then importing it to the new berkley db which is running on your current account.”
    I have « .txt » file for the conversion , but i’m not programmer in my life and I try to find one solution for conversion of this file to DB file compatible with “newest version”.
    This is PHP code of function for generates HTML code of document's title and heading..
    function TitleAndHeading()
              // global $_SERVER['DOCUMENT_ROOT'];
              // Try to open database file containing site's tree.
              $DBHandle = dba_open($_SERVER['DOCUMENT_ROOT'] . '/_internals' . RLS_LANGUAGE . 'sitetree.db', 'r', 'db3');
              if ($DBHandle)
                   // Try to retrieve string containing document's heading and title.
                   $Document = dba_fetch(RLS_URI, $DBHandle);
                   if ($Document === FALSE)
                        $Document = array('', '');
                        // MailError(__FILE__, __LINE__, 'dba_fetch()');
                   else
                        // These substrings are delimited by TAB character.
                        $Document = explode("\t", $Document);
                        // Title is optional. If it is absent it is considered the same as heading.
                        if (sizeof($Document) < 2)
                             $Document[RLS_TITLE] = &$Document[RLS_HEADING];
                   dba_close($DBHandle);
              else
                   $Document = array('', '');
                   // MailError(__FILE__, __LINE__, 'dba_open()');
              return $Document;
    Thank you for you help. Cordialy,

    Hello,
    Not sure if your problem has been solved, but the Berkeley DB database may need to be upgraded.
    As denoted by the used dll "libdb32.dll" the Berkeley DB version used to create the database is 3.2.9.
    Refer to the following link which provides information on how to use the "db_upgrade" utility to upgrade an older format database to the current used Berkeley DB database format:
    http://www.oracle.com/technology/documentation/berkeley-db/db/utility/db_upgrade.html
    Please note, that you will need to use the "db_upgrade" utility corresponding to the Berkeley DB release (you'll need to get this information from the provider). Make sure to have a backup of your database, and to use also the "db_verify" utility to check for the integrity of the resulting upgraded database ("db_verify" utility from the release used to upgrade).
    More further, you will need to compile/build against the corresponding Berkeley DB modules (PHP modules for Apache, "mod_db4"). Test the result of these actions and provide us feedback.
    Best regards,
    Andrei Costache, Oracle

  • Convert .txt file to .pdf using java code

    Hi,
    My requirement is to read the .txt file and convert it into .pdf file after changing certain text.
    Searched the net got a document on iText ..is it the only way for conversion or any other method....please help.
    Thanks in advance.
    Pooja

    Hi.
    You could review this [url|http://www.roseindia.net/java/java-conversion/TextToPDF.shtml].
    It is a good example to use the iText Library.
    The other option could be [PDFBox|http://pdfbox.apache.org/].
    Here some [example code|http://pdfbox.apache.org/userguide/cookbook/creation.html#HelloWorld].
    Another option, but more complicated is [Apache FOP|http://xmlgraphics.apache.org/fop/].
    I hope you can find the right solution.
    Kindest regards, have a great day

  • Wrongly transformed the sentences of left and right paragraphs into one sentence in PDF files to txt files by Acrobat 9 Pro

    I found that the when transforming PDF files into TXT files by Acrobat 9 Pro, the Acrobat will wrongly transform the sentences of the left hand side and right hand side paragraphs into one sentence, while the correct format should be the later sentence follows the former sentence in each paragraph.
    An example PDF is : http://cardiovascres.oxfordjournals.org/content/cardiovascres/45/1/200.full.pdf
    Is there any solution for this problem? Or should I use other software (or other version of Acrobat) to solve the problem? Thank you.

    PDF is not a word processor file format.
    It has no "styles", "format", "layout", "columns", "rows", "tables", etc.
    PDF writers paint the content to the canvas that is the PDF page.
    Depending on what was used and how it operates this painting can be like a paint by numbers affair.
    ISO 32000-1:2008, the ISO standard for PDF explains it all.
    So, when exporting to text from your PDF the progression is left to right, top down.
    Remember, PDF has no awareness of "columns". What we see is our construct not PDF's.
    What you and I see as two columns with a specific read order is our imposition.
    What is on the PDF page is simply a line of text characters.
    That is how it is with all versions of Acrobat. Applications can only make use of what the file format supports eh.
    What to do?
    Master content in a logical hierarchy in the authoring file.   
    Always use the build-in Headings for Headings.     
    Use the built-in "table" feature.  
    Use a PDF writer process that is compliant with the ISO standard and that supports proper output of Tagged PDF.   
    A well-formed Tagged PDF will export properly.  
    Two key design considerations for Tagged PDF are:  
    (1)  Support Accessible PDF   
    (2)  Support Export of PDF page content. 
    What constitutes a "well-formed tagged PDF?"
    This would be a PDF that is ISO 14289-1, PDF/UA-1 compliant.
    Be well... 

  • Why can't I import a .txt file to a PDF created in Livecycle Designer?

    I am trying to import data into a PDF, simple stuff like names and addresses. I've saved my spreadsheet as a tab delimited .txt file, but when i go to import data in the PDF, .txt files are not an option. Is there a setting in Livecycle or in Acrobat that I haven't found?

    Is there a way for me to import the data to a PDF created in LiveCycle designer?

  • Wrongly transformed the sentences of left and right paragraphs into one sentence in PDF files to txt files by Acrobat 11

    I found that the when transforming PDF files into TXT files by Acrobat 11, the Acrobat will wrongly transform the sentences of the left hand side and right hand side paragraphs into one sentence, while the correct format should be the later sentence follows the former sentence in each paragraph.
    An example PDF is : http://cardiovascres.oxfordjournals.org/content/cardiovascres/45/1/200.full.pdf
    Is there any solution for this problem? Or should I use other software (or other version of Acrobat) to solve the problem? Thank you.

    Hi Anubha,
    Same problem occurred when converted into word file.
    I convert the PDF into txt as I need to use the txt format for running some analyses (and I have thousands of such PDF).
    However, I found the same problem even if I use the original PDF file, so I am seeking the solution.
    Actually the PDF can be converted to any format if the problem can be solved! Thank you.

  • .csv file Vs .txt file Content conversion sender file channel

    Hi Experts,
                     I have a file with filename say input.csv.I want to do content conversion for these .CSV file.Is it same like we have to do for .txt file say input.txt.
    when i open my .csv file in notepad, i get multiple rows with each field separated by ';'.what are the content conversion parameters we have to define for .csv file and can we mention input.csv as the file name as a source file name.
    Thanks
    Deepak

    Hi,
    Use the following parameters for Sender file channel in case of reading .csv file
    Recordset Structure.fieldSeparator -
    Recordset Structure.endSeparator -
    'nl'
    Recordset Structure.fieldNames -
    provide field names separated with ,
    Regards
    Seshagiri

  • Enquiry on converting a *.txt file to a *.pdf file

    Enquiry on converting a *.txt file to a *.pdf file
    Aim of this software: Let the user to choose a *.txt file to convert it to a *.pdf file.
    1. User clicks a choose file button. [chooseFileButton]
    2. User clicks the Export 2 button [exportButton2]
    3. User clicks the Text -> PDF button [pdfConverterButton]
    After choosing the file and click the choose file button:
    System prints out (for debbuging use...)
    ---------------------------Print from Trans.java - method transMemory--------------------
    File's name: file.txt
    File's path: C:\Users\charles\Desktop\netbean\Pdfproject1\file.txt
    After clicking the Export 2 button, system prints out:
    ---------------Print out the File's name - from DataOut.java - getData() Method-------------------------
    File's Name: file.txt
    ----------------Print out the file's path - from DataOut.java - getData() Method--------------
    File's path: C:\Users\charles\Desktop\netbean\Pdfproject1\file.txt
    The file now being read by the system: transNameData.txt
    The data being copied to this file: copyOfFileName.txt Destination
    This file has been copied: file.txt Original
    The following content has been copied:
    ---start of content - from TheFile.java - save2() method---
    Some content.....................................
    --------end of content--------
    Jul 18, 2010 3:32:04 PM mainFrame1 exportButton2ActionPerformed
    SEVERE: null
    java.io.IOException: Permission denied
    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(FileInputStream.java:199)
    at java.io.DataInputStream.read(DataInputStream.java:132)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)
    at TheFile.save2(TheFile.java:144)
    at mainFrame1.exportButton2ActionPerformed(mainFrame1.java:168)
    at mainFrame1.access$200(mainFrame1.java:30)
    at mainFrame1$3.actionPerformed(mainFrame1.java:79)
    at java.awt.Button.processActionEvent(Button.java:392)
    at java.awt.Button.processEvent(Button.java:360)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    After clicking the text -> PDF button, system prints out:
    The following data is called by the PDF converter button...
    ---------------Print out the File's name - from DataOut.java - getData() Method-------------------------
    File's Name: file.txt
    ----------------Print out the file's path - from DataOut.java - getData() Method--------------
    File's path: C:\Users\charles\Desktop\netbean\Pdfproject1\file.txt
    MakePdf.java is loading... - createPdf() method
    File you have chosen and this file will be converted to a PDF file: file.txt
    And the content of the file is:
    ---start of content--- (Info from MakePdf.java)
    Some content.....................................
    ---end of content---
    Print out the content again: Some content..................................... ---> Info from SubClass DocToPdf of MakePdf.java
    Exception in thread "AWT-EventQueue-0" ExceptionConverter: java.io.IOException: The document has no pages.
    at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source)
    at com.lowagie.text.pdf.PdfWriter.close(Unknown Source)
    at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)
    at com.lowagie.text.Document.close(Unknown Source)
    at MakePdf$DocToPdf.createDoc(MakePdf.java:140)
    at MakePdf.createPdf(MakePdf.java:97)
    at TheFile.forPdfUse(TheFile.java:267)
    at mainFrame1.pdfConverterButtonActionPerformed(mainFrame1.java:184)
    at mainFrame1.access$300(mainFrame1.java:30)
    at mainFrame1$4.actionPerformed(mainFrame1.java:86)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    BUILD SUCCESSFUL (total time: 1 minute 41 seconds)

    Source code: MakePdf.java
    import com.lowagie.text.DocumentException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.*;
    import java.lang.String;
    import java.io.*;
    public class TheFile {
    String pathData;
    String nameData;
         public void PrepareJFileChooserData2(){
            try {
                // Create a object for JFileChooser.
                final JFileChooser choose = new JFileChooser();
                choose.showOpenDialog(null);
                File file = new File(choose.getSelectedFile(), "");
                pathData = file.getPath(); //get the path of the chosen file
                nameData = file.getName(); //get the name of the chosen file
                //Try to copy file to a temp file.
                Cfile2 cfile = new Cfile2();
                cfile.writeFile(nameData); // write nameData into the temp.txt file.
                //return pathData;
            } catch (IOException ex) {
                Logger.getLogger(TheFile.class.getName()).log(Level.SEVERE, null, ex);
          public String getPathName(){
                return pathData;
          public String getNameData(){
              return nameData;
        public class Cfile2{
        public void writeFile(String fName) throws IOException {
            PrintWriter pr = new PrintWriter(new File("temp.txt"));
            pr.println();
            pr.print("\n");
            pr.write("-------------------From SubClass - Cfile2 in TheFile.java----------------------");
            pr.write("File Name: " +nameData); // write the value of nameData to temp.txt
            pr.print("\n");
            pr.write("File's Path: "+pathData); // write the value of pathData to temp.txt
            pr.print("\n");
            pr.print("-------------------------------------------------------------------------------");
            pr.flush();  // Flush the data.
            pr.close();  // Close to unlock and flush to disk.
        public void save2() throws FileNotFoundException, IOException{
           // Copy and print out the file's name only
           String fileName = "transNameData.txt";
           File originFile = new File(fileName); //open the file to read
           System.out.println("The file now being read by the system: " +originFile);  //originFile = transNameData.txt
           File destinationFile = new File("copyOfFileName.txt"); // open another file and prepare to write in
        try {
            //Start trying to write data to file - copyOfFileName.txt
          byte[] readData = new byte[2048];
          FileInputStream fis = new FileInputStream(new File(fileName)); // Seems it writes the value of transNameData.txt to copy.txt
          int count = fis.available();
          if(count>0){
          FileOutputStream fos = new FileOutputStream(destinationFile);
          int i = fis.read(readData);
          while (i != -1) {
            fos.write(readData, 0, i);
            i = fis.read(readData);
          System.out.println("The data being copied to this file: " +destinationFile+ " Destination");
          fos.flush();
          fos.close();
          fis.close();
            }else{
              System.out.print("Error");
        } catch (IOException e) {
          System.out.println(e);
        // Copy the content of the file only
        FileInputStream fstream = new FileInputStream("transNameData.txt");
        // Get the object of DataInputStream
        DataInputStream in = new DataInputStream(fstream);
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String strLine;
        //Read File Line By Line
        while ((strLine = br.readLine()) != null)   {
          // Print the content on the console
          System.out.println ("This file has been copied: " +strLine+ " Original"); //Work successfully, strLine has the value [file's title]
          File newDestinationFile = new File("ContentCopy.txt"); //Open the newCopy.txt file
          byte[] newReadData = new byte[2048];
          FileInputStream newFileInputStream = new FileInputStream(new File(strLine)); // See whether it can write it in... ok done!
          //String newString = newReadData.toString();
          //System.out.print("Content that has been copied: " +newString); //It prints out data in byte form...?!
          FileOutputStream newFileOutputStream = new FileOutputStream(newDestinationFile);
          int i = newFileInputStream.read(newReadData);
          while (i != -1) {
            newFileOutputStream.write(newReadData, 0, i);
            i = newFileInputStream.read(newReadData);
        FileInputStream newfstream = new FileInputStream(strLine);
        // Get the object of DataInputStream
        DataInputStream newin = new DataInputStream(newfstream);
            BufferedReader newbr = new BufferedReader(new InputStreamReader(newin));
        String content;
        //Read File Line By Line
        while ((content = newbr.readLine()) != null)   {
          // Print the content on the console
            System.out.println("\n");
            System.out.println("The following content has been copied: ");
            System.out.println(" ");
            System.out.println("---start of content - from TheFile.java - save2() method---");
            System.out.println(" ");
            System.out.println(content);
            System.out.println(" ");
            System.out.println("--------end of content--------");
        //Close the input stream
        in.close();
        //Close the input stream
        in.close();
    //----------- start PDF parser  ---> to txt format -------
       public void pdf() throws FileNotFoundException, IOException{
        //-----again--
       FileInputStream inStream = new FileInputStream("transNameData.txt");
        // Get the object of DataInputStream
        DataInputStream in = new DataInputStream(inStream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String strLine;
        //Read File Line By Line
        while ((strLine = br.readLine()) != null)   {
          // Print the content on the console
          System.out.println ("Watch out: " +strLine+ "  ---> It should be printed successfully!!"); //Work successfully
        //---again......
        PDFTextParser pdftextparser = new PDFTextParser();
        pdftextparser.pdftoText(strLine);
        public void forPdfUse() throws FileNotFoundException, IOException, DocumentException{
            MakePdf makePdf = new MakePdf();
            makePdf.createPdf();
    }

  • Need procedure -Load txt,csv,xls pdf file to db

    Could you please share me the procedure for loading the csv,xls,txt,pdf files into oracle database

    1008783 wrote:
    Could you please share me the procedure for loading the csv,xls,txt,pdf files into oracle databaseThere isn't any one particular procedure for doing it.
    The FAQ has some links to information relating to Excel files and CSV files (See: {message:id=9360007})
    As for TXT files, that depends what the contents are and what you are intending to do with them, though if you need some general access to a text file (that isn't structured like CSV) then you'd probably use the UTL_FILE package "line by line" or "chunk by chunk" or read the text file directly into a CLOB and process it there.
    As for PDF files, these are considered binary files, so you would typically store them in the database as a BLOB datatype and load them in a similar way to CLOB's using the BFILE method.
    But before we give you any specific answers, it's better if you explain exactly what it is you are trying to achieve.
    And read the FAQ on asking questions: {message:id=9360002}

  • Conversion txt file to tamil language

    hi this is aravind
    i am finding difficult in conerting the txt file to get converted into locale language (tamil) i did it using the streams but i am geting the output only "?" symbol even though i have entered the unicode i am unable to get the output
    plzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help me out it is very urgent

    Unicode is used to specify the codes used to represent characters in strings irrespective of locale.
    The conversion of strings to bytes, and from bytes to strings is through an encoding.
    You are possibly either:
    1. Not specifying the encoding, in which case an incorrect default is being used.
    2. Specifying an incorrect encoding
    3. Are doing all the encoding and decoding correctly, but have a different problem, such as using a font that does not have the tamil unicode range.
    My guess would be 1. as most examples use the simpler conversion routines which do not include specifying the encoding.
    An example charsetName to use for encoding and decoding is "UTF-8"
    So if you have code like this:
    BufferedReader in = new BufferedReader(new InputStreamReader(yourFilesInputStream));You should probably be changing it to be something similar to this:
    BufferedReader in = new BufferedReader(new InputStreamReader(yourFilesInputStream, "UTF-8"));

  • Convert txt file to pdf using Acrobat Distiller

    Hi,
    We purchase years ago Distiller 8.1.0.
    Now, I try to convert txt file to pdf files, but I always get an error.
    Please Help,
    Hezi

    I have important information: Acrobat is not licensed for use server side, so you must not use it to build that solution, even if it is technically possible.
    Adobe's server side PDF creation product is LiveCycle PDF Generator https://www.adobe.com/sea/products/server/pdfgenerator/
    This comes in three editions. The "PostScript" edition is little more than a server-side version of Distiller, and will not convert TXT. However, the other two editions can convert a wide variety of formats.

  • Converting batch pdf files to txt files

    Hello all,
    I am a intermediate level programmer with experience in Visual Basic 6. I am developing a small application to read data from pdf files. However, i was unable to directly read the data from pdf files. So, i converted them to txt files and then was able to process them.
    However, the first step of converting pdf files to txt files is still doen manually. I want to automate it. Can someone help on how to go about it using VB6?
    Im using Adobe Reader X (Ver 10.1.6) and Window 7 Operating System.
    Thanks
    Rupam

    Can you provide  afull details on how to convert PDF file autocad drawing to original autocad system....thanking

  • Conversion of Publisher file to PDF

    I have a MS publisher file, 98mb in size which I cannot convert to PDF. Teh error message said I could try to install a windows printer. I did install the printer according to instructions and tried converting the file again wiht the same failure message. Do I need to do something to access the printer for the conversion or is this automatic?

    Thank you. If it does come back where will I find it?
    Buddy Nichols
    W. 423-892-0444
    H. 423-893-8969
    Cell 423-991-3592
    Date: Tue, 19 Nov 2013 14:17:42 -0800
    From: [email protected]
    To: [email protected]
    Subject: Conversion of Publisher file to PDF
        Re: Conversion of Publisher file to PDF
        created by Test Screen Name in Adobe PDF Pack (formerly CreatePDF) - View the full discussion
    Having installed the printer, you must use it. You can't just install the printer then do the same thing you did before.
    Open the file in Publisher, print to the special printer driver. It takes what is "printed" and sends it off for conversion. I'm still not hopeful it will come in under the size limits though.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5856387#5856387
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5856387#5856387
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5856387#5856387. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Adobe PDF Pack (formerly CreatePDF) at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • UCM 11.1.1.4 : indexation : Text conversion of the file failed

    Hello,
    I'm facing an indexation issue with MS Office files, pdf, ...
    For instance :
    Text conversion of the file '/opt/oracle/middlewarehome/ucm/cs/weblayout/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc' failed.
    Content has been indexed with Info only. Resubmit should only be performed if the problem has been resolved.
    This a new installation of UCM 11.1.1.4 with Oracle DB 10.2.0.5.2 and WLS 10.3.4, all on a SUSE10 server.
    This issue is very similar to this one :
    Re: XML Not Indexing???
    But in my case, xml and txt files have no problem.
    thanks for your help,
    Vince

    Hi Srinath,
    Thanks for your reply. I checked the certification matrix and the certified version of DB with UCM 11g are :
    Oracle 10.2.0.4+
    Oracle 11.1.0.7+
    Oracle 11.2.0.1+
    It doesn't include 10.2.0.5 ??
    I managed to trace the server output.
    It seems there is a missing file : search.cfg
    also, what is the meaning of the "mdaw" directories ?
    thanks for your help,
    system/6 04.08 09:40:47.648 IdcServer-5934 Configuring tracing verbose: true; sections: indexer
    (internal)/5 04.08 09:40:47.652 IdcServer-5934 !csTraceChangedSectionsList,indexer!csTraceIsVerbose
    indexer/7 04.08 09:41:11.454 index update work /opt/oracle/middlewarehome/ucm/cs/search/search.cfg doesn't exist.
    indexer/7 04.08 09:41:11.455 index update work isRebuild?false; IndexerStep:Init; Class:intradoc.indexer.Indexer
    indexer/7 04.08 09:41:11.455 index update work isRebuild?false; IndexerStep:CheckCollection; Class:intradoc.indexer.IndexerCollectionManager
    indexer/7 04.08 09:41:11.456 index update work isRebuild?false; IndexerStep:BuildChanges; Class:entoracle.indexer.EOIndexerBuildChanges
    indexer/7 04.08 09:41:11.468 index update work Saving 1 update changes
    indexer/7 04.08 09:41:11.469 index update work isRebuild?false; IndexerStep:PreIndexingStep; Action:preIndexingStep
    indexer/7 04.08 09:41:11.469 index update work isRebuild?false; IndexerStep:CheckForWork; Class:intradoc.indexer.Indexer
    indexer/7 04.08 09:41:11.469 index update work Found work:Additions; Type:+; Change count: 1
    indexer/7 04.08 09:41:11.469 index update work isRebuild?false; IndexerStep:IndexAdditions; Class:intradoc.indexer.CommonIndexerBulkLoader
    indexer/7 04.08 09:41:11.470 index update work IndexerBulkLoader doing 'IndexAdditions' with m_change '+'; total count: 1; max count: 10000
    indexer/7 04.08 09:41:11.470 index update work WebChange retrieved. RevClassID:342; dID:364; Indexer State: ; ReleaseState:U
    indexer/7 04.08 09:41:11.477 index update work webFormat is application/msword
    indexer/6 04.08 09:41:11.477 index update work computeIndexableFileAttributes(); item:virtuoz2dev000342,formatType:webviewable,renditionCount:-1,format:application/msword,isAllowMap:true,isVault:false
    indexer/7 04.08 09:41:11.477 index update work Direct indexing allowed: false
    indexer/7 04.08 09:41:11.477 index update work Conversion allowed: true
    indexer/7 04.08 09:41:11.479 index update work Conversion handler for format 'application/msword' is 'TextIndexerFilter'
    indexer/6 04.08 09:41:11.479 index update work Added new item for indexing consideration. [format:application/msword, formatType:webviewable, filePath:/opt/oracle/middlewarehome/ucm/cs/weblayout/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc, fileSize:21504, url:/cs/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc,allowDirectIndex:false, allowConversion:true, conversionHandler:TextIndexerFilter, useMap:false, mapExtension:null
    indexer/7 04.08 09:41:11.480 index update work indexWebFile: true m_retryIndexing: false m_isFirstRetry: true
    indexer/6 04.08 09:41:11.494 index update work preparing 1 items
    indexer/6 04.08 09:41:11.549 index update work doing conversion with intradoc.indexer.TextConversionHandler@484f1ee on intradoc.indexer.IndexerInfo@47ef07e dID:364 key:null mdo:false iwf:true sta:-1 alone:true
    indexer/7 04.08 09:41:11.550 index update work InputFilePath is: </opt/oracle/middlewarehome/ucm/cs/weblayout/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc>
    indexer/7 04.08 09:41:11.550 index update work OutputFilePath is: </opt/oracle/middlewarehome/ucm/cs/search/IdcColl1/bulkload/~export/virtuoz2dev000342.txt> >indexer/7 04.08 09:41:11.550 index update work Sending document to conversion >(internal)/7 04.08 09:41:11.623 TextExport Abandon inattendu par le processus 'TextExport'. >indexer/6 04.08 09:41:11.624 index update work prepareDoc complete >indexer/7 04.08 09:41:12.001 index update work setting change on '364' to 'I' >indexer/7 04.08 09:41:12.005 index update work after handling indexing results: hasError: false m_retryIndexing: false m_isFirstRetry: true metaOnlyCount: 0 aSize: 1 >indexer/7 04.08 09:41:12.006 index update work isRebuild?false; IndexerStep:CheckForWork;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:41:12.006 index update work isRebuild?false; IndexerStep:DetermineSubscription;  Class:intradoc.indexer.DetermineSubscription >indexer/7 04.08 09:41:12.007 index update work isRebuild?false; IndexerStep:Replication;  Class:intradoc.server.IndexerReplication >indexer/7 04.08 09:41:12.008 index update work isRebuild?false; IndexerStep:PostIndexingStep;  Action:postIndexingStep >indexer/7 04.08 09:41:12.008 index update work isRebuild?false; IndexerStep:Cleanup;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:41:12.013 index update work cleanup for dID 364 change is I origChange is + newIndexerState is  >indexer/7 04.08 09:41:12.022 index update work isRebuild?false; IndexerStep:ContentRefresh;  Action:postDatabaseStep >indexer/7 04.08 09:41:12.024 index update work isRebuild?false; IndexerStep:Init;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:41:12.024 index update work isRebuild?false; IndexerStep:CheckCollection;  Class:intradoc.indexer.IndexerCollectionManager >indexer/7 04.08 09:41:12.024 index update work isRebuild?false; IndexerStep:BuildChanges;  Class:entoracle.indexer.EOIndexerBuildChanges >indexer/7 04.08 09:42:23.609 index update work /opt/oracle/middlewarehome/ucm/cs/search/search.cfg doesn't exist. >indexer/7 04.08 09:42:23.609 index update work isRebuild?false; IndexerStep:Init;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:42:23.609 index update work isRebuild?false; IndexerStep:CheckCollection;  Class:intradoc.indexer.IndexerCollectionManager >indexer/7 04.08 09:42:23.610 index update work isRebuild?false; IndexerStep:BuildChanges;  Class:entoracle.indexer.EOIndexerBuildChanges >indexer/7 04.08 09:42:23.613 index update work isRebuild?false; IndexerStep:Replication;  Class:intradoc.server.IndexerReplication >indexer/7 04.08 09:42:23.613 index update work isRebuild?false; IndexerStep:PostIndexingStep;  Action:postIndexingStep >indexer/7 04.08 09:42:23.613 index update work isRebuild?false; IndexerStep:Cleanup;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:42:23.617 index update work isRebuild?false; IndexerStep:ContentRefresh;  Action:postDatabaseStep >indexer/7 04.08 09:42:23.618 index update work isRebuild?false; IndexerStep:Init;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:42:23.618 index update work isRebuild?false; IndexerStep:CheckCollection;  Class:intradoc.indexer.IndexerCollectionManager >indexer/7 04.08 09:42:23.619 index update work isRebuild?false; IndexerStep:BuildChanges;  Class:entoracle.indexer.EOIndexerBuildChanges                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Error while copying a movement type

    Hi all, I want to create an movement type alternate to 501which will only update the qty not the value. 1. For  this I have copied movement type 501 through t code OMJJ. 2. While copying I changed the target movement type as "Y01". 3. Selected the op

  • Sender Party Alternative Identifier Problem.

    HI All, I have a B2B scenario in which I have configured following things in Integration Directory  1.Sender party as PartyA          Business System-->ABC_001 with logical system as ABC_001. 2. Receiver party as PartyB.          Business Service--->

  • Time Machine wants password

    TM was backing up wirelessly to my TC until I had signal interference issues. I moved the iMac to where the signal was good and got almost everything working. Now when I launch TM, it asks for a backup drive (Storage location is not setup yet). I cho

  • How to fix imovie hd?

    So i have imovie HD  and i love using it but i recently got a new computer and stopped using my mac for a while. i started using my mac again and its a power mac g5. i went to open imovie hd and it bounced then stopped and there was a question mark o

  • Software for Macs that enhance webcam?

    What software allows Mac users to alter their built-in cams output on the web? (For example, the designs and enhancements that are available in Photo Booth.) I'm aware that iChat does it when chatting online. However, I'd like to be able to use the e