Error in opening PDF.

Hello Experts,
I have created one smartforms which containt some terms and condition which i want to send as a pdf to set of people. Now i am able to send the smartform as PDF . But when i am trying to open the PDF its shows me some error like 'PDF file is currupt'.
I search in SDN and try every option but i dont know where is my mistake . I  am attaching my code , please have a look into it and suggest .
Thanks In Advance.
Satya
*& Report  Z_PDF_FORM
REPORT  Z_PDF_FORM.
"tables : YTCPG.
DATA: "it_otf TYPE STANDARD TABLE OF YTCPG,
it_docs TYPE STANDARD TABLE OF docs,
it_lines TYPE STANDARD TABLE OF tline,
st_job_output_info TYPE ssfcrescl,
st_document_output_info TYPE ssfcrespd,
st_job_output_options TYPE ssfcresop,
st_output_options TYPE ssfcompop,
st_control_parameters TYPE ssfctrlop,
v_len_in TYPE so_obj_len,
v_language TYPE sflangu VALUE 'E',
v_e_devtype TYPE rspoptype,
v_bin_filesize TYPE i,
v_name TYPE string,
v_path TYPE string,
v_fullpath TYPE string,
v_filter TYPE string,
v_uact TYPE i,
v_guiobj TYPE REF TO cl_gui_frontend_services,
v_filename TYPE string,
v_fm_name TYPE rs38l_fnam.
data: T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
w_doc_data type SODOCCHGI1,
ld_sender_address type SOEXTRECI1-RECEIVER,
ld_sender_address_type type SOEXTRECI1-ADR_TYP,
w_sent_all type SONV-FLAG,
t_packing_list like SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
t_attachment like SOLISTI1 OCCURS 0 WITH HEADER LINE,
it_message like SOLISTI1 OCCURS 0 WITH HEADER LINE.
*t_receivers like SOMLRECI1.
CONSTANTS c_formname TYPE tdsfname VALUE 'ZTEST'.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
  EXPORTING
    i_language    = v_language
    i_application = 'SAPDEFAULT'
  IMPORTING
    e_devtype     = v_e_devtype.
st_output_options-tdprinter = v_e_devtype.
*st_output_options-tdprinter = 'locl'.
st_control_parameters-no_dialog = 'X'.
st_control_parameters-getotf = 'X'.
**.................GET SMARTFORM FUNCTION MODULE NAME.................
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = 'Y_TC_PGOODS'
  IMPORTING
    fm_name            = v_fm_name
  EXCEPTIONS
    no_form            = 1
    no_function_module = 2
    OTHERS             = 3.
IF sy-subrc NE 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
**...........................CALL SMARTFORM............................
CALL FUNCTION v_fm_name
  EXPORTING
    control_parameters   = st_control_parameters
    output_options       = st_output_options
  IMPORTING
    document_output_info = st_document_output_info
    job_output_info      = st_job_output_info
    job_output_options   = st_job_output_options
  EXCEPTIONS
    formatting_error     = 1
    internal_error       = 2
    send_error           = 3
    user_canceled        = 4
    OTHERS               = 5.
IF sy-subrc NE 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
***.........................CONVERT TO OTF TO PDF.......................
  CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
      bin_filesize           = v_bin_filesize
    TABLES
      otf                    = st_job_output_info-otfdata
      doctab_archive         = it_docs
      lines                  = it_lines
    EXCEPTIONS
      err_conv_not_possible  = 1
      err_otf_mc_noendmarker = 2
      OTHERS                 = 3.
  IF sy-subrc NE  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
*2. Sending PDF as mail.
w_doc_data-obj_name  = 'MAIL_TO_HEAD'.
w_doc_data-obj_descr = 'Terms And Condition'.
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num   = 1.
t_packing_list-body_start = 1.
t_packing_list-doc_type   = 'PDF'.
t_packing_list-obj_descr  = 'PDF Attachment'.
t_packing_list-obj_name   = 'PDF_ATTACHMENT'.
APPEND t_packing_list .
*CLEAR  w_packing_list.
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = 'mailID.
t_receivers-rec_type = 'B'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
  EXPORTING
    document_data              = w_doc_data
    put_in_outbox              = 'X'
    sender_address             = ld_sender_address
    sender_address_type        = ld_sender_address_type
    commit_work                = 'X'
  IMPORTING
    sent_to_all                = w_sent_all
  TABLES
    packing_list               = t_packing_list
    contents_bin               = t_attachment
    contents_txt               = it_message
    receivers                  = t_receivers
  EXCEPTIONS
    too_many_receivers         = 1
    document_not_sent          = 2
    document_type_not_exist    = 3
    operation_no_authorization = 4
    parameter_error            = 5
    x_error                    = 6
    enqueue_error              = 7
    OTHERS                     = 8.
*IF sy-subrc = 0 .
*  MESSAGE 'Mail has been Successfully Sent.' .
*ENDIF.
Edited by: satya pujahari on Oct 29, 2010 3:29 PM

Clsoing Thread.

Similar Messages

  • Error while Opening PDF attachment from Mail

    Hi,
    We two Output Types created ZNEU and ZAUF. Two Smartforms are created for the same Output Types. The Issue now is, When ZNEU triggers and send a mail the document is properly decoded and gets opened but for ZAUF it doesn't. It says File damaged.
    This is the code we have used for sending mail.
    CONSTANTS:
              co_pdf(3) TYPE c VALUE 'PDF',
              co_raw(3) TYPE c VALUE 'RAW'.
      DATA:
            it_objbin TYPE STANDARD TABLE OF solisti1,
            wa_objbin TYPE solisti1.
      DATA:
             lv_filesize TYPE i.
      DATA:
            it_lines TYPE STANDARD TABLE OF tline.
      DATA:
            wa_mail_body TYPE solisti1,
            wa_receipients TYPE somlreci1.
      DATA:
           document           TYPE REF TO cl_document_bcs,
           content            TYPE solix_tab,
           wa_content         TYPE solix,
           send_request       TYPE REF TO cl_bcs,
           sender             TYPE REF TO if_sender_bcs,
           recipient          TYPE REF TO if_recipient_bcs,
           requested_status   TYPE REF TO bcs_rqst,
           status_mail        TYPE bcs_stml,
           bcs_exception      TYPE REF TO cx_bcs,
           lv_rec             TYPE adr6-smtp_addr.
      DATA:
             wa_attachx TYPE solix,
             l_pdf_len TYPE i,
             l_con_len TYPE i,
             l_pdf_pos TYPE i,
             l_con_pos TYPE i.
      FIELD-SYMBOLS: <fs_con> TYPE x.
      CLASS cl_cam_address_bcs     DEFINITION LOAD.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
    * Get the PDF version of the OTF
      CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         format                      = 'PDF'
       IMPORTING
         bin_filesize                = lv_filesize
        TABLES
          otf                         = job_output_info-otfdata
          lines                       = it_lines
       EXCEPTIONS
         err_max_linewidth           = 1
         err_format                  = 2
         err_conv_not_possible       = 3
         err_bad_otf                 = 4
         OTHERS                      = 5.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Convert the PDF format to the table type required for the attachment.
      CALL FUNCTION 'QCE1_CONVERT'
        TABLES
          t_source_tab         = it_lines
          t_target_tab         = it_objbin
        EXCEPTIONS
          convert_not_possible = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Convert the data which is in text to binary
      l_con_pos = 0.
      DESCRIBE FIELD wa_objbin LENGTH l_pdf_len IN BYTE MODE.
      DESCRIBE FIELD wa_attachx LENGTH l_con_len IN BYTE MODE.
      LOOP AT it_objbin INTO wa_objbin.
        ASSIGN wa_objbin TO <fs_con> CASTING.
        CHECK sy-subrc EQ 0.
        DO l_pdf_len TIMES.
          l_pdf_pos = sy-index - 1.
          IF l_con_pos = l_con_len.
            APPEND wa_attachx TO content.
            FREE wa_attachx.
            l_con_pos = 0.
          ENDIF.
          MOVE <fs_con>+l_pdf_pos(1) TO wa_attachx-line+l_con_pos(1).
          ADD 1 TO l_con_pos.
        ENDDO.
      ENDLOOP.
      IF l_con_pos > 0.
        APPEND wa_attachx TO content.
      ENDIF.
      TRY .
    *     -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document with attachment ---------------
    *     create document from internal table with text
          document = cl_document_bcs=>create_document(
                        i_type    = 'RAW'
                        i_text    = mail_body_tab
                        i_subject = email_subject ).
    *     add attachment to document
          CALL METHOD document->add_attachment
            EXPORTING
              i_attachment_type    = 'PDF'
              i_attachment_subject = attachment_name
              i_att_content_hex    = content.
    *     add document to send request
          CALL METHOD send_request->set_document( document ).
    *    Set sender
          sender = cl_cam_address_bcs=>create_internet_address( sender_id ).
          CALL METHOD send_request->set_sender
            EXPORTING
              i_sender = sender.
    *     Receipients
          LOOP AT receipients_tab INTO wa_receipients .
            lv_rec = wa_receipients-receiver.
            recipient = cl_cam_address_bcs=>create_internet_address( lv_rec ).
    *       Add recipient with its respective attributes to send request
            CALL METHOD send_request->add_recipient
              EXPORTING
                i_recipient = recipient.
          ENDLOOP.
    * Set that you don't need a Return Status E-mail
          status_mail = 'N'.
          CALL METHOD send_request->set_status_attributes
            EXPORTING
              i_requested_status = 'N'
              i_status_mail      = status_mail.
    * set send immediately flag
          send_request->set_send_immediately( 'X' ).
    * Send document
          CALL METHOD send_request->send( ).
    *      COMMIT WORK.
        CATCH cx_bcs INTO bcs_exception.
          RAISE EXCEPTION bcs_exception.
    ENDTRY.
    This is in a Class which is been used in the print program for both the Output Types.
    Can somebody throw light upon this.
    Note: I tried using
    but it is not working properly.
    Thanks,
    Prashanth
    Edited by: Prashanth KR on Jan 5, 2010 6:20 AM

    Hi,
    Please paste the part of code where you are getting error.
    And if you are not clear about where the error is, try searching sdn or google with the error message that you are getting as this issue has been discussed many times earlier.
    Check this link.
    Error while opening PDF in mail attachment
    Hope it helps.
    Regards,
    Raj

  • After Downloading, Error while opening PDF  : PDF has no pages

    After Downloading, Error while opening PDF  : PDF has no pages
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = L_SPOOLNO
          NO_DIALOG                = SPACE
          DST_DEVICE               = MSTR_PRINT_PARMS-PDEST
        IMPORTING
          PDF_BYTECOUNT            = MI_BYTECOUNT
        TABLES
          PDF                      = MTAB_PDF
        EXCEPTIONS
          ERR_NO_ABAP_SPOOLJOB     = 1
          ERR_NO_SPOOLJOB          = 2
          ERR_NO_PERMISSION        = 3
          ERR_CONV_NOT_POSSIBLE    = 4
          ERR_BAD_DESTDEVICE       = 5
          USER_CANCELLED           = 6
          ERR_SPOOLERROR           = 7
          ERR_TEMSEERROR           = 8
          ERR_BTCJOB_OPEN_FAILED   = 9
    Thanks in advance
    Monika
          ERR_BTCJOB_SUBMIT_FAILED = 10
          ERR_BTCJOB_CLOSE_FAILED  = 11
          OTHERS                   = 12.
    Transfer the 132-long strings to 255-long strings
    LOOP AT MTAB_PDF.
    TRANSLATE MTAB_PDF USING '~'.
    CONCATENATE WA_BUFFER MTAB_PDF INTO WA_BUFFER.
    ENDLOOP.
    TRANSLATE WA_BUFFER USING '~'.
    DO.
    it_attach = WA_BUFFER.
    APPEND it_attach.
    SHIFT WA_BUFFER LEFT BY 255 PLACES.
    IF WA_BUFFER IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    ****GET THE FILE NAME TO STORE....................
    v_path = 'C:\PD Form\' .
    CONCATENATE v_path p_pernr-low '.pdf' into v_name.
        create object v_guiobj.
        call method v_guiobj->file_save_dialog
          EXPORTING
            default_extension = 'pdf'
            default_file_name = v_name
            file_filter       = v_filter
          CHANGING
            filename          = v_name
            path              = v_path
            fullpath          = v_fullpath
            user_action       = v_uact.
        if v_uact = v_guiobj->action_cancel.
          leave to current transaction.
        endif.
    ..................................DOWNLOAD AS FILE....................
        move v_fullpath to v_filename.
        call function 'GUI_DOWNLOAD'
          EXPORTING
            bin_filesize            = MI_BYTECOUNT
            filename                = v_filename
            filetype                = 'BIN'
          TABLES
            data_tab                = it_ATTACH
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            others                  = 22.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

    My Generated Spool request is PDF Spool. It contains Adobe Forms data. To Download Adobe form
                 Spool (PDF Spool) into PDF format,
    First,
    A)     Read PDF Spool data by using u2018FPCOMP_CREATE_PDF_FROM_SPOOLu2019 Function module.
    B)     Assign the Output Data to XSTRING format
    C)     Convert that XSTRING data to Binary Format using 'SCMS_XSTRING_TO_BINARY' Function module.
    D)     Save File on Application server using OPEN DATASET , TRANSFER , CLOSE DATASET.You can see your
                          downloaded file in Transaction AL11 in specified directory.
    You can save your file on Presentation server also using GUI_DOWNLOAD.
    First three steps are necessary if your spool is PDF Spool.
    Basically we need this when we are downloading Adodbe forms ( which is not a SAPScript or smartforms)
    Example :
    DATA :
      e_pdf1 TYPE  fpcontent,
      e_renderpagecount1  TYPE i.
      CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
        EXPORTING
          i_spoolid               = l_spoolno
          i_partnum               = '1'
       IMPORTING
         e_pdf                   = e_pdf1
         e_renderpagecount       = e_renderpagecount1
    *   E_PDF_FILE              = E_PDF_FILE1
    * EXCEPTIONS
    *   ADS_ERROR               = 1
    *   USAGE_ERROR             = 2
    *   SYSTEM_ERROR            = 3
    *   INTERNAL_ERROR          = 4
    *   OTHERS                  = 5
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DATA : buffer  TYPE  xstring,
      append_to_table  TYPE  c.
      DATA : output_length TYPE  i.
      TYPES : BEGIN OF ty_binary,
                binary_field(1000) TYPE c,
              END OF ty_binary.
      DATA : lt_binary TYPE TABLE OF ty_binary WITH HEADER LINE.
      DATA : lv_xstring TYPE xstring.
      lv_xstring = e_pdf1.
    * Convert xstring to binary.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer                = lv_xstring
         append_to_table       = ' '
    * IMPORTING
    *   OUTPUT_LENGTH         =
        TABLES
          binary_tab            = lt_binary.
      DATA : wa_binary LIKE lt_binary.
      DATA: BEGIN OF itab OCCURS 0,
      field(256),
      END OF itab.
      DATA: dsn(50000) VALUE '/usr/sap/tmp/',
      length LIKE sy-tabix,
      lengthn LIKE sy-tabix.
      CONCATENATE '/usr/sap/tmp/' lv_pernr '.pdf' INTO dsn.
    ******* Save file on Application server
      OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.
      LOOP AT lt_binary.
        TRANSFER lt_binary-binary_field TO dsn.
      ENDLOOP.
      CLOSE DATASET dsn.
      CLEAR lt_binary.
      REFRESH lt_binary.
    cheers

  • Error while opening .PDF files in document library sharepoint 2013

    Hi
    I am getting an error while opening a .pdf file,
    Please help me find the solution.
    Thanks
    Paru

    Launch IE -> Click on Gear (settings) -> Manage Add-ons -> Show: All Add-ons ->
    There are 2 Adobe Add-ons:
    Adobe PDF Reader  &  Adobe Acrobat Sharepoint Open Document
    Double-click both and be sure to click the button "ALLOW ON ALL SITES"
    (An * will appear in the field)
     http://crowdsupport.telstra.com.au/t5/T-Suite-Applications/There-was-an-error-opening-this-document-The-filename-directory/td-p/197425
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/ae2eea40-9fa6-46be-bca1-ac5eb5597d5e/sharepoint-2010-adobe-reader-error-opening-pdf-files?forum=sharepointgeneralprevious
    http://community.office365.com/en-us/f/154/t/46204.aspx?PageIndex=2
    disable the Mcafee Firewall Plug In.  This is after of course I ran superantispyware to remove some malware.  uninstalled and reinstalled the Adobe Reade
    https://forums.adobe.com/message/1776202?tstart=0

  • Error in opening PDF generated through HAP_DOCUMENT(ESS/MSS)

    Hi Experts,
    User is getting an error while opening the PDF generated through "Print" functionality of appraisal document(HAP_Document).
    There is a problem i'am facing in this BSP's,when i click on PRINT after creating Appraisal,it will ask me to either open or save in pdf.
    But when i open or save it and open it is giving me this message in Adobe
    "Acrobat could not open u2018webforms.pdfu2019 because it is either not a supported file type or because the file has been corrupted (for example, it was sent as an email attachment and wasnu2019t correctly decoded).
    To create an Adobe PDF document, go to the source application. Then print the document to Adobe PDF."
    Any body please guide me with a solution.
    With Regards,
    Surender Dahiya

    Hello Surender,
    there may have been connection problems to your content repository when you tried to view this file. I would also recommend that you apply the latest version of the Acrobat Reader. I would recommend that you run a
    trace on the RFC destination to your archive and see what errors are reported when this error occurs again.
    Best Regards,
    Deepak..

  • Error while opening PDF in mail attachment

    Hi All,
    In smartform i am sending a mail with attachemnt as PDF file,there is one more option like preview of smartform .
    issue is like i am able to see the preview of the same record but when it is sent in mail attachement,and while opening PDF its showing error that file can not be open it is corrupted.
    Please help.
    Mona Singh.

    Dear Sandra
    That was my problem: binary data was incorrectly converted (often because of Unicode systems).
    I returned
            bin_filesize          = v_len_in
            bin_file              = l_binfile
    from the function module CONVERT_OTF, then converted the xstring data (l_binfile) into an internal table (t_objbin) to send to the mail send function with the following function module:
        CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            buffer        = l_binfile
          IMPORTING
            output_length = v_lines_bin
          TABLES
            binary_tab    = t_objbin.
    Many thanks for your help.
    Best regards
    Patricia

  • Getting error while opening pdf on server

    Dear All,
    I am working on jdeveloper 11.1.1.4.0.
    I have a use case where on click of link , generating a dynamic pdf. The pdf i am arranging with the help of itext through backing bean. It is generating as well downloading the pdf.I have used filedownloadlistner to call the generate and download pdf methods.
    On integrated weblogic server the pdf is working fine, but when i deploy on server while opening pdf getting error :
    *"Adobe Reader could not open 'test.pdf' beacause it is either not a supported file type*
    *or because the file has been damaged (for example, it was sent as an email attachment and*
    *wasn't correctly decoded)."*
    I am not able to get the root cause for the problem. The sample code to generate and download pdf is :
    // Generate PDF
    private void generatePDFFile(FacesContext facesContext,
    java.io.OutputStream outputStream) {
    try {
    System.out.println("In Generate PDF................");
    Document document = new Document(PageSize.A4);
    PdfWriter.getInstance(document, new FileOutputStream(FILE));
    document.open();
    addMetaData(document);
    addTitlePage(document);
    document.close();
    System.out.println("End of PDF......................");
    facesContext = facesContext.getCurrentInstance();
    ServletContext context = (ServletContext)facesContext.getExternalContext().getContext();
    System.out.println(context.getRealPath("/"));
    String FILE = "test.pdf";
    File file = new File(FILE);
    FileInputStream fdownload;
    //BufferedInputStream bis;
    byte[] b;
    System.out.println(file.getCanonicalPath());
    System.out.println(file.getAbsolutePath());
    fdownload = new FileInputStream(file);
    int n;
    while ((n = fdownload.available()) > 0) {
    b = new byte[n];
    int result = fdownload.read(b);
    outputStream.write(b, 0, b.length);
    if (result == -1)
    break;
    outputStream.flush();
    } catch (Exception e) {
    e.printStackTrace();
    Download PDF
    private void downloadPDF(FacesContext facesContext, java.io.OutputStream outputStream) {
    try {
    facesContext = facesContext.getCurrentInstance();
    ServletContext context = (ServletContext)facesContext.getExternalContext().getContext();
    ExternalContext ctx = facesContext.getExternalContext();
    HttpServletResponse res = (HttpServletResponse)ctx.getResponse();
    res.setContentType("application/pdf");
    outputStream = res.getOutputStream();
    System.out.println(context.getRealPath("/"));
    File file = new File(FILE); // FILE = 'test.pdf'
    FileInputStream fdownload;
    // BufferedInputStream bis;
    byte[] b;
    fdownload = new FileInputStream(file);
    //bis = new BufferedInputStream (new FileInputStream(file));
    int n;
    while ((n = fdownload.available()) > 0) {
    b = new byte[n];
    int result = fdownload.read(b);
    //outputStream.write(b, 0, b.length);
    outputStream.write(b, 0, b.length);
    if (result == -1)
    break;
    outputStream.flush();
    outputStream.close();
    fdownload.close();
    } catch (Exception e) {
    e.printStackTrace();
    Any help will be appreciated.
    Thanks
    Kanika

    If the pdf file don't open on the server where you created them, they won't open on the client side either.
    The code you are using should be refactored to use different file names for the generated files. In a multi user environment (which every web application is) you overwrite the file generated with each new request, even before the file is loaded by a client. This will corrupt the file a client is loading and you get the error you see.
    Next I would look into org.apache.commons.io package (http://commons.apache.org/io/) which has utility classes which allows easy handling of streams without looping over the data.
    Timo

  • Error when opening PDF files from SAP.

    Hi Gurus
    I have posted this question in ABAP Development section also. Please read the below text.
    We are having a strange intermittent problem with Adobe Reader. When we try to open PDF files from SAP Frontend we get an error pop-up. The pop-up does not have any text. The title of the pop-up has "Adobe Reader". There is a blue question mark and an OK button.
    This issue occurs few times a day in Windows Vista.
    This issue does not occur in Windows XP.
    Since past few weeks, we have been trying to find some error/warning/atleast some text in log files of SAP, OS, Adobe Reader, Registry entries, Event Viewer. So far, we have not found anything.
    SAP is not able to help as this issue occurs intermittently and said when they tried, the issue did not occur. They made two attempts and in each attempt they tried 10 times to reproduce the issue. This issue occurs intermittently.
    Environment
    SAP R/3 4.7 EE SAP_Basis 620 Support Package 61
    Windows Vista Enterprise
    Adobe Reader 9.0 and Adobe Reader 9.1 (tried with both versions)
    SAPGUI 710 Patch 12 (latest patch). It also occured in Patch 11.
    Please suggest
    Thank you
    Pavan

    Now I got to capture the screenshot, however not able to attach/upload here but it says:
    'Reading Untagged Documents'
    lets say i tried to open 6 page document then it said:
    'This 6-page document is untagged and must be prepared for reading. While the document is being
    analyzed, your assistive technology will not be able to interact with this application. '
    then it asked for Reading options
    then a checkbox for to confirm 'Always use the settings from the Reading Preferences (Do not show this dialog again)
    then 'OK/START' and 'cancel' buttons
    It seems, this is the problem with Adobe w.r.t Vista.
    thanks
    Bhudev

  • Strange error while opening pdf in Firefox

    Hi there,
    I have a strange problem with Acrobat 9 on Windows 7 64bit. When I click on a PDF file on websites, a white site opens and I get an Acrobat message, which is totally empty.
    In the error box there is just a question mark on a blue circle, an "OK"-button and the title line says "Adobe Acrobat". The PDF files won't open.
    That is something I have never had yet! When I choose "repair installation" from the Acrobat help menu - it works and I can open PDF files n the Firefox 3.5.5 browser - but about half an hour later I get the same error message again.
    Any ideas?
    Thank you!

    Header 1
    Header 2
    Problem is on my end … I’m running on windows 2008r2 server  which has a computability problem with Acrobat Reader on client side ..Adobe is working out a fix….i wuill be switch back to the old server late today which should cure the problem If you wish to see the tech side of it Here's the official word on what the problem is, from MS tech support: In IIS7.5 we have implemented an optimization code that handles especially byte-ranges request whose result is a single range as follows. When a client makes a request of byte-ranges whose result is a single range, IIS 7.5 does not include the media type in the response! This seems to break Adobe-reader add-on in IE. In IIS7 and below we treated byte-ranges requests whose result is a single range the same manner as byte-ranges requests whose result is NOT a single range meaning that we all the time sent a media type in the response header. Example: The below request: Command: GET   + URI: /test.pdf   ProtocolVersion: HTTP/1.1   Accept:  */*   Range: bytes=153572-186237, 748935-750373, 748238-748934, 186238-411153, 750374-750792, 411154-486125, 486126-748237 … … Is equivalent to making a request to range 153572 - 750792 IIS7 will respond with - Http: Response, HTTP/1.1, Status Code = 206, URL: /test.pdf   ProtocolVersion: HTTP/1.1   StatusCode: 206, Partial content   Reason: Partial Content   ContentType: multipart/byteranges; boundary= … … IIS 7.5 will respond with   ProtocolVersion: HTTP/1.1   StatusCode: 206, Partial content   Reason: Partial Content   ContentType: application/pdf … … So in the case of IIS7.5, it is just like we are responding to a single range request “153572 - 750792 “  in which the HTTP RFC says that you should NOT send a media type in the response header! The IIS 7 and IIS7.5 behavior are both HTTP RFC compliant   A response to a request for a single range MUST NOT be sent using the   multipart/byteranges media type.  A response to a request for   multiple ranges, whose result is a single range, MAY be sent as a   multipart/byteranges media type with one part. A client that cannot   decode a multipart/byteranges message MUST NOT ask for multiple   byte-ranges in a single request. Adobe was finally able to recreate the problem on Friday, and they are supposed to be working on it.  (I don't know what their issue was with not being able to recreate it, but I did find out over the weekend that the behavior is different if the client you are using to browse the website is in a remote desktop session - everything seems to work fine.) Not sure what IIS Core team is doing, if anything.  Even if Adobe provides a patch, I'm not too sure about using 2008 r2 as public web server if it requires the client to have the latest and greatest plugin.  Microsoft may have the letter of the law on their side regards the RFC, but sometimes being right just isn't enough.

  • Rusty Solomon : Adobe Reader Error while opening pdf files

    Hello everyone,
    I have a systematic error opening PDF files with Adobe Reader X (10.1.1)
    "Adobe Reader has encountered a problem and needs to close. Please excuse us for the inconvenience."
    By waiting I installed Foxit but I would understand.
    I uninstalled Adobe and reinstalled but it's still the same.
    Thank you for your answers in advance
    Rusty Solomon

    First I would try to update to 11.1.8.
    If that does not fix it, tell us your operating system.

  • Strange question mark error while opening pdf files in adobereader from SAP

    Hi Gurus
    We are having a strange intermittent problem with Adobe Reader. When we try to open PDF files from SAP Frontend we get an error pop-up. The pop-up does not have any text. The title of the pop-up has "Adobe Reader". There is a blue question mark and an OK button.
    This issue occurs few times a day
    This issue does not occur in Windows XP.
    Since past few weeks, we have been trying to find some error/warning/atleast some text in log files of SAP, OS, Adobe Reader, Registry entries, Event Viewer. So far, we have not found anything.
    SAP is not able to help as this issue occurs intermittently and said when they tried, the issue did not occur. They made two attempts and in each attempt they tried 10 times to reproduce the issue. This issue occurs intermittently.
    Environment
    SAP R/3 4.7 EE SAP_Basis 620 Support Package 61
    Windows Vista Enterprise
    Adobe Reader 9.0 and Adobe Reader 9.1 (tried with both versions)
    SAPGUI 710 Patch 12 (latest patch). It also occured in Patch 11. 
    Please suggest
    Thank you
    Pavan

    Thank you for the quick reply.
    We tried many notes from Service Market Place. Also, Windows Team is in contact with Adobe.
    As per Adobe's suggestions, we tried changing preferences of Adobe Reader. We think it might be a problem with SAP Frontend.
    Present status - Issue still exists. nothing works.
    Thank you

  • Predefined performance management - error while opening PDF

    Hello,
    At a customer I am working on an implementation of predefined performance manamgement (PMP). The process is in, but when I want to open a pdf sample form I get a short dump.
    Someone has an idea?
    Thanks!
    Kind regards,
    Jeremy van der Linden

    Launch IE -> Click on Gear (settings) -> Manage Add-ons -> Show: All Add-ons ->
    There are 2 Adobe Add-ons:
    Adobe PDF Reader  &  Adobe Acrobat Sharepoint Open Document
    Double-click both and be sure to click the button "ALLOW ON ALL SITES"
    (An * will appear in the field)
     http://crowdsupport.telstra.com.au/t5/T-Suite-Applications/There-was-an-error-opening-this-document-The-filename-directory/td-p/197425
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/ae2eea40-9fa6-46be-bca1-ac5eb5597d5e/sharepoint-2010-adobe-reader-error-opening-pdf-files?forum=sharepointgeneralprevious
    http://community.office365.com/en-us/f/154/t/46204.aspx?PageIndex=2
    disable the Mcafee Firewall Plug In.  This is after of course I ran superantispyware to remove some malware.  uninstalled and reinstalled the Adobe Reade
    https://forums.adobe.com/message/1776202?tstart=0

  • Scanning causes error when opening PDF

    Every time I scan or print with my HP Officejet 5610v, I can then no longer open a pdf by finding a file in the finder.
    When I try I get the following error:
    The document “iPhone intro.pdf” could not be opened. Acrobat cannot open files in the “Adobe PDF document” format.
    I can still open pdf doc by opening Acrobat and clicking open and then find the file but that is a pain.
    I have deleted my printer/scanner software and re-installed a new driver and tried updating my acrobat but to no avail.
    Anyone have any other thoughts?
    Thanks for the help.

    Use the forum for Adobe Reader.

  • ArialUnicodeMS is missing error when opening PDF

    Hi
    I have Adobe Reader v9.0 on Windows XP SP3
    When I try to open PDF document I get this error:
    "Cannot find or create the font 'ArialUnicodeMS'. Some characters my not display or print correctly"
    The document then open in gibrish.
    Please advise.
    Thank's

    Use the forum for Adobe Reader.

  • Acrobat error when opening pdf email attachments

    I have a user who has the latest version of Adobe Acrobat and Reader installed on his PC running Windows 7 Pro SP1 which is up to date on patches.
    He was unable to open any pdf documents attached to email and was getting an error from Acrobat saying it couldn't open them. I changed the default file association for .pdf file from Acrobat to Reader and now he can open most pdf attachments. The only ones he is having a problem with are ones that come from his bank in what he was told by his banker are secure emails.
    What happens when he clicks on the pdf attachment in the emails from his bank is that he gets a popup with Adobe Acrobat in the title bar of the popup and the message that says "Cannot use Adobe Reader to view PDF in your web browser. Reader will now exit. Please exit your browser and try again." The buttons to click on are OK and Cancel. If he clicks OK, the popup goes away and the pdf then opens in Reader.
    So while he can view the pdf, he gets the annoying popup that he has to click through. Is there any way to get rid of that error message popup so when he clicks on the pdf in the secure emails, that it just opens without error like the pdf's do from non-secure emails?
    Jonathan

    Post your question in the forum for Adobe Reader.

  • Adobe Reader Error in Opening PDF Form

    Why do I get this error message when I try to open PDF Application Form using Adobe Reader?
    "Error encountered while processing node xfa[0].form[0].form1[0].#subform[5].ApplicationEligibility[0]. Unable to find suitable font for Japanese encoding."

    Hi Deepak - I am a different user with the same problem as the guy above. I created a form in LiveCycle and when users open it in Reader it gives the error:
    "Error encountered while processing node xfa[0].form[0].form1[0].#subform[0].#draw[2]. Unable to find suitable font for Japanese encoding."
    Before I try to recreate the form from scratch, do you know how to fix this? For the record, the form was NOT built using any Japanese fonts.
    Thanks,
    Michael

Maybe you are looking for

  • TS2755 iPhone 4s won't delete messages!

    I have an iPhone 4s, I noticed that I have 5GB worth of messages, I tried to delete them but my phone went all glitchy and in the end I had to turn my phone off and all the messages were still there once back on! Also I don't want to restore my phone

  • Exp/imp of tablespace

    hi all could we use exp/imp of tablespace on same database say we have list of objects in a tablespace and we want to shrink the tablespace size. ( as there are not many transactions ) then can we take export of this tablespace onyly , drop the table

  • IOS UPDATE DELETED EVERYTHING ON MY IPHONE

    While updating to IOS6, my iphone crashed, and asked me to plug it into the computer. In doing so, iTunes used that to overwrite my backup, and now I have lost every picture and conversation I had on my phone... I am very very frustrated right now! A

  • Deleted Emails won't disappear!

    Approximately 60-70% of the time my deleted emails won't disappear from webmail.  I've tried Firefox and IE, spoken to several Verizon help techs to no avail.  My immediate neighbor has never had this issue.  It happens regardless of distance from ro

  • I am getting a sync failed error message after trying to download my settings.

    After upgrading to 2014 version my settings did not migrate. I have maintained my settings by uploading all my current settings recently, but each time I try to download I'm getting a "sync failed" message.