Handling Of Non-HTML Documents

Hi everyone,
for the PDF printout functionality in our BSPs we are using the technique described form Brian McKellar in this weblog:
/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
It works great, but not in all systems.
We are on a 5 system landscape and it works in two systems. The coding is transportet thru all systems and is exactly the same in all systems.
I have implemented the test progamm from Brian and it works also only in the same two systems.
Now I have bought his book "Advanced BSP Programming", but it dose'nt help.
Maybe it depends on the ICM cache properties? Any ideas?
Thanks for the help!
Regards,
Stephan

Hi together,
I get the following error message:
Following error text processed in system:
BSP Exception: Das Objekt E3FF8C1DB39E2A448DB1CD3E3C93533C.pdf in der URL /sap(bD1lbiZjPTAwMSZzPVNJRCUzYUFOT04lM2FwcnZtYWluX1BSVl8wMCUzYV9QWHZRU2FWZXlEY2lZY2NCNTNWRVVFMXF1NXUta2JUUTducGdHalYtQVRUJmk9MSZ3PTQ5NTAwMDAr)/bc/bsp/sap/yy_chm_mm_opp/E3FF8C1DB39E2A448DB1CD3E3C93533C.pdf ist nicht gültig.
The generation of the PDF is ok. We are using Smart Forms and convert the OTR output via FUBA CONVERT_OTF into PDF.
The systems are on the same release level, support package, kernel patch and all are Unicode systems.
This is my coding: Method - DO_HANDLE_EVENT
*       --- fill HTTP response        CREATE OBJECT lr_cached_response               EXPORTING add_c_msg = 1.        lv_pdf_xstring = lv_content.        lv_pdf_len = XSTRLEN( lv_pdf_xstring ).        lr_cached_response->set_data( data   = lv_pdf_xstring                                   length = lv_pdf_len ).        lr_cached_response->set_header_field(           name  = if_http_header_fields=>content_type           value = 'application/pdf' ).        CALL METHOD lr_cached_response->if_http_response~set_status          EXPORTING            code   = 200            reason = 'OK'.        CALL METHOD      lr_cached_response->if_http_response~server_cache_expire_rel          EXPORTING            expires_rel       = 180*           ETAG              =*           BROWSER_DEPENDENT = ' '            .        CALL FUNCTION 'GUID_CREATE'          IMPORTING            ev_guid_32 = lv_guid_32.        CONCATENATE runtime->application_url '/' lv_guid_32 '.pdf'               INTO gv_display_url.        cl_http_server=>server_cache_upload( url = gv_display_url        response = lr_cached_response ).
I have checked my systems today, and now 3 of 5 system are ok. We don't changed the coding, the smart form and no updates are implementet on this system. I don't understand this behavior and maybe tomorrow I get the error again.
Any thought?
Regrads, Stephan

Similar Messages

  • How to handle the Non HTML Documents in BSP

    Hi All,
    I want to upload the file which contains the  non HTML data.
    I am using the browse button and from the destop i should downloap a file which is non HTML document.
    It would be appriciatable if you send me the code.
    Iam using the html:fileupload tag
    Thanks,
    Mahalakshmi.K

    Hi Rajdeep,
    You can use the below tag which is used to change both the font and color of the text.
    <font face="Book Antiqua,Garamond" size="3" color="red"> YOUR TEXT HERE </font>
    This will work for the normal text which is given between the <font> </font> tags. but not directly with the Text View tag.
    You can choose this as an alternative.
    Thanks,
    Ansar
    Edited by: Ansar Hussain on Dec 3, 2008 9:25 PM

  • Viewing html document

    Hi all,
    I was referring to Brian's excellent blog on handling non-html documents for creating and displaying attachments. But how to open a html attachment? I am creating attachment of type htm document ( mimetype text/html) . But how to display it ? Please help.
    Regards
    Ananya

    oninputprocessing.
    fileupload ?= cl_htmlb_manager=>get_data(
                           request = request
                           id      = 'myUpload'
                           name    = 'fileUpload' ).
    file_name      = fileupload->file_name.
    file_mime_type = fileupload->file_content_type.
    file_length    = fileupload->file_length.
    file_content   = fileupload->file_content.
    CREATE OBJECT cached_response TYPE cl_http_response EXPORTING add_c_msg = 1.
      cached_response->set_data( file_content ).
      cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                         value = file_mime_type ).
      cached_response->set_status( code = 200 reason = 'OK' ).
      cached_response->server_cache_expire_rel( expires_rel = 180 ).
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_32 = guid.
      CONCATENATE runtime->application_url '/' guid INTO display_url.
      cl_http_server=>server_cache_upload( url      = display_url
                                           response = cached_response ).
      RETURN.
    and in layout
    <% if not display_url is initial . %>
    <script language="Javascript">
            window.open("<%= display_url%>");
          </script>
    <% endif . %>
    Is this what you are looking for?
    Regards
    Raja

  • Merge option during assembly of PDF from html documents.

    Hello,
    Can LiveCycle create a combined PDF document by converting
    HTML documents to PDF with the option of merging them (eliminate whitespace) during ddx assembly.
    Here is a simple case. Combine three html documents such as
    html-1: contains text ONE
    html-2: contains text TWO
    html-3: contains text THREE
    The default assembled document appears to have three pages with each having a its single word text of content. However, a combined document with one page containing the merged text is desired in some cases.
    Does LiveCycle handle this case. Thanks for any insight.
    Jesse

    Assembler will only deal with PDFs. PDF/G will take non PDF content and make PDF out of it. So in your case you would use PDF/G to change the HTML to PDF then use Assembler to manipulte the three docs into a single doc.
    Hope that helps

  • Viewing a HTML document in my Java program

    Hi,
    My Java program has a JTextPane that can display plain text or HTML documents. This program can mark up certain parts of the document to draw the user's attention.
    However, I am having problems when it comes to marking up some of the HTML documents. When they are first loaded onto the JTextPane, they appear fine. When I then run the method to apply the mark up styles, I notice that the text turns the same color as the background after a certain point - making it impossible to see the document or markup.
    The HTML (or text) document on display is made into a StyledDocument. And this is how the View for the HTML documents is created:
    HTMLEditorKit htmledkit = new HTMLEditorKit();
    ViewFactory myHTMLViewFactory = htmledkit.getViewFactory();
    return myHTMLViewFactory.create(elem);
    Note that elem is an Element -.-
    - I tried modifying the color tags in the HTML document, but even when I made the text black and the background white, the text still goes white. If it's a black background, the text goes black, etc. The markup style is actually trying to turn parts of the text red - and it works almost all of the time, apart from these certain documents.
    - I then tried applying my own style whenever a HTML document is loaded in, in the hope that I could force the background white and text black, regardless of the tags:
    MutableAttributeSet att = new SimpleAttributeSet();
    StyleConstants.setForeground(att,Color.black);
    StyleConstants.setBackground(att, Color.white);
    doc.setCharacterAttributes(0, doc.getLength(), att, false);
    The resulting document display kept the original HTML background color, but wherever there was text it looked like someone had run a highlighter over it to change the background white and text black. Kinda ugly! And it still didn't work - come markup time this style was ignored after a certain point.
    - This is one of the HTML documents that causes the problem:
    <html>
    <head>
         <link rel="STYLESHEET" type="text/css" href="mystyle.css">
         <title>My Document</title>
    </head>
    In the body tag:
    <table>
    table here... this displays fine
    </table>
    And here is the problem point:
    <table width=100% cellspacing=0 cellpadding=0>
    <tr>
    <td>
    <table width=100% cellspacing=0 cellpadding=0 style="padding: 3px; padding-top: 6px; padding-bottom: 6px;">
    <tr>
    <td width=100% style=" padding-left: 6px; padding-right: 6px;">
    <table class=pane cellpadding=0 cellspacing=0>
    <tr>
    <td width=100% class=panetitlebox align=Center >
    This is the last text that gets displayed! After this sentence, text goes same color as background.
    </td>
    </tr>
    <tr height=100% valign=top>
    <td class=panebox colspan=2 align=Left style="padding: 0px; border: solid 1px; border-top: none;">
    <table width=100% cellspacing=0 cellpadding=0>
    <tr>
    <td class=content align=Left style="padding: 4px; background: transparent;">
    <b>Bold text that doesn't show</b> More text that doesn't show
    And so on....
    In the header tag of another HTML document that has the same problem, it says it is HTML version 4.0. I have looked up the Java API and found that the javax.swing.text.html package is still 'migrating' towards HTML 4.0 and only supports HTML version 3.2. (Even in the API for Java 1.5 beta, although I use Java 1.4.2)
    So I assume that Java just can't handle my documents! I also think that most of these HTML documents were generated by a program (I think I saw Frontpage in one of the document's meta tags), because when I make my own HTML it doesn't have the problem.
    But it would be nice if my Java program can support these documents, so does anyone have any suggestions as to how I could get these documents to display properly once I apply mark up styles?
    If I haven't explained something properly, I will clarify as it is a complicated program, and I've been driving myself crazy with this problem for several days!

    I was looking through the HTML document removing pieces of code to see where the problem was. I removed all code relating to styles, alignment, width, padding etc, with no luck. The document has several tables, many of them nested, so I added some comments to see where each started and ended. After I added the comments, I checked the document in my Java program again, ran the mark up styles, and it suddenly worked! So I removed each comment one by one, checking each time, until I found the one that made it work. I then tried typing in the same spot, adding an extra space, moving the <tr> tag onto the same line, but only the HTML comment made it work. Here is the part of the document where I added the comment (it's in bold)
    This is the last text that gets displayed! After this
    sentence, text goes same color as background.
    </td>
    </tr>
    <tr height=100% valign=top>
    <td class=panebox colspan=2 align=Left style="padding:
    0px; border: solid 1px; border-top: none;">
    <table width=100% cellspacing=0 cellpadding=0> <!-- This comment makes the document display fine after markup -->
    <tr>
    <td class=content align=Left style="padding: 4px;
    background: transparent;">
    <b>Bold text that doesn't show</b> More text that
    doesn't showDoes anyone know WHY this is happening? It's so weird. I thought if it was something more obvious, like styles, I could just get my program to remove them when reading in the document. But added HTML comments????
    Thank you ^_^

  • Opening a html document in order to load a certain website (and login), results in opening the startpage(s) from FireFrox.

    we use a html document to automatically login out application. but when this document opens FireFox always opens the startpage. When FireFox is already running the html document works as intended.
    no problems with IE.

    Unfortunately, Java standard API can't handle PDF file as a distinct document.
    However, you could use a physical URLConnection to get any file content as
    a simple byte mass.

  • Wanting to open a HTML document in users default browser using Menu Items

    I have a couple of Menu items that I want to open up various HTML documents.
    menuHelpItem.addActionListener(new ActionListener()
         public void actionPerformed(ActionEvent evt)
    });I've seen a couple of 'solutions' to people asking about opening files, but none even compiled never mind ran. It's in my parent program, and any solution needing to throw IOException (lots of things annoyingly seem to) that'll mean the listeners need to which never seems to work. Even if it did though, the class would have to and so would all the others. Messy.
    Best I've done is open up a new JEditorPane based on the url of the HTML files, but this is definately not good enough as the font, layout, links are all screwed and if I could fix it, it would no doubt take longer than I have.
    So basically, say you have a button, how do you make it open "resources/SearchHelp.html"?

    "http://www.google.com"; //
    Interesting. I changed my code to this:
    private void showHelp(String url)
         try
              String[] cmd = new String[5];
              cmd[0] = "cmd.exe";
              cmd[1] = "/C";
              cmd[2] = "rundll32";
              cmd[3] = "url.dll,FileProtocolHandler";
              cmd[4] = PronunciationDictionary.class.getResource(url).toString();
              Process process = Runtime.getRuntime().exec( cmd );
         catch (IOException e)
              JOptionPane.showMessageDialog(this, "Unable to load help file. Please try again.", "Help - Dictionary A'la Lewis", JOptionPane.INFORMATION_MESSAGE);
    }and I printed out PronunciationDictionary.class.getResource(url).toString(); before trying it and that worked fine. I click on the buttons but nothing happens, no error which is good, but nothing else either, which is bad. I thought maybe I was just doing it wrong, so I tried replacing it with just http://www.google.com but same thing, nothing happened at all.

  • Viewing HTML documents

    If I am downloading an HTML document from the WWW, i.e. a web page, how can I handle it so that what is actually shown on my GUI component (which is of type TextArea) is the final "page" (as shown by any standard Web browser) rather than just html code?

    Check out JEditorPane

  • Advanced HTML Document use

    Ok, I'm using an HTML Document in my Java Applet Jabber client. Currently I'm using an HTML Document for the chat area. What I'm lacking is the ability to turn html on/off or put in text that contains actual HTML without parsing it out.
    I've tried replacing the < and > 's with > and < but to no avail. This simply removes the hats or whatever they're called and everything between them completely from the content of the document. I've tried using the whitespace attribute of css which also did not work. I've tried 'pre' tags, and I've tried closing the html tag and re-opening it. I tried changing the content type of the document. None of these have worked, they simply remove the html or the entire text altogether. I'm guessing I either have to modify the parser or play with the actual objects of the html.
    Here's how I'm inserting the html(this is the only way I could get it to work).
    int start = doc.getLength();
    chatPane.setCaretPosition(start);
    inserter = new HTMLEditorKit.InsertHTMLTextAction(null,"<font color='"+nameHTMLColor+"'>"+from+"</font><font color='"+messageHTMLColor+"'>"+Static.decodeChat(message, htmlEnabled)+"</font>",HTML.Tag.BODY,null);
    inserter.actionPerformed(new ActionEvent(chatPane,ActionEvent.ACTION_PERFORMED,null));
    int end = doc.getLength();
    chatPane.setCaretPosition(end);
    Thanks for your time.
    --Zephryl                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    hehe... I did, "I've tried replacing the < and > 's with > and < but to no avail." Sorry, the forum decoded the escapes.

  • Counting lines of parsed HTML documents

    Hello,
    I am using a HTMLEditorKit.ParserCallback to handle data generated by a ParserDelegator.
    Everything is ok but I can not find how to catch end of lines (I need to know at what line a tag or an attribute is found).
    Thanks in advance for any hints.

    I noticed that the parse() method of ParserDelegator creates a DocumentParser object to do the actual parsing of the HTML document. DocumentParser contains a method getCurrentLine(). So, I tried to extending ParserDelegator so I could access Document Parser. However, the getCurrentLine method is protected so I ended up also extending DocumentParser.
    You probably have code something like:
    new MyParserDelegator().parse(reader, this, false);
    This should be replaced with:
    parser = new MyParserDelegator();
    parser.parse(reader, this, false);
    where you defined an instance variable: MyParserDelegator parser;
    You can now use parser.getCurrentLine() in any of you parser callback methods.
    Note that you may not alway get the results that you expect for the current line as many times I found the line to be 1 greater than I thought it should be. Anyway you can decide if the code is of any value.
    Following is the code for MyParserDelegator and MyDocumentmentParser inner class. Good Luck.
    import java.io.IOException;
    import java.io.Reader;
    import java.io.Serializable;
    import javax.swing.text.html.HTMLEditorKit;
    import javax.swing.text.html.parser.DTD;
    import javax.swing.text.html.parser.DocumentParser;
    import javax.swing.text.html.parser.ParserDelegator;
    public class MyParserDelegator extends ParserDelegator implements Serializable
         MyDocumentParser parser;
    public void parse(Reader r, HTMLEditorKit.ParserCallback cb, boolean ignoreCharSet) throws IOException
         String name = "html32";
         DTD dtd = createDTD( DTD.getDTD( name ), name );
              parser = new MyDocumentParser(dtd);
              parser.parse(r, cb, ignoreCharSet);
         public int getCurrentLine()
              return parser.getCurrentLine();
    public class MyDocumentParser extends DocumentParser
         public MyDocumentParser(DTD dtd)
              super(dtd);
         public int getCurrentLine()
              return super.getCurrentLine();

  • Preview of HTML document in KM Navigation iView

    Hi all!
    I need your help. I would like to create layout set which would be able to display tree on the left side and preview of HTML document on the right side of content area. If I click on HTML document in the tree I need to see his preview. I thought that I can resolve this by "Explorer and Preview" profile. But unfortunely it doesn't work. Has someone any experience with the profile? Or can someone advice to me how create new layout set?
    I found this links, but they didn't help me much.
    http://help.sap.com/saphelp_nw04/helpdata/en/4e/02573d675e910fe10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/96/248cd68f23774fb74dfc18a2994d8f/frameset.htm
    Thank you in advance for any reply!
    Regards
    Zbynek

    Hi Saurabh,
    Using the presentation settings in Details can sometimes
    be tricky since it remembers the context of which iView
    called it. Make sure you open the details out of the iView
    in which you want the customizations to be in effect.
    Otherwise, changing it in the configuration is a
    bit more straightforward in its effects.
    Regards,
    Darin

  • Print html document

    Hi, I'm trying to print a html document with this following java code but doesn't works:
      public void onActionPrintEncuestaPDF(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionPrintEncuestaPDF(ServerEvent)
         try{
              Robot robot = new Robot();
              // Ctrl+P
              robot.keyPress(KeyEvent.VK_CONTROL );          
              robot.keyPress(KeyEvent.VK_P );          
              robot.keyRelease(KeyEvent.VK_CONTROL);
              robot.keyRelease(KeyEvent.VK_P );
              Thread.sleep(500);
              //Alt+U
              robot.keyPress(KeyEvent.VK_ALT );
              robot.keyPress(KeyEvent.VK_U );
              robot.keyRelease(KeyEvent.VK_ALT );
              robot.keyRelease(KeyEvent.VK_U );
              Thread.sleep(500);
              //entrée
              robot.keyPress(KeyEvent.VK_ENTER);
              robot.keyRelease(KeyEvent.VK_ENTER );
              Thread.sleep(500);
         catch(Exception e){  }
        //@@end
    This is not working because java.awt.Robot is a part of AWT package and intended for the client site, how I can make an action that when the
    client push the print button. Print the html document automatly.
    Regards,
    Gabriel

    I create into KM Content on portal a file called print.html and I put the following code:
    &#65279;<html>
      <head />
      <body onLoad="window.parent.focus(); window.parent.print();">
      </body>
    </html>
    Because window.paren.print(); printed the code of actual iFrame. And into Web Dynpro I created a button that call the following function.
    public void onActionPrintEncuestaPDF(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionPrintEncuestaPDF(ServerEvent)     wdContext.currentPrintElement().setAtrURL("/irj/go/km/docs/documents/print/print.html");
       //@@end

  • Safari won't open webarchives or html documents stored on computer

    I occasionally save a webpage to my computer as a .webarchive for later usage, but anytime I try to open them safari takes me to a completely different page. It brings me to my Top Sites page that shows all of my most frequently visited pages. I don't understand why safari would do this since the way the document is created is by saving the page directly in safari (command + S). I noticed the problem initially when Safari wouldn't open an html document that I had created and stored on my computer. I used the page as my homepage because it had links to all of my most frequent websites and because I liked having my own creation as my home page (that doesn’t really matter, though) and then out of nowhere when I opened safari my homepage had been changed to Yahoo (my default engine) and the html document wouldn’t open at all. I thought that maybe the problem was due to a recent update because I noticed that two new tabs were added to the toolbar (ebay and amazon), but I don’t understand why an update would make it so that .webarchive files, created by safari, wont open. I checked my safari version, it is 7.0.3, and if it helps, the html documents that won't open were made with Adobe Dreamweaver. I would really appreciate if someone could tell me what is happening because I do need to be able to open the .webarchive files I have saved in the past. Thank you.

    Carolyn, I've told you repeatedly, that site's instructions are crap. They absolutely do not fully remove the Genieo adware. In fact, the uninstaller that site refers you to will actually install components of the adware that were not already present! For the same reason, it makes no sense to rely on Genieo's instructions. I am completely mystified as to why you continue to post these suggestions.
    To properly remove Genieo, see:
    http://www.thesafemac.com/arg-genieo/
    (Fair disclosure: The Safe Mac is my site, and contains a Donate button, so I may receive compensation for providing links to The Safe Mac. Donations are not required.)

  • Print only a specific control or indicator on a front panel to HTML document

    Is there any way to print a specific control or indicator (not the whole front panel) to HTML document? I am trying to print a report that has a graph and some indicator value on it.

    There is a VI called "Append Control Image to Report.vi" which will allow you to do this. It's located in the Functions>>Report Generation pallette. Take a look at this and see if it's what you're looking for.
    J.R. Allen

  • How can I embed a HTML document onto my webpage?

    What I am trying to do: I am trying to make an image that has links to urls from different parts of the image.
    What I have done so far: I have built a photoshop image to embed on my webpage, following the instructions offered by many online forums, but cannot actually embed it as it isn't a url.
    Firstly, I sliced up an image, adding url's and alt tage etc to each slice. Then I did:
    File > Save for web > (Prest: JPEG High) > Save > (entered my file name) Format: HTML and Iamges > Save
    When I locate my file where I saved it, it has been saved as a Chrome HTML Document, but I can't then embed this on my website, using the 'embed code' tool I normally use. I presume this is because it doesn't begin with http:// ?
    Here is the HTML document I have made: file:///C:/Users/Daniel/Desktop/UK%20map%20interactive/Afternoon/UK-map-locations.html
    (If you can see this) This is the image I want and the links are working too but it's getting this onto an existing webpage.
    Other pages I have seen have talked about iamge maps, but I take it using the slice tool is better for what I am trying to acheive?
    Any suggestions/help would be greatly appreciated.

    One: Users can't see links on your local desktop. You would have to upload the files somewhere. Two: Images generally don't contain links. URLs are meta information build around the image in HTML. Three: Because of the previous point, whether you use sliced images or an image map doesn't matter, if you have no way of inserting the information into the native HTML structure of the web pages. If at all, you would open the HTML file in a suitable editor like Dreamweaver (or even a basic text editor) and copy&paste it into the web page sourcve code, but you'd still have to upload the image(s). The rest we can't know. You have not provided any link to the web site or told us which hosting provider you use. From your description it sounds like one of those "free" providers that restrict user's options to customize to the bare minimum and the rest is based on templates and plastered with advertising. In any case, the solution is not in Photoshop and you would have to read up on web design basics, HTML, CSS and al lthat on a more general level or review your hosting provider's guides on how to set all this up.
    Mylenium

Maybe you are looking for

  • Remote Keys for Multiple Systems

    I am working on an SRM project where we have internal catalogs items (from ECC) and external catalog items (from Excel files) going into an MDM Catalog repository.  For both, we use a lookup table for the Supplier number to cross-ref to a supplier na

  • Conditiuons needs to be ZERO for creating third party sales order.

    Hi Friends, we are creating third party sales order, which triggers PO automatically based on the outline agreement. before saving the PO , i needs to set ZERO for cretain condiations. please let me know how to solve this.  means any user-exits are t

  • New bie problem System in read

    freinds i recently downloaded an ebook n I HAVE 1 QUERY IF any of U COULD DEBUG THAT TOO I would REALLY BE A HAPPY MAN friends WITH BELOW MENTIONED CODE, PROBLEM IS THAT WHEN USER ENTERS SUPPOSE 1,48 AUTOMATICALLY GETS ADDED TO IT N WHEN I SUBTRACT 4

  • E65 and BMW

    I'm able to pair my nokia E65 with my car (BMW Series 5) but I can not see my contacts in idrive. Is there any way to solve this?

  • Keyframes control with layer markers

    Hello, I have an animation of a line that has two sets of keyframes of two different properties in CS4. Basically a line gets generated in the first phase then it gets cleared out in the second phase. This is done using two slider controls that act o