Reading HTML / PDF / DOC  Files

I tried to read an PDF file using FIleInputStreamReader and tried to print the contents. Some grabage value is getting printed. on tried to read the HTML filre..only the source is getting printed by the printer.
How can i overcome this problem

How are you printing this stuff?
If you want to print files of various formats, for each file type, you need a way to read the file and render it's contents like the regular application does (Acrobat Reader, Word, etc) and print that rendered output. You can't just send the file as text and have it print correctly. Whatever you do to print the text file works for text files only. HTML works the way it does cuz it's a text file which the browser interprets the markup in it to make it look nice. But you aren't rendering that HTML, you're just printing the text in the file, which includes the markup. The PDF and DOC files are even more different, they are binary formats.
Whatever you are calling to get the text files to print is not some magic code that's going to interpret and render any file format you give it. That's why there are different programs for viewing PDFs and DOCs and HTML files and the like instead of one magic do-it-all program that can read/write any file type.

Similar Messages

  • How to display.xls, pdf, .doc files in UIImageView within a UIScrollView.

    Hi,
    I am new to iPhone programming. I need some help.
    I want to display .xls, pdf, .doc files in UIImageView within a UIScrollView programtically how can i do this. What is the procedure.
    Pls. provide me a sample application.
    If anyone knows pls. respond it would be of great help for me.
    Thanks in Advance,
    Regards,
    Sreelatha.

    Hi Sreelatha. The best example code for your purpose is the Scrolling sample app I referred to previously. The word Scrolling in that post is a link to the download page. I think that code will answer all your questions about how to init a UIImage, then use it to init a UIImageView, and then position the UIImageView frame in a UIScrollView. Two cases are demostrated: 1) Scrolling horizontally through a series of images; 2) Scrolling both H & V over a single image which is several times larger than the window.
    You might also be interested in the PageControl sample app in case you want to add a page control to your scroll view.
    Reading your last post again... I sure hope we've been discussing images (like jpegs?) in this thread. This isn't about reading and rendering the actual xls, pdf and doc files, is it?? Of course the iPhone handles html beautifully, so for example, an html representation of a doc file would play nicely. But in that case you'd want a UIWebView, not a UIImageView.

  • Inserting html or doc file in database

    Can I send an HTML or DOC file to Oracle database? The file houses text data along with some images and I'd like to send whole this file to database. Could anyone help me do this?
    Thanks

    Thanks...you are right, the html file contains references to images and I've been able to distinguish all images of the JEditorPane and send those to database. Now I need to send the text contens of JEditorPane to database. Problem is the text data can't be taken differently. If you do have any idea of tracing only the text contents, please let me know.

  • Downloading PDF DOC file in ADF

    Hi All,
    I am using Jdev 11.1.1.2.0
    My requirment is to Displaying the BLOB file like DOC and PDF in ADF UI. User can able to download it. I know there is already few post like this. I have gone through But is there any better way to display way to displaying on The UI.
    Please suggest

    Hi ,
    Sorry for lack of information
    I have gone through the blog
    http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/
    http://www.baigzeeshan.com/2010/08/uplaoding-and-downloading-images-in.html
    Problem I have is. How can i show the PDF or Doc file on the UI. ? In the above articles they mentioned about images and displayed They used af:image tag for embed the image.
    I am looking for some good ways of displaying the PDF or doc file on the UI which is stored in Database.

  • 1013 File Adpter pick .pdf, .doc files and make it available in Worklist

    Hi,
    I am using 10.1.3 version. I have a file adapter that polss on a directory and picks up any file dropped in the folder can doc, pdf. I have a Human Task that a user looks at a file and then APPROVE or REJECT or if possible make changes to a file too.
    Now how do I pick-up a file using File Adapter and make it available in Human Task (Worklist). I did look at DocumentReview Sample but it accepts some URL as a parameter but in my case I want to have a file i.e. pdf, doc etc. How can I handle this. Any help is appreciated.
    Thanks

    Hi Jasmin,
    I can add the converted document to PDF as a attachment to the XDP form in the workspace.
    I am strugling now with that envelope (the XDP), cant render it to PDF and than workspace enable it. I will have a look around the web because it will be there. One question is can I control permitions on the attachment? I want just read only permitions.
    Thanks Jasmin for your continuous help.
    J

  • Problem with reading text from .DOC files through java and POI

    I have used a jar file "poi-scratchpad-3.2-FINAL-20081019.jar" and "poi-3.2-FINAL.jar" to read text from a .DOC file. I used the "getParagraphText()" function of the class "org.apache.poi.hwpf.extractor.WordExtractor" to get the text.
    I am able to get the text in the .DOC file but along with that i am getting the following messages/warnings
    Current policy properties
    *     thread.thread_num_limited: true*
    *     file.write.state: disabled*
    *     net.connect_ex_dom_list:*
    *     mmc.sess_cab_act.block_unsigned: false*
    *     mmc.sess_cab_act.action: validate*
    *     mmc.sess_pe_act.block_blacklisted: false*
    *     mmc.sess_pe_act.block_invalid: true*
    *     jscan.sess_applet_act.stub_out_blocked_applet: true*
    *     file.destructive.in_list:*
    *     jscan.sess_applet_act.block_all: false*
    *     file.write.in_list:*
    *     file.nondestructive.in_list:*
    *     window.num_limited: true*
    *     file.read.state: disabled*
    *     jscan.session.origin_uri: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/poi/poi/3.2-FINAL/poi-3.2-FINAL.jar*
    *     file.nondestructive.state: disabled*
    *     jscan.session.user_ipaddr: 10.136.64.153*
    *     net.connect_other: false*
    *     thread.thread_num_max: 8*
    *     file.destructive.ex_list:*
    *     file.nondestructive.ex_list:*
    *     file.write.ex_list:*
    *     jscan.sess_applet_act.sig_invalid: block*
    *     file.read.in_list:*
    *     mmc.sess_cab_act.block_invalid: true*
    *     jscan.session.policyname: TU1DIERlZmF1bHQgUG9saWN5*
    *     mmc.sess_pe_act.action: validate*
    *     thread.threadgroup_create: false*
    *     net.connect_in_dom_list:*
    *     net.bind_enable: false*
    *     jscan.sess_applet_act.sig_trusted: pass*
    *     jscan.session.user_name: 10.166.64.201*
    *     jscan.session.user_hostname:*
    *     file.read.ex_list:*
    *     jscan.sess_applet_act.sig_blacklisted: block*
    *     jscan.session.daemon_protocol: http*
    *     net.connect_src: true*
    *     jscan.sess_applet_act.unsigned: instrument*
    *     mmc.sess_pe_act.block_unsigned: false*
    *     file.destructive.state: disabled*
    *     mmc.sess_cab_act.block_blacklisted: true*
    *     window.num_max: 5*
    Below the above messages/warnings the data is getting printed. Only the text part of the data is retrieved not the fonts, styles and bullets etc.
    Can anyone explain me why I am getting above warnings and how can I remove them. Is it possible to fetch the text depending on delimiters.
    Thanks in advance,
    Tiijnar
    Edited by: tiijnar on May 21, 2009 2:45 AM

    The jar files which were used are downloaded from http://jarfinder.com. Those jars created the problem of displaying those messages on console. I downloaded APIs from apache.org and used them in my application. Now my application is running good.
    Tiijnar

  • Unable to view pdf, doc files in nokia 7210 supern...

    Hi.....
    Iam using nokia 7210supernova mobile. I cannot open pdf and doc files..It shows "fomat not supported". So I have installed mobilepdf.jar and eZreader. But still the error persists. and whenever i try to open from these applications it shows error as "insufficeint resources to perform the operation" and "object not supported"
    What should i do to overcome this error... I have been trying from many days to solve it... Please help me...

    Try re-installing those two apps....and if problem persists then contact developers of those two apps and confirm that those two apps support nokia supernova 7210 or not

  • Problem in reading a PDF output file using URL and HttpURLConnection class

    When i am reading a PDF file generated from a given URL, I am getting the response code as 200 but the content length is -1. Can anyone tell me what will be the problem and solution to this.

    form the api of the URLConnection
    the content length of the resource that this connection's URL references, or -1 if the content length is not known.
    Can anyone tell me what will be the problem and solution to this.The problem is that the server does not send the content length.
    Solution is to read the whole stream until -1 is returned.
    andi

  • Which ipad can read a PDF doc

    Which is the least expensive ipad that can read a PDF drivers manual  & other things to my severely dyslexic child?  Can any of the older refurbished ipads dot that?
    Thank you for any input!!

    All iPads can open PDFs. There are many apps that will allow you to save PDFs to them, including Apple's iBooks app. As for reading them back to you, the iPad itself can do that as well, and, again, there are many apps that offer that feature, too.
    I would recommend getting an iPad 2 or newer as many apps aren't compatible with the iPad 1.
    ~Lyssa

  • Corrupt PDF & .DOC files

    I am currently running Outlook:Mac 2011 and have been running it for quite some time without too much problems.
    About two months ago I started noticing that attachments coming from various senders were being downloaded as per normal and upon opening them up an error would come up saying "The file "blahblah.pdf" could not be opened. It may be damaged
    or use a file format that Preview doesn't recognise."
    Now, the only email address that it effects is my @mac.com email account, all my other email addresses opens the exact same attachment without any problems when I forward the email from my @mac.com account to the other email address via my phone. Interestingly
    the exact same attachment that won't open on my mac opens on my iPhone.
    There has to be something wrong with Outlook to be doing this. I have tried rebuilding the database but this did nothing.
    I would be very appreciative for some help here as having to download the attachment on my phone to then forward it just to read it is terribly inefficient!

    Hi,
    This is the forum to discuss questions and feedback for Windows-based Microsoft Office client. Since your query is directly related to
    Office for mac, I would suggest you to post in the forum of
    Office for Mac, where you can get more experienced responses:
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011?tab=Threads
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Error when reading a pdf attachment file in sap inbox

    Hi all,
    I have created a RFC which sends mail from an external user to my sap inbox with attachment.
    the problem is with the PDF attachment where when i received the mail in my sap inbox in sbwp, it says that there is an error that it wasnt correctly decode.
    I used the class cl_document_bcs...
    and used the method add_attachment...
    would plz help me out

    this is my code
    FUNCTION ZMAIL_READ.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(SUBJECT) TYPE  SO_OBJ_DES
    *"     VALUE(TEXT) TYPE  STRING
    *"     VALUE(SENDER) TYPE  ADR6-SMTP_ADDR
    *"     VALUE(RECEIVER) TYPE  ADR6-SMTP_ADDR
    *"     VALUE(ATTACHMENTS) TYPE  Z_T_XATTACH OPTIONAL
    *"  EXPORTING
    *"     VALUE(MESSAGE) TYPE  STRING
    DATA: lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
          lo_bcs_send_request TYPE REF TO cl_bcs,
          l_send type ADR6-SMTP_ADDR ,
          l_rec type  ADR6-SMTP_ADDR .
    data: it_text type table of soli,
          wa_text type soli.
    DATA: lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
    DATA: lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
    DATA: lv_recipient_uid TYPE uname,
          lv_recipient_mail TYPE adr6-smtp_addr.
    data: lo_message type ref to cx_send_req_bcs value is initial,
          text_val type string.
    data: it_userlist type table of BAPIUSNAME,
          wa_userlist type BAPIUSNAME.
    data: it_selection_range type table of BAPIUSSRGE,
          wa_selection_range type BAPIUSSRGE.
    data: wa_attachment TYPE ZXATTACH,
          attachment_sub type SO_OBJ_DES.
    DATA: xstr type xstring,
          str TYPE string,
          str1 type string,
          it_str2 type table of soli,
          wa_STR2 TYPE SOLI.
    DATA: LOC_CONV TYPE REF TO CL_ABAP_CONV_IN_CE,
          wa_solix type solix,
          it_solix type table of solix,
          wa_soli type soli,
          it_soli type table of soli.
    data result TYPE boolean.
    data: i_ext(10) type c,
          i_type type soodk-objtp.
    wa_text-line = text.
    append wa_text to it_text.
    CLASS cl_bcs DEFINITION LOAD.
    try.
    lo_send_request = cl_bcs=>create_persistent( ).
    catch cx_send_req_bcs.
    endtry.
    * Message body and subject
    data: lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
    try.
    lo_document = cl_document_bcs=>create_document(
         i_type = 'RAW'
         i_text =  it_text
         i_subject = subject ).
    catch cx_send_req_bcs.
    catch cx_document_bcs.
    catch cx_address_bcs.
    endtry.
    loop at attachments into wa_attachment.
    attachment_sub = wa_attachment-file_name.
    it_str2 = wa_attachment-attach.
    loop at it_str2 into wa_str2.
      str1 = wa_str2-line.
    try.
    CALL FUNCTION 'SSFC_BASE64_DECODE'
      EXPORTING
        B64DATA                        = str1
    *   B64LENG                        =
    *   B_CHECK                        =
      IMPORTING
        BINDATA                        = xstr
    * EXCEPTIONS
    *   SSF_KRN_ERROR                  = 1
    *   SSF_KRN_NOOP                   = 2
    *   SSF_KRN_NOMEMORY               = 3
    *   SSF_KRN_OPINV                  = 4
    *   SSF_KRN_INPUT_DATA_ERROR       = 5
    *   SSF_KRN_INVALID_PAR            = 6
    *   SSF_KRN_INVALID_PARLEN         = 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.
    catch cx_sy_dyn_call_illegal_type.
    endtry.
    CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
          EXPORTING
            INPUT       = xstr
            ENCODING    = 'UTF-8'
    *        REPLACEMENT = '?'
    *        IGNORE_CERR = ABAP_TRUE
          RECEIVING
            CONV        = loc_CONV.
    TRY.
        CALL METHOD LOC_CONV->READ
          IMPORTING
            DATA = STR.
    CATCH CX_SY_CONVERSION_CODEPAGE.
    CATCH CX_SY_CODEPAGE_CONVERTER_INIT.
    CATCH CX_PARAMETER_INVALID_TYPE.
    CATCH CX_PARAMETER_INVALID_RANGE.
    ENDTRY.
    wa_solix-line = xstr.
    append wa_solix to it_solix.
    wa_soli-line = str.
    append wa_soli to it_soli.
    endloop.
    try.
    CALL FUNCTION 'SA_KW_RFC_FILENAME_EXT_GET'
      EXPORTING
       AREA            = 'IWBSOLAR'
        MIMETYPE        = wa_attachment-type
    IMPORTING
       EXTENSION       = i_ext
    catch cx_sy_dyn_call_illegal_type.
    endtry.
    i_type = i_ext.
    if i_ext <> 'pdf'.
    try.
      lo_document->add_attachment(
      EXPORTING
        i_attachment_type = i_type
        i_attachment_subject = attachment_sub
        i_att_content_hex = it_solix ).
           CATCH cx_document_bcs.
    endtry.
    clear wa_solix.
    refresh it_solix.
    else.
    TRY.
      CALL METHOD LO_DOCUMENT->ADD_ATTACHMENT
        EXPORTING
          I_ATTACHMENT_TYPE     = i_type
          I_ATTACHMENT_SUBJECT  = attachment_sub
    *      I_ATTACHMENT_SIZE     =
    *      I_ATTACHMENT_LANGUAGE = SPACE
          I_ATT_CONTENT_TEXT    = it_soli
    *      I_ATT_CONTENT_HEX     =
    *      I_ATTACHMENT_HEADER   =
       CATCH CX_DOCUMENT_BCS .
      ENDTRY.
    ENDIF.
    endloop.
    try.
    lo_send_request->set_document( lo_document ).
    CATCH cx_send_req_bcs.
    endtry.
    wa_selection_range-PARAMETER = 'address'.
    wa_selection_range-field = 'e_mail'.
    wa_selection_range-sign = 'I'.
    wa_selection_range-option = 'EQ'.
    wa_selection_range-low = receiver.
    append wa_selection_range to it_selection_range.
    try.
    CALL FUNCTION 'BAPI_USER_GETLIST'
    * EXPORTING
    *   MAX_ROWS              = 0
    *   WITH_USERNAME         = ' '
    * IMPORTING
    *   ROWS                  =
    TABLES
        SELECTION_RANGE       = it_selection_range
    *   SELECTION_EXP         =
        USERLIST              = it_userlist
    *   RETURN                =
    catch cx_sy_dyn_call_illegal_type.
    endtry.
    read table it_userlist into wa_userlist index 1.
    try.
      lo_sender = cl_cam_address_bcs=>create_internet_address( sender ).
      lo_send_request->set_sender(
         EXPORTING
         i_sender = lo_sender ).
    catch cx_send_req_bcs.
    catch cx_document_bcs.
    catch cx_address_bcs.
      return.
    endtry.
    try.
        lo_recipient = cl_sapuser_bcs=>create( wa_userlist-USERNAME ).
        lo_send_request->add_recipient(
           EXPORTING
             i_recipient = lo_recipient ).
    *         i_express = 'X' ).
      catch cx_send_req_bcs.
      catch cx_document_bcs.
      catch cx_address_bcs.
    endtry.
    try.
    ** Send email
         LO_SEND_REQUEST->SET_SEND_IMMEDIATELY( 'X' ).
         lo_send_request->send( EXPORTING
         i_with_error_screen = ' '
         RECEIVING
         result = result ).
         COMMIT WORK.
    CATCH CX_DOCUMENT_BCS.
    CATCH CX_SEND_REQ_BCS INTO lo_message.
    CATCH CX_ADDRESS_BCS.
    text_val = lo_message->IF_MESSAGE~GET_TEXT( ).
    endtry.
    if result = 'X'.
      message = 'E-Mail sent'.
    else.
      message = 'E-Mail not sent'.
    endif.
    ENDFUNCTION.

  • How to attach a PDF / DOC file to quotation and refer to subsequent docmnt.

    Dear all,
    How can we attach a PDF or Word Document to Quotation Header and make it flow to Sales Order, Purchase Requisition generated from Sales order, Purchase Order, Outbound Delivery and Invoice documents.
    I can attach document at header by assigning a parameter value in User Profile (SU3). But it is not flowing down to Sales order and other documents.
    Your suggestions are most awaited and will be highly appreciated
    Thank you
    Raghu Ram

    Is there a way we can have the 'services for objects' icon show up in transactions such as VK11 and VK12. I have written to OSS and I am waiting for their response. Just trying all avenues for answer.
    Transactions VD01/VA01.... are all fine. But it is pricing master that is missing the ICON. The parameter id is set to SD_SWU_ACTIVE.

  • Some pdf & doc won't download... tried fixes under 'FF keeps opening many tabs or windows' but none worked... these files open in Safari & Google Chrome.

    Some pdf & doc files won't download. The "You Have Chosen to Open" pop-up appears but when I hit 'Save File", it goes away and the file is not saved. The corrupted files show up in mac download file as .part but don't show up in ff download file. Tried suggestions in "Firefox keeps opening many tabs or windows" on this website but none worked.

    This is most likely Firefox's new "built in" PDF Viewer giving you the trouble.
    First, in Firefox, type "about:config" (minus the quotes) in the address bar. This will open the Firefox configuration file. You'll see a warning. Click that you'll be careful, and open the configurer.
    At the top there is a search bar. Type "js" (again, minus the quotes).
    In the list of results you'll see pdfjsdisabled with a value of "false". Right click it and select Toggle to make it read "true".
    Click Firefox>Preferences and under the Applications tab, scroll down to Adobe Acrobat Document. Click the drop down on the right side and choose "Use Adobe Reader (default)".
    That should take care of it for you.

  • I can't read - open my excel and doc files ?

    since I have installed the Lion I can't read my excel , doc files ?? format is not supported anymore .. I hope it is not just a joke .

    Hi
    Perhaps the document you need to open requires a higher version of Office. If you need a good software,
    do what BigGee said, download OpenOffice at OpenOffice.org.
    Thanks
    -Mac FX

  • Business Subscription Based Website with PDF/.doc downloads

    I'm new to the Apple world and LOVE IT! I am beginning the design of a business website and trying to use iWeb. I'm not sure it will support two critical functions: 1) subscription based service - I saw the topics of using PayPal for retail but what if the readers are paid subscribers with automated monthly draft fee. individual login/passwords will be required. recommendations? 2) Subscribers will view pdf/.doc files and then download to their own computers. I saw two postings indicating concerns about document sizes. We are a research based company and our analysis what the members are buying, thus, they may be downloading several large documents weekly. We anticipate ultimately 2000-5000 subscribers. Yup, the range is pretty large because we need to prove ourself. We estimate starting with 100 but hitting 2000 within 6 months. If business takes off, we may need to go to a traditional website developer but proof-of-concept is needed for additional funding.
    Do you recommend MobileME for this volume? We were planning on a traditional hosting company. Thanks!

    MobileMe would be no use for this as it doesn't have the ability to run scripts.
    Host Excellence, who I host with, can do all this kind of stuff and also have built in ECommerce...
    http://www.iwebforbusiness.com/Tools-Resources/Website-Hosting.html
    In the long run, if you are anticipating any kind of volume sales, you may want to look at the services of companies who specialize in the sale and delivery of digital media....
    http://www.esellerate.net/solutions
    http://www.kagi.com/kagisolutions/digital.php
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

Maybe you are looking for

  • Oracle Apps Technical or Financial

    Hi, I m working as core DBA since 1 year. now i want to switch to Apps DBA field. But i m confused that oracle are giving many Apps DBA trainings like - 11i install, patch, monitor - Oracle Apps Technical - Oracle Apps Financial. As i m new in apps d

  • Accessing LOV available via methods throws No Such Property error

    I am using select <af:selectOneChoice> compoent (Same issue with other components too) with LOV from Model Driven data available in the following structure Model(created as Data Control) -> findPD1(String s1, String s2) -> PD1(object of class PD1) ->

  • Consistant Acrobat Reader Update Problems

    Why the hell can't adobe produce an acrobat reader update that doesn't feel the need to drop an icon on the desktop if it does not find one there? This apparent need to mark you territory is highly annoying. Or can't you figure out how to disable it

  • Level 2 Tabs - Buggy or is it just me?

    I'm on 1.6. I've been trying to successfully create a 2 level tab application. I am using the default "Business Look" template although I've tried switching themes to try and get this to work to no avail. Even though I set the application default pag

  • How to end a procedure immediately

    How to end a procedure immediately before it is ended normally when some exceptions that I can't anticipate occur.