Append a txt or doc file to a Teststand Report

How can I append an external doc or txt file ( that already exsists somewhere on my hard drive) to the report generated by Teststand 3.1 at the end of a "Test UUTs" seq run ?

Allen,
I created a LV7.1 vi that reads in a Word doc ( this is just a test .doc with "ABCD" in it). It needs work. When I run the vi I get characters displayed ( in LV) that aren't in the Word doc. Next I created a dummy seq and enabled the ModifyReportFooter callback . In this call back I added the vi and "mapped" the output to the Parameters.ReportFooter String. When I run it I only get the first few characters, maybe 3 or 4, not the whole doc. I'm using "Read from a text file.vi" shipped with LV examples. I modified it because I don't need all the other stuff ( plotting the points). Can you tell me why only the first few characters are printed in the Test Report and why I get characters in LV that I don't see in my Word doc?
Tried to attach both the vi and the seq. The attach would only allow one selection.
Attachments:
Sequence File2.seq ‏34 KB

Similar Messages

  • Txt or doc file conversion to Tiff Image

    Hi All , I have a requirement in project to convert txt or doc files toTiff format. can some one give me sample code pls ?
    thanks in adv.
    Sam

    Hi All , I have a requirement in project to convert txt or doc files toTiff format. can some one give me sample code pls ?
    thanks in adv.
    Sam

  • Safari appends .dot to all .doc files after Word 2008

    I am having a weird problem with Safari which may be caused by incompatibilities with Office 2008.
    Since upgrading to Office 2008 (and also trashing my entire system then installing Office 2008 for scratch), Safari is having this nasty habit of appending .dot to all .doc downloads.
    For example, on the following site, http://www.microsoft.com/downloads/details.aspx?FamilyID=311f4be8-9983-4ab0-9685 -f1bfec1e7d62&displaylang=en if I download "Deploying Vista Step by Step Guide.doc", Safari will save it as "Deploying Vista Step by Step Guide.doc.dot" which is rather unhelpful.
    The knowledge base article (http://docs.info.apple.com/article.html?artnum=304155) suggests that the problem is due to web server configuration - but this does not seem to be the case, because it did not happen before I installed Office 2008.
    Using the "misfox" preference pane (http://mac.clauss-net.de/misfox/) I think the problem appears to be that the MIME type application/msword is associated with the file extension .dot rather than .doc
    Is anyone else encountering the same issue?
    (I am running Mac OS X 10.5.1 on a first gen MacBook Pro upgraded to 2GB of RAM)
    Thanks to anyone who can help or confirm/deny this weird problem!

    After reading up on Uniform Type Identifiers, I think I have a solution - or at least some sort of workaround. This requires editing the Microsoft Word package.
    1. Open the Microsoft Word package (Action -> Show Package Contents)
    2. Go to Contents and open Info.plist in a plist editor (I used Panic Coda)
    3. Remove lines 703-704 where it reads <key>public.mime-type</key><string>application/msword</string>
    4. Remove any caches/whatever (I used Onyx) and reboot.
    Further details on Step #3:
    There are two instances where Microsoft Word defines application/msword. On my copy of Word, it defines it at line 684-685 and line 703. Line 685 refers to the document type .doc while line 703-704 refers to .dot.
    Obviously, I want the MIME type application/msword to refer to .doc (and don't really care too much about .dot files).
    Before (lines 688-706):
    <dict>
    <key>UTTypeConformsTo</key>
    <string>public.data</string>
    <key>UTTypeDescription</key>
    <string>Microsoft Word 97 - 2004 template</string>
    <key>UTTypeIconFile</key>
    <string>W8TN.icns</string>
    <key>UTTypeIdentifier</key>
    <string>com.microsoft.word.dot</string>
    <key>UTTypeTagSpecification</key>
    <dict>
    <key>com.apple.ostype</key>
    <string>W8TN</string>
    <key>public.filename-extension</key>
    <string>dot</string>
    <key>public.mime-type</key>
    <string>application/msword</string>
    </dict>
    </dict>
    After:
    <dict>
    <key>UTTypeConformsTo</key>
    <string>public.data</string>
    <key>UTTypeDescription</key>
    <string>Microsoft Word 97 - 2004 template</string>
    <key>UTTypeIconFile</key>
    <string>W8TN.icns</string>
    <key>UTTypeIdentifier</key>
    <string>com.microsoft.word.dot</string>
    <key>UTTypeTagSpecification</key>
    <dict>
    <key>com.apple.ostype</key>
    <string>W8TN</string>
    <key>public.filename-extension</key>
    <string>dot</string>
    </dict>
    </dict>
    Don't know if this will work anywhere else, but it solved my problem and Safari no longer mysteriously adds .dot to my .doc downloads.

  • Cant get FF to auto save .txt files like it does .doc files.

    when i change the action in the application section for a .doc file (ie open with... or save) it works. But if i try same for a .txt file it just opens the file and wont auto save it like a doc or rtxt file. Using FF 13.0.1. Windows 7.

    Hi,
    One way you could try is to right-click the link and '''Save Link as'''.

  • Problem is occurring in docx format; it is not printing "New Line" character in extracted txt using IFilter (offfiltx.dll) while with doc file IFilter (OffFilt.dll) is working fine.

    Problem: Problem
    is occurring in docx format; it is not printing “New Line” character in extracted txt using IFilter (offfiltx.dll) while with doc file IFilter (OffFilt.dll) is working fine.
    Environment: -
    Operating
    System:
    Windows XP SP2/7
    Language:
    C#
    MS
    Office Version: - MS Office 2007/2010/2013
    Problem
    Description: -
    We
    havedocx
    file with new line character, and we are processing this file in IFilter for extracting text, and it is giving output with concatenation of lines.
    Docx
    file format (Sample.docx)
    Test this music
    Word processing
    Testing docx file
    Output:
    - Test this music Word processing Testing docx file
    Requirement:
    - We
    have requirement to get following text in particular format with New Line from docx because client is using docx format only.
    Test this music
    Word processing
    Testing docx file
    Attempt:
    We have tried a lot after changing IFilter configuration,
    but it is not giving required output. Then we saved same file in doc format (Sample.doc), which is giving required output.
    Because it is application specific problem, kindly
    assist to resolve issue on priority. We are sharing IFilter paths for extracting text for doc and docx.
    Doc Filter Location: - %systemroot%\system32\OffFilt.dll
    Docx Filter Location: - <Drive>:\PROGRA~1\COMMON~1\MICROS~1\Filters\offfiltx.dll
    Code Snippet for setting property of filter
    internal static IFilter LoadAndInitIFilter(string fileName, string extension)
                IFilter filter
    = LoadIFilter(extension);
                if (filter
    == null)
                    return null;
                IPersistFile persistFile
    = (filter as IPersistFile);
                if (persistFile
    != null)
    persistFile.Load(fileName, 0);
                    IFILTER_FLAGS flags;
                    IFILTER_INIT iflags
    =
                                IFILTER_INIT.CANON_HYPHENS
    |
                                IFILTER_INIT.CANON_PARAGRAPHS
    |
                                IFILTER_INIT.CANON_SPACES
    |
                                IFILTER_INIT.APPLY_INDEX_ATTRIBUTES
    |
                                IFILTER_INIT.HARD_LINE_BREAKS
    |
                                IFILTER_INIT.FILTER_OWNED_VALUE_OK;
                    if (filter.Init(iflags,
    0, IntPtr.Zero, out flags)
    ==IFilterReturnCode.S_OK)
                        return filter;
                Marshal.ReleaseComObject(filter);
                return null;
    Kindly
    assist to resolve this issue and also let us know if any input is required.
    For any help, we would be really
    thankful.

    Kindly
    assist to resolve this issue and also let us know if any input is required.
    For any help, we
    would be really thankful.

  • How do I append a txt file? When I re-open, I cant append to the file.

    Trying to append a txt file but cant because of the header.
    How do i print to the file without the header?
    The Add Record Class
        private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {                                      
            int lengthIsbn = txtIsbn.getText().length(); //get lengths for validation
            int lengthSupplierno = txtSupplierno.getText().length();
            int lengthLastorderdate = txtLastorderdate.getText().length();
            if (lengthIsbn == 11){
                if (lengthSupplierno == 4){ //check validation
                    if (lengthLastorderdate == 8){      //Three If's because one can only have one error which cannot be specific!
                        // if passed validation then continue the add
                        bookRecord record;
                        try{
                            record = new bookRecord(
                                    txtIsbn.getText(),
                                    txtTitle.getText(),
                                    txtAuthor.getText(),
                                    Float.parseFloat(txtPrice.getText()),
                                    Integer.parseInt(txtSupplierno.getText()),
                                    txtLastorderdate.getText());
                            Output.writeObject(record);
                            System.out.println(record); // print record to check progress
                        } catch(IOException b){
                            JOptionPane.showMessageDialog(this, "Cannot Add Record Due To Input/Output Error!", "IO Error", JOptionPane.ERROR_MESSAGE);
                        } catch(NumberFormatException d){
                            JOptionPane.showMessageDialog(this, "Cannot Add Record Due To Incorrect Formatting Of Data In Text Boxes, Please Check That Price And Supplier No Are Numeric!", "Number Format Error", JOptionPane.ERROR_MESSAGE);
                        } catch(NullPointerException e){
                            JOptionPane.showMessageDialog(this, "Cannot add Record Due To Absence Of Database!", "Null Pointer Error", JOptionPane.ERROR_MESSAGE);
                    } else {JOptionPane.showMessageDialog(this, "Last Order Date Must Be In This Format (01/01/01)", "Validation Error", JOptionPane.ERROR_MESSAGE);}
                } else {JOptionPane.showMessageDialog(this, "Supplier No Must Be A Four Digit Integer", "Validation Error", JOptionPane.ERROR_MESSAGE);}
            } else {JOptionPane.showMessageDialog(this, "ISBN Must Have 11 Characters", "Validation Error", JOptionPane.ERROR_MESSAGE);}
        }                    I dont know whats wrong...

    1) You append to a file by passing true for the append argument to the constructor for the FileOutputStream or FileWriter.
    2) I have no idea what you mean by this: Trying to append a txt file but cant because of the header. How do i print to the file without the header?
    3) You're saying it's a txt file, but you're calling Output.writeObject(record). If Output is an ObjectOutputStream, (that is, you're serializing record) then it's not a text file.
    4) Variable names conventionally start with lowercase in Java, so Output should be output. (Unless Output is a class name and writeObject is a static method.)

  • Is it possible to do some researches for .txt files or .doc files in labview?

    Hi,
    I want to do some researches to a .txt file or a .doc file so as to find some keywords.then make some operations to the file to save it later.I wonder if it is possible for bits operations and for researches?
    Thanks a lot.

    Absolutely.
    From your block diagram, in the Functions Palette, click on "File I/O". You'll find a number of useful vi's. For instance, you can use the "Read Characters From File" or "Scan From File" vi's to read character strings, which can be manipulated using the string functions (vi's).
    You can also click on "Binary File vi's" if you are dealing with bit-operations.
    You can read a file, parse it, manipulate the data and write it back, all within LabView. It is very useful for that.
    Explore & have fun! )
    -JLV-

  • Understanding compile errors due to copying code from a doc file and not a txt file

    SITUATION:
    My instructor for my micro-controller class refuses to save sample code to a text file and instead saves it to a word document file instead. When I open up the doc file and copy/paste the code into my IDE "CodeWarrior" it causes errors upon compile time.
    I am having to rewrite all the code into a text editor and then copy/paste it into my IDE.
    MY UNDERSTANDING:
    I was told to always save code as a text file because when you save code as a word document file it will bring in unwanted characters when your copy/pasting the code into your IDE for compiling.
    Their are students in my class using the schools computers running "Windows" that copied and pasted the code into CodeWarrior and it compiled fine. This is not only frustrating but confusing. However, I know their are students in class with "PC's" running windows that had the same trouble I did so I know it's not a Mac issue. 
    Also I am running "Parallels" because my IDE for this micro-controller "Code Warrior" is not avaiable for my OS. I realize there are several IDE's out there that require "Windows OS" in general but I know this situation is not a Mac issue or Parallels issue or even a Windows issue. It's purly an issue of formatting that is done between the file being copied and the target program or so I'm understanding.
    Can someone exlain to me in better words or perhaps provide a resource, documentation or article that will enlighten me on this issue. I would like to better state my case next time. I'm tired of being told this is a MAC issue and that Windows is just plain better.

    The problem is (as you suggest) almost certainly a gremlin issue - characters that for one reason or another Code Warrior cannot interpret correctly. Why it happens to you and not others is a different matter. That could mean that the pofessor uses fonts that are not on your machine, or that he is using a different version of word, or it could be in how you access the data. For instance, if the prof posts this word doc on the web you may get different results if you download the file and open it in Word as opposed to opening it directly from a web browser.
    The sure-fire solution is to download TextWrangler and copy the code in there first. TW has a number of tools for finding and removing unpleasant characters. it adds a step, but... you could also try resaving the doc file as a plain text file from within word.

  • Problem in sending .doc file as an attachment.!

    Hi SDN,
    I am using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send a .doc file as an attachment i am filling the the table contents_hex with my internal table containing the data in hex format but the attachment coming to the SAP office inbox is not showing the actual data it's showing the file with all hex values.
    can any one tell the reason?
    Please give sample code if possible for sending a word file as an attachment..
    Regards,
    Rahul

    Hi Rahul,
    I am sending you the sample code I have written for TXT.
    you can use the same code for .doc with small modification.
    You use this code and check once and let me know.
    Sample code:
    Declaration:
    DATA : w_name TYPE sos04-l_adr_name.
    DATA: sent_to_all  LIKE  sonv-flag.
    DATA:
      l_datum(10),
      ls_docdata TYPE sodocchgi1,
      lt_objpack TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
      lt_objhead TYPE TABLE OF solisti1 WITH HEADER LINE,
      lt_objtxt TYPE TABLE OF solisti1 WITH HEADER LINE,
      lt_objbin TYPE TABLE OF solisti1 WITH HEADER LINE,
      lt_reclist TYPE TABLE OF somlreci1 WITH HEADER LINE,
      lt_listobject TYPE TABLE OF abaplist WITH HEADER LINE,
      l_tab_lines TYPE i,
      l_tab_lines1 TYPE i,
      l_tab_lines2 TYPE i,
      l_att_type LIKE soodk-objtp.
    CONSTANTS : c_tab TYPE x VALUE '09'.     "tab delimiter between records.
    CONSTANTS : c_line(2) TYPE x VALUE '0D'.
    CONSTANTS : l_newline(2) TYPE x VALUE '0D0A'.        "To insert Newline.
    DATA: v_str LIKE lt_objbin.
    *Program logic
    Main Text
      lt_objtxt = 'Dummy heading. ' .
        APPEND lt_objtxt.
        lt_objtxt = '' .
        APPEND lt_objtxt.
    lt_objtxt = 'Dummy second line.'.
        APPEND lt_objtxt.
        lt_objtxt = '' .
        APPEND lt_objtxt.
        lt_objtxt = 'Regards,'.
         APPEND lt_objtxt.
        lt_objtxt = 'Field Service Team' .
        APPEND lt_objtxt.
        lt_objtxt = '----
        APPEND lt_objtxt.
    lt_objtxt = 'This is system-generated email;please do not reply to this
    message.'  .
        APPEND lt_objtxt.
    lt_objtxt = 'If there are any questions regarding this error message'.
        APPEND lt_objtxt.
    lt_objtxt = '----
        APPEND lt_objtxt.
    Write Packing List (Main)
        DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
        READ TABLE lt_objtxt INDEX l_tab_lines.
      ls_docdata-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( lt_objtxt ).
        CLEAR lt_objpack-transf_bin.
        lt_objpack-head_start = 1.
        lt_objpack-head_num = 0.
        lt_objpack-body_start = 1.
        lt_objpack-body_num = l_tab_lines.
        lt_objpack-doc_type = 'RAW'.
        APPEND lt_objpack.
    Create Message Attachment   "Attachmant of  file
        LOOP AT itab1.
          CONCATENATE itab1-bldat itab1-blart itab1-bukrs itab1-budat
                      itab1-monat itab1-waers itab1-xblnr itab1-bktxt
                       INTO lt_objbin SEPARATED BY c_tab .
          CONCATENATE  l_newline lt_objbin INTO lt_objbin.
          APPEND lt_objbin.
          CLEAR lt_objbin.
        ENDLOOP.
    Write Packing List (Attachment)
        l_att_type = 'txt'.
        DESCRIBE TABLE lt_objbin LINES l_tab_lines.
        READ TABLE lt_objbin INDEX l_tab_lines.
        lt_objpack-doc_size = ( l_tab_lines - 1 ) * 255
                                        + STRLEN( lt_objbin ).
        lt_objpack-transf_bin = 'X'.
        lt_objpack-head_start = 1.
        lt_objpack-head_num = 0.
        lt_objpack-body_start = 1.
        lt_objpack-body_num = l_tab_lines.
        lt_objpack-doc_type = l_att_type.
        lt_objpack-obj_name = 'Header file name'.
        lt_objpack-obj_descr = 'Header file name'.
        APPEND lt_objpack.
    *refresh bdclm.     "Attachemnt of second file
       CLEAR lt_objbin.
        LOOP AT bdclm.
          CONCATENATE itab2-indate itab2-intime itab2-tcode
                      itab2-longtext
                      INTO lt_objbin SEPARATED BY c_tab.
          CONCATENATE  l_newline lt_objbin INTO lt_objbin.
          APPEND lt_objbin.
          CLEAR lt_objbin.
        ENDLOOP.
        CLEAR lt_objbin.
    Write Packing List (Attachment)
        l_att_type = 'txt'.
        DESCRIBE TABLE lt_objbin LINES l_tab_lines1.
        l_tab_lines2 = l_tab_lines1 - l_tab_lines.
        READ TABLE lt_objbin INDEX l_tab_lines2.
    lt_objpack-doc_size = ( l_tab_lines2 - 1 ) * 255 + STRLEN( lt_objbin ).
        lt_objpack-transf_bin = 'X'.
        lt_objpack-head_start = l_tab_lines2.
        lt_objpack-head_num = 0.
        lt_objpack-body_start = l_tab_lines + 1.
        lt_objpack-body_num = l_tab_lines2.
        lt_objpack-doc_type = l_att_type.
        lt_objpack-obj_name = 'file name '.
        lt_objpack-obj_descr = 'file name '.
        APPEND lt_objpack.
    Create receiver list
        lt_reclist-receiver = '[email protected]'.
        lt_reclist-rec_type = 'U'.
        APPEND lt_reclist.
    Send Message
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
             EXPORTING
                document_data = ls_docdata
                put_in_outbox = 'X'
                 commit_work = 'X '
    *put_in_outbox = ''
            IMPORTING
                sent_to_all = sent_to_all
    VALUE(NEW_OBJECT_ID) LIKE  SOFOLENTI1-OBJECT_ID
             TABLES
                 packing_list = lt_objpack
                 object_header = lt_objhead
                 contents_bin = lt_objbin
                 contents_txt = lt_objtxt
                 receivers = lt_reclist
    *COMMIT_WORK = X
             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.
    Thanks,
    Yuvaraj

  • How to print an Doc file(MS Word File)on a printer in JAVA

    Hi.I am Prakash.
    Folowing is the code that i have used to print an doc file on a printer. Problem is that , when i run this code it will provide me an printout of a doc file.,but not in well formate as the actual formate of the file. If any one tried this before plz help me.Thanks
    import java.lang.reflect.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Graphics2D;
    import java.io.*;
    import javax.swing.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.print.event.*;
    public class BasicPrint {
         JFrame frame;
         JButton btn;
         private boolean PrintJobDone = false;
         protected void MakeGui() {
              frame = new JFrame("PrintService");
              btn = new JButton("Cancel Print Job");
              btn.disable();
              frame.getContentPane().add(btn, BorderLayout.SOUTH);
              frame.pack();
              frame.setVisible(true);
         BasicPrint(String FileToPrint, String pMode) {
              try {
                   MakeGui();
                   File baseDir = new File("d:/doc");
    File outDir = new File(baseDir, FileToPrint);
                   // Open the image file
                   InputStream is = new BufferedInputStream(new FileInputStream(
                             outDir));
                   // Find the default service
                   DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   //DocFlavor flavor = new DocFlavor("application/msword", "java.io.InputStream");
                   //DocFlavor docFlavor = new DocFlavor("application/vnd.ms-word", "java.io.InputStream");
                   if (pMode != null && pMode.equalsIgnoreCase("PS"))
                        flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
                   else if (pMode != null && pMode.equalsIgnoreCase("PDF"))
                        flavor = DocFlavor.INPUT_STREAM.PDF;
                   else if (pMode != null && pMode.equalsIgnoreCase("JPG"))
                        flavor = DocFlavor.INPUT_STREAM.JPEG;
                   else if (pMode != null && pMode.equalsIgnoreCase("GIF"))
                        flavor = DocFlavor.INPUT_STREAM.GIF;
                   else if (pMode != null && pMode.equalsIgnoreCase("PNG"))
                        flavor = DocFlavor.INPUT_STREAM.PNG;
                   else if (pMode != null && pMode.equalsIgnoreCase("PCL"))
                        flavor = DocFlavor.INPUT_STREAM.PCL;
                   else if (pMode != null && pMode.equalsIgnoreCase("RAW"))
                        flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT16"))//****                                   *********
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16;
                        System.out.println("****ACTIVE***");
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTBE"))//****
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16BE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTHOST"))//***
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_HOST;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT8"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_8;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTASCI"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
                   else if(pMode != null && pMode.equalsIgnoreCase("TXTLE"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16LE;                                        //*******
                   else if(pMode != null && pMode.equalsIgnoreCase("SEVICE"))
                        flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
                   String type = flavor.getMediaType();
                   System.out.println("Type ="+ type);
                   //IMPRIMIR prakashCV.doc TXT text/plain; charset="utf-16le"; class="java.io.InputStream"
                   System.err.println("* IMPRIMIR " + FileToPrint + " " + pMode + " "
                             + flavor);
                   PrintService dservice = PrintServiceLookup
                             .lookupDefaultPrintService();
                   PrintService[] services = PrintServiceLookup.lookupPrintServices(
                             flavor, null);
                   if (services == null || services.length < 1)
                        services = PrintServiceLookup.lookupPrintServices(null, null);
                   PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
                   aset.add(new Copies(1));
                   aset.add(OrientationRequested.PORTRAIT);
                   // aset.add(MediaTray.MAIN);
                   aset.add(Sides.ONE_SIDED);
                   aset.add(MediaSizeName.ISO_A4);
                   PrintService service = ServiceUI.printDialog(
                             (GraphicsConfiguration) null, 60, 60, services,
                             (PrintService) dservice, (DocFlavor) flavor, aset);
                   if (service != null) {
                        // Create the print job
                        final DocPrintJob job = service.createPrintJob();
                        Doc doc = new SimpleDoc(is, flavor, null);
                        // Monitor print job events; for the implementation of
                        // PrintJobWatcher,
                        PrintJobWatcher pjDone = new PrintJobWatcher(job);
                        if (job instanceof CancelablePrintJob) {
                             btn.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       CancelablePrintJob cancelJob = (CancelablePrintJob) job;
                                       try {
                                            cancelJob.cancel();
                                       } catch (PrintException e) {
                                            // Possible reason is job was already finished
                             btn.enable();
                        try {
                             // Print it
                             job.print(doc, (PrintRequestAttributeSet) aset);
                        } catch (PrintException e) {
                             e.printStackTrace();
                        System.err.println("* Impresion Realizada - Esperando ..");
                        // Wait for the print job to be done
                        pjDone.waitForDone();
                   // It is now safe to close the input stream
                   is.close();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   try {
                        synchronized (BasicPrint.this) {
                             PrintJobDone = true;
                             BasicPrint.this.notify();
                   } catch (Exception e) {
                        e.printStackTrace();
         public synchronized void waitForDone() {
              try {
                   while (!PrintJobDone) {
                        wait();
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              try {
                   //args[0]="t";
                   //args[1]="rr";
    //               if (args.length < 1) {
    //                    System.err.println("\nSintaxis:\n\n java BasicPrint FileToPrint [pMode]\n");
    //                    System.exit(0);
                   BasicPrint bp = null;
                   //if (args.length < 2){
                        //bp = new BasicPrint(args[0], null);
                   //}else{
                        //bp = new BasicPrint(args[0], args[1]);
                        bp = new BasicPrint("prakashCV.doc","SEVICE");                                                       //****/***
                   bp.waitForDone();
                   System.exit(0);
              } catch (Exception e) {
                   e.printStackTrace();
         class PrintJobWatcher {
              // true iff it is safe to close the print job's input stream
              boolean done = false;
              int lastEvent = 0;
              PrintJobWatcher(DocPrintJob job) {
                   // Add a listener to the print job
                   job.addPrintJobListener(new PrintJobAdapter() {
                        public void printJobRequiresAttention(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* La impresora requiere de su Atencion ! * "
                                                 + pje);
                             // allDone();
                        public void printDataTransferCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* Transferencia de datos a la impresora OK. * "
                                                 + pje);
                             // allDone();
                        public void printJobCanceled(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Trabajo de impresion CANCELADO ! * "
                                       + pje);
                             allDone();
                        public void printJobCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Impresion completa OK. * " + pje);
                             allDone();
                        public void printJobFailed(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* ERROR en la Impresion ! * " + pje);
                             // allDone();
                        public void printJobNoMoreEvents(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* No mas eventos de impresion * " + pje);
                             allDone();
                        void allDone() {
                             synchronized (PrintJobWatcher.this) {
                                  done = true;
                                  PrintJobWatcher.this.notify();
              /** Description of the Method */
              public synchronized void waitForDone() {
                   try {
                        while (!done) {
                             wait();
                   } catch (InterruptedException e) {
                        e.printStackTrace();
    }

    Hi Maxpkh
    Do you mean attachment? You can't do that with free Adobe Reader you need Acrobat to do this.
    ~Deepak

  • How to read data from multiple files and append in columns in one file

    Hi Guys,
    I have a problem in appending data from files in different columns. I have attachement has file A and B which I am reading and not able to get data as in file Result.txt. Please comment on how can I do this
    Solved!
    Go to Solution.
    Attachments:
    Write to file.vi ‏13 KB
    A.txt.txt ‏1 KB
    B.txt.txt ‏1 KB

    You cannot append columns to an existing file. Since the data is arrange line-by-line as one long linear string in the file, you can only append rows. A new row needs to be interlaced into the original file, shifting everything else. If you want to append rows, you need to build the entire output structure in memory and then write all at once.
    (I also don't think you need to set the file positions, it will be remembered from the last write operation.)
    Unless the files are gigantic, here's what I would do:
    (Also note that some of your rows have an extra tab at the end. If this is normal, you need a little bit more code to strop out empty columns. I include cleaned up files in the attachment. I also would not call them A.txt.txt etc. A plain A.txt is probably sufficient.)
    EDIT: It seems Dennis's solution is similar )
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Write to fileMOD.zip ‏6 KB
    MergeColumns.png ‏6 KB

  • Looking for a program that can handel import and export of palm doc files

    I am looking for a program that can handel the import and export of palm doc Files that can convert them to to either txt or RTF files for Vista 32, running Palm Desktop 7.1.
    Could anyone give me a few suggestions of any plug-ins that would be good me?
    Hearns
    Post relates to: Palm IIIxe
    This question was solved.
    View Solution.

    Ok, you need to clean uninstall Palm desktop 6.2. Install Palm desktop 4.1.4 and download and install documents to go version 6.
    Here are the clean uninstall instructioins for Vista.
    You should first make a copy of your data to have just in case something
    happens. You can find your data files by going to Start --> Documents -->
    Palm OS Desktop. Highlight your Palm Desktop username and right click and
    copy. Then go to your PC desktop right click on a blank spot and select paste.
    If this is the first time you are installing Palm desktop and encountering a problem, skip the previous step.
    Now you want to uninstall Palm Desktop and remove everything that has to do
    with Palm Desktop from your computer.
    Go to the following locations on the PC and delete the folders listed below.
    C:\Program Files\Palm or Palm One
    C:\Users\[Vista Login Name]\appdata\local\virtualstore\Program Files\Palm or
    PalmOne
    C:\Users\[Vista Login Name]\appdata
    *Note you may need to view hidden folders to get to appdata. To do that go
    into your control panel and open folder options. Go to view tab and uncheck
    hide hidden files.
    Once this is done you will need to delete some registry keys from your PC Operating System.
    Word of warning, going here and deleting the wrong thing can cause your PC
    from starting up, crashing and deletion of programs and data. If you feel
    you are unsure of yourself, see if you have a friend that can help you or a
    PC technician that you can pay to help you. This procedure will show them everything they need to delete. To make sure we have a good copy of the current registry, we need to do a backup of the Registry.
    Go to start on the PC, in the search field type "regedit.exe" without quotes.
    Highlight COMPUTER, go to File --> Export. Should pop up with a Save As box.
    Current location is fine, should be in My Documents or save to a location you will remember. In the file name on the bottom type "backup[todaysdate]" i.e. backup07072008. Next, the hard part.
    The easiest way to make sure your working with the correct key, highlight the key i.e. palm quick install, and press delete on your keyboard. It will ask you, are you sure. Say yes. Do the same thing for all keys below.
    If you make a mistake, stop what you are doing. And call a PC technician.
    BUT do not turn off your computer.
    The reg keys are as follows (Note: some of theses reg keys will not be here
    but if they are delete them)
    * HKEY_CURRENT_USER\Software\U.S. Robotics\Palm Quick Install
    * HKEY_CURRENT_USER\Software\U.S. Robotics\PalmOne File Transfer
    * HKEY_CURRENT_USER\Software\U.S. Robotics\Pilot Desktop
    * HKEY_CURRENT_USER\Software\Palm
    * HKEY_CURRENT_USER\Software\Palm, Inc.
    * HKEY_CURRENT_USER\Software\PalmDesktopAutorun
    * HKEY_CURRENT_USER\Software\palmOne
    * HKEY_CURRENT_USER\Software\PalmSource
    * HKEY_LOCAL_MACHINE\Software\PalmSource or anything else that says palm
    Next reboot your computer.
    Then reinstall your palm desktop from the CD and do a hotsync. Use the username that is on the handheld.

  • Append xml elements to a file

    Ok. After solve the problem of append to files using a file adapter in osb (Re: Write/Append text file with OSB now i want to know if there is some way to append elements to an existant xml. For each request i will have the following message:
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    And, for two requests ai want to log:
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    And no:
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    As i'm doing (in my tests).
    Thank you.

    do you want to append/insert nodes in the file
    or do you want to construct that xml first in the osb and after that insert the xml in the file ?
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageflow.html
    Message Processing Actions
    Insert activity
    you can use the insert activity to insert/append xml parts in your payload, and when the format is done, write it to the file

  • Acrobat 11 doesn't create pdf. files from doc. files

    I tried to create a pdf. file from a doc. file (Office 2003). Acrobat 11 instead opens a warning message with the following contents (translated from German):
    A high security level has been chosen. Start the application that created the document, activate the dialogue "safety warning", choose "always trust macros from this resource, activate ... from Adobe Systems Inc. (the message aborts there).
    I selected "Extras/Macro/Safety/Safety level" , there I selected "low". The above mentioned message still comes up.
    What do you suggest to do in order to finally create pdf. files from doc. files?
    Additional information: Creating pdf. files from xls. files (Excel), txt. files (Editor) and saving a webpage as a pdf. file all work fine.
    Thanks for your input!

    Although Office 2003 is old compared to Acrobat XI, according to Compatible web browsers and PDFMaker applications it should work, though support has passed end of life.
    So my first test (if it were me) would be to see if PDFMaker works if run in the simplest way (the only way I ever use it, this right click conversion stuff isn't in my worldview). That is, does the Acrobat menu appear in Word and does it work? If it does not work, no other method based on it can work.

  • Windows 2008 R2 Folder assign permission "Read and Write" problem with *.doc file

    Hello All,
    I am a new one here,
    I am sorry for any mistakes and also my english is so poor.
    M Brother company runing Windows 2008 R2 as Active Directory...
    We have folder Name: Admin
    and in this folder, there are alot documents files as : *.doc, *.dwg, *.txt etc.....
    All user accesing to these files and they can open to edit and save...
    One day my brother want me to set Admin folder for all users just"Read and Write.." mean they still can open files to edit and save... but can't delete..
    I did success with this..
    But only one thing happen.. when they open *.doc file to edit and attempting to save, the message alert" access denide " and they can only "SAVE AS"...We don't want "Save as"
    Could you show me how can we fix error with *.doc file while they trying to save? because it allow only save as.. but other files as *.text file or *.dwg they can save without problem..
    Could expert here ever face this issues and fix by yourself, please share me with this..
    Please help me..
    Best regards,

    Hi,
    Office programs are specific. They will create a temp file when edit, then the temp file will be deleted when close. So Delete permission is needed for users to saving Office files like Excel/Word.
    For more detaile information, please refer to the thread below:
    Special Permissions - User cannot save files
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/721fb2f1-205b-46e5-a3dc-3029e5df9b5b/special-permissions-user-cannot-save-files
    Best Regards,
    Mandy 
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

Maybe you are looking for

  • Error in the Adobe Flash Player in EPM WEB Screen

    Hi Team , We are using EPM 10 NW SP 15 . While logging in the SAP EPM 10 Web screen , We are getting one error related to Adobe Flash payer That's Error asking 2 options one is Dismiss & Another is continue. Please let me know , Why this error pop me

  • Not reading sd card

    I am trying to read an sd card thru the camera kit. I am not getting anything, tried turning off and back on, tried different cards and nothing. I can play on my home computer but cant even get to find. Any ideas?

  • PI best practice and integration design ...

    Im currently on a site that has multiple PI instance's for each region and the question of inter-region integration has been raised my initial impression is that each PI will be in charge of integration of communications for its reginal landscape and

  • Why can't i download firefox

    i had firefox i deleted it by mistake now i can't download it at all on my pc why??

  • Lost ipod and want to retrieve info from it. how do i do this?

    lost my ipod and would like to retrieve its info. how is this possible