PDF and frames

Hi All!
I have troubles to display PDF in frame window. IE gives me object icon and message:
There is no viewer availible for the type of object you are trying to open....
Addres of object ...
Content type application/pdf
But acrobat is installed on my computer.
Anybody knows wats wrong?
Mike

Xerox 7346 Print Drivers
The very first one is the Mac version you want. READ THE INSTRUCTIONS about closing print set up window.
If you're on a PC, just scroll down to your OS (it's the box to the top left that starts with MAC OS and then lists all the PC drivers) and only the relevant drivers will appear. Most recent topmost down to oldest.
You're a star...
If only my wife agreed with that assessment.

Similar Messages

  • Spool no. data to PDF and then to mail

    Hi all ,
    My requirement is i have to display all the spool request no.'s for the particular user and from that user will select the particular spool no. . and that particular data has to convert into PDF and that PDF should go to mail id specified in selection screen.
    now my prob. is when i am downloading the PDF on desktop it is opening with right data and when i am sending to mail id with the same internal table with PDF format , the file is corrupted and giving some error.
    for ur reference here i am sending my code , please check and let me know .
    thanks & regards,
    Anil kumar .
    TABLES: tsp01,
            soextreci1.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-020.
    SELECT-OPTIONS : so_date1     FOR sy-datum OBLIGATORY,
                     so_time1     FOR sy-uzeit,
                     so_name1     FOR sy-uname,
                     so_splno     FOR tsp01-rqident.
                    so_email     FOR soextreci1-receiver OBLIGATORY.
    PARAMETER : so_email TYPE soextreci1-receiver OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    DATA : l_addrnumber TYPE adr7-addrnumber,
           l_persnumber TYPE adr7-persnumber,
           l_mail       TYPE adr6-smtp_addr.
    DATA : BEGIN OF it_tsp01 OCCURS 0,
            rqident   TYPE tsp01-rqident,
            rqowner   TYPE tsp01-rqowner,
            rqcretime TYPE tsp01-rqcretime,
            rqclient  TYPE tsp01-rqclient,
            rqo1name  TYPE tsp01-rqo1name,
           END OF it_tsp01.
    DATA : l_date_low   TYPE char8,
           l_date_high  TYPE char8,
           l_time_low   TYPE char8,
           l_time_high  TYPE char8,
           l_final_low  TYPE char16,
           l_final_high TYPE char16,
           markfield VALUE ' '.
    DATA : BEGIN OF l_final OCCURS 0,
           sig  TYPE c,
           opt  TYPE char2,
           low  TYPE char16,
           high TYPE char16,
           END OF l_final.
    *PARAMETERS:
    spoolno LIKE tsp01-rqident,
    download AS CHECKBOX DEFAULT 'X',
    DATA : p_file TYPE rlgrap-filename VALUE 'C:\temp\file.pdf'."#EC NOTEXT
    DATA otf LIKE itcoo OCCURS 100 WITH HEADER LINE.
    DATA cancel.
    DATA pdf LIKE tline OCCURS 100 WITH HEADER LINE.
    DATA it_pdf LIKE pdf OCCURS 0 WITH HEADER LINE.
    DATA doctab LIKE docs OCCURS 1 WITH HEADER LINE.
    DATA: numbytes TYPE i,
          arc_idx LIKE toa_dara,
          pdfspoolid LIKE tsp01-rqident,
          jobname LIKE tbtcjob-jobname,
          jobcount LIKE tbtcjob-jobcount,
          is_otf.
    DATA: client LIKE tst01-dclient,
          name LIKE tst01-dname,
          objtype LIKE rststype-type,
          type LIKE rststype-type.
    AT SELECTION-SCREEN OUTPUT.
      SELECT SINGLE addrnumber
                   persnumber
            FROM   adr7
            INTO  (l_addrnumber,l_persnumber)
            WHERE  uname = sy-uname.
      SELECT SINGLE smtp_addr
            FROM   adr6
            INTO   l_mail
            WHERE  addrnumber = l_addrnumber
            AND    persnumber = l_persnumber.
      so_date1-sign   = so_name1-sign   = 'I'.  "so_email-sign   = 'I'.
      so_date1-option = so_name1-option = 'BT'. "so_email-option = 'BT'.
      so_date1-low = so_date1-high = sy-datum.
      so_name1-low = so_name1-high = sy-uname.
    so_email-low = so_email-high = l_mail.
      APPEND : so_date1,so_name1.",so_email.
    START-OF-SELECTION.
      IF so_date1-low IS NOT INITIAL.
        l_date_low  = so_date1-low.
      ENDIF.
      IF so_date1-high IS NOT INITIAL.
        l_date_high = so_date1-high.
      ENDIF.
      IF so_time1-low IS NOT INITIAL.
        l_time_low  = so_time1-low.
        l_time_low+6(2)  = '00'.
      ENDIF.
      IF so_time1-high IS NOT INITIAL.
        l_time_high = so_time1-high.
        l_time_high+6(2) = '00'.
      ENDIF.
      IF l_time_low IS NOT INITIAL.
        CONCATENATE l_date_low  l_time_low  INTO l_final_low.
      ELSE.
        CONCATENATE l_date_low  '00000000' INTO l_final_low.
      ENDIF.
      IF l_time_high IS NOT INITIAL .
        IF so_date1-high IS NOT INITIAL.
          CONCATENATE l_date_high l_time_high INTO l_final_high.
        ENDIF.
      ELSE.
        CONCATENATE l_date_low '23595959' INTO l_final_high.
      ENDIF.
      l_final-sig  = so_date1-sign.
      l_final-opt  = so_date1-option.
      l_final-low  = l_final_low.
      l_final-high = l_final_high.
      APPEND l_final.
      CLEAR l_final.
      SELECT rqident
             rqowner
             rqcretime
             rqclient
             rqo1name
             FROM tsp01 INTO TABLE it_tsp01
               WHERE rqcretime IN l_final
               AND   rqowner   IN so_name1.
      IF sy-subrc NE 0.
        MESSAGE 'No data for the entered values' TYPE 'E'.
        EXIT.
      ENDIF.
      CLEAR : so_name1,so_name1[],it_tsp01.
      SORT it_tsp01 BY rqident.
      LOOP AT it_tsp01.
        WRITE : /1 sy-vline,
                 3  markfield AS CHECKBOX,
                 5(16)  it_tsp01-rqident,   22 sy-vline,
                 23(10) it_tsp01-rqowner,   34 sy-vline,
                 35(16) it_tsp01-rqcretime, 52 sy-vline.
        HIDE it_tsp01-rqident.
        AT LAST.
          WRITE : /1(52) sy-uline.
        ENDAT.
      ENDLOOP.
    TOP-OF-PAGE.
      WRITE: /1(52) sy-uline.
      WRITE: /1 sy-vline,
              5(16)   'Spool No.' COLOR COL_POSITIVE CENTERED , 22 sy-vline,
              23(10)   'User'     COLOR COL_POSITIVE CENTERED , 34 sy-vline,
              35(16)   'Date'     COLOR COL_POSITIVE CENTERED , 52 sy-vline.
      WRITE: /1(52) sy-uline.
    END-OF-SELECTION.
      SET PF-STATUS '/BAY4/PDF'.
      DATA : l_rqident TYPE tsp01-rqident,
             l_count   TYPE i VALUE '0'.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'PDF'.
          CLEAR l_count.
          DO.
            CLEAR : markfield.
            READ LINE sy-index FIELD VALUE markfield.
            IF sy-subrc NE 0.
              EXIT.
            ENDIF.
            CHECK markfield NE space.
            IF l_count GT 0.
              MESSAGE 'Please select only one check box' TYPE 'E'.
              EXIT.
            ENDIF.
            l_rqident = it_tsp01-rqident.
            l_count = l_count + 1.
          ENDDO.
          PERFORM get_pdf.
        WHEN 'MAIL'.
          CLEAR l_count.
          DO.
            CLEAR : markfield.
            READ LINE sy-index FIELD VALUE markfield.
            IF sy-subrc NE 0.
              EXIT.
            ENDIF.
            CHECK markfield NE space.
            IF l_count GT 0.
              MESSAGE 'Please select only one check box' TYPE 'E'.
              EXIT.
            ENDIF.
            l_rqident = it_tsp01-rqident.
            l_count = l_count + 1.
          ENDDO.
          PERFORM get_pdf.
          PERFORM send_mail.
      ENDCASE.
    *&      Form  get_pdf
          text
    -->  p1        text
    <--  p2        text
    FORM get_pdf .
      READ TABLE it_tsp01 WITH KEY rqident = l_rqident.
    LOOP AT it_tsp01.
      client = it_tsp01-rqclient.
      name   = it_tsp01-rqo1name.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                  authority     = 'SP01'
                  client        = client
                  name          = name
                  part          = 1
             IMPORTING
              CHARCO        =
              CREATER       =
              CREDATE       =
              DELDATE       =
              MAX_CREDATE   =
              MAX_DELDATE   =
              NON_UNIQ      =
              NOOF_PARTS    =
              RECTYP        =
              SIZE          =
              STOTYP        =
                  type          = type
                  objtype       = objtype
             EXCEPTIONS
                  fb_error      = 1
                  fb_rsts_other = 2
                  no_object     = 3
                  no_permission = 4.
      IF objtype(3) = 'OTF'.
        is_otf = 'X'.
      ELSE.
        is_otf = space.
      ENDIF.
      IF is_otf = 'X'.
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
            EXPORTING
              src_spoolid                    = l_rqident
              no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
            IMPORTING
              pdf_bytecount                  = numbytes
              pdf_spoolid                    = pdfspoolid
          OTF_PAGECOUNT                  =
              btc_jobname                    = jobname
              btc_jobcount                   = jobcount
            TABLES
              pdf                            = pdf
            EXCEPTIONS
              err_no_otf_spooljob            = 1
              err_no_spooljob                = 2
              err_no_permission              = 3
              err_conv_not_possible          = 4
              err_bad_dstdevice              = 5
              user_cancelled                 = 6
              err_spoolerror                 = 7
              err_temseerror                 = 8
              err_btcjob_open_failed         = 9
              err_btcjob_submit_failed       = 10
              err_btcjob_close_failed        = 11.
      ELSE.
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
            EXPORTING
              src_spoolid                    = l_rqident
              no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
            IMPORTING
              pdf_bytecount                  = numbytes
              pdf_spoolid                    = pdfspoolid
          LIST_PAGECOUNT                 =
              btc_jobname                    = jobname
              btc_jobcount                   = jobcount
            TABLES
              pdf                            = pdf
            EXCEPTIONS
              err_no_abap_spooljob           = 1
              err_no_spooljob                = 2
              err_no_permission              = 3
              err_conv_not_possible          = 4
              err_bad_destdevice             = 5
              user_cancelled                 = 6
              err_spoolerror                 = 7
              err_temseerror                 = 8
              err_btcjob_open_failed         = 9
              err_btcjob_submit_failed       = 10
              err_btcjob_close_failed        = 11.
      ENDIF.
    PERFORM download_w_ext(rstxpdft) TABLES pdf
                                       USING p_file
                                             '.pdf'
                                             'BIN'
                                             numbytes
                                             cancel.
    ENDFORM.                    " get_pdf
    *&      Form  send_mail
          text
    -->  p1        text
    <--  p2        text
    FORM send_mail .
      DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0 WITH HEADER LINE.
      DATA: it_attach  TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0 WITH HEADER LINE.
    *DATA: PIT_ATTACH LIKE table of IT_ATTACH.
      DATA: t_packing_list  LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents      LIKE solisti1   OCCURS 0 WITH HEADER LINE,
            t_receivers     LIKE somlreci1  OCCURS 0 WITH HEADER LINE,
            t_attachment    LIKE solisti1   OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1   OCCURS 0 WITH HEADER LINE.
      DATA :  w_cnt         TYPE i,
              w_sent_all(1) TYPE c,
              w_doc_data    LIKE sodocchgi1,
              gd_error      TYPE sy-subrc,
              gd_reciever   TYPE sy-subrc.
      DATA: a TYPE string,
            t TYPE string.
      a = 'FILE.PDF'.
      t_object_header = a .
      APPEND t_object_header.
      DATA: p_email TYPE string.
      CONSTANTS:
         con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
         con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
      LOOP AT pdf.
        TRANSLATE pdf USING ' ~'.
        CONCATENATE pdf-tdformat pdf-tdline INTO it_attach SEPARATED BY space.
        APPEND it_attach.
        CLEAR : it_attach,pdf.
      ENDLOOP.
      DATA: ld_error               TYPE sy-subrc,
            ld_reciever            TYPE sy-subrc,
            ld_mtitle              LIKE sodocchgi1-obj_descr,
            ld_email               LIKE somlreci1-receiver,
            ld_format              TYPE so_obj_tp ,
            ld_attdescription      TYPE so_obj_nam,
            p_attdescription       LIKE ld_attdescription,
            ld_attfilename         TYPE so_obj_des ,
            ld_sender_address      LIKE soextreci1-receiver,
            p_sender_address       LIKE ld_sender_address,
            ld_sender_address_type LIKE soextreci1-adr_typ,
            p_sender_addres_type   LIKE ld_sender_address_type,
            ld_receiver            LIKE sy-subrc.
    RANGES : ld_email FOR somlreci1-receiver OCCURS 0.
    ld_email[]       = so_email[].
    append ld_email.
      ld_email       = so_email.
      ld_mtitle      = 'PDF file for the Spool no'.
      ld_format      = 'pdf'.
      ld_attfilename = 'filename'.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
      ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type = ld_format.
      t_packing_list-obj_descr = ld_attdescription.
      t_packing_list-obj_name = ld_attfilename.
      t_packing_list-doc_size = t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      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
          object_header              = t_object_header
          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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
      SUBMIT rsconn01
    WITH mode = 'INT'
      WITH output = 'X'
      AND
      RETURN.
      IF sy-subrc EQ 0.
        MESSAGE 'PDF sent to specified mail id' TYPE 'I'.
        LEAVE SCREEN.
      ENDIF.

    Hi,
    Try this program, it works for me perfectly:
    REPORT  Z_SENDFAX line-size 46 no standard page heading message-id so.
    data g_list_content type solix_tab.
    data g_text_content type soli_tab.
    parameters:spool like sy-spono.
    parameters:rec_fax type sadrfd-rec_fax.
    parameters:title like sadrfd-rec_title.
    parameters:name1 like sadrfd-rec_name1.
    parameters:cover type c.
    PARAMETERS: Zvbeln LIKE likp-vbeln.
    start-of-selection.
      perform create_text_content changing g_text_content.
      perform create_list_content changing g_list_content.
      perform send using g_text_content
                         g_list_content.
    *&      Form  create_list_content
    form create_list_content changing list_content type solix_tab.
      perform get_list_from_spool changing list_content.
    endform."create_list_content''
    *&      Form  create_text_content''
    form create_text_content changing text_content type soli_tab.
      data:z_lin(200) type c.
    append 'To,'  to text_content.
      concatenate 'To:' name1 into z_lin separated by space.
      append z_lin to text_content.
      concatenate 'End of delivery Notice for ' Zvbeln
        into z_lin separated by space.
      append z_lin to text_content.
    convert the content from RAW to TXT''
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = text_content
          objcont_new = text_content
        EXCEPTIONS
          others      = 0.
    endform."create_text_content''
    *&      Form  SEND''
          Create the list-document and send it via FAX, Mail and RML''
    form send using text_content type soli_tab
                     list_content type solix_tab.
      data:z_lin(200) type c.
    structures and internal tables for the send data''
      data document_data    type sodocchgi1.
      data packing_list     type table of sopcklsti1.
      data receivers        type table of somlreci1.
      data contents_txt     type soli_tab.
      data contents_hex     type solix_tab.
      data packlist_wa      type sopcklsti1.
      data receiver_wa      type somlreci1.
      data packlist_counter type i.
      data sent_to_all      type sonv-flag.
      data msg_ex(200) type c.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
    main document''
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
    document data contains information for the whole message''
      document_data-obj_descr = 'Miscellaneous Delivery Notice'.
    some text for the main document''
      append 'Hi,' name1 to contents_txt.
      concatenate 'To:' name1 into z_lin separated by space.
      append z_lin to contents_txt.
      concatenate 'Attached you will find the Delivery Notice for ' Zvbeln
        into msg_ex separated by space.
      append  msg_ex to contents_txt.
    append 'Attached you will find the Delivery Notice for ' Zvbeln to contents_txt.
      packlist_counter = 1.
      perform create_packlist_entry using contents_txt
                                          'RAW'
                                 changing packlist_wa
                                          packlist_counter.
    append packlist_wa to packing_list.
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
    add a text attachment of type TXT''
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
      perform create_packlist_entry using text_content
                                          'TXT'
                                 changing packlist_wa
                                          packlist_counter.
    append packlist_wa to packing_list.
    append lines of text_content to contents_txt.
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
    add the list attachment of type ALI''
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
      packlist_counter = 1."because we will fill the hex table now''
      perform create_packlist_entry using list_content
                                          'ALI'
                                 changing packlist_wa
                                          packlist_counter.
      append packlist_wa to packing_list.
      append lines of list_content to contents_hex.
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
    fill recipients tables''
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
      perform create_fax_recipient changing receiver_wa.
      append receiver_wa to receivers.
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
    Send the document by calling the API1''
    as of 6.10 either the flag 'commit_work' has to be set''
    or a commit work statement has to be set somewhere after the call''
    Sending won't work without this!''
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = document_data
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = packing_list
          contents_txt               = contents_txt
          contents_hex               = contents_hex
          receivers                  = 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.
      case sy-subrc.
        when 0.
          if sent_to_all is initial.
            read table receivers index 1 into receiver_wa.
            message i865 with receiver_wa-retrn_code.
          else.
            message s022.
          endif.
        when 1.
          message i552.
        when 2.
          message i023 with document_data-obj_descr.
        when 4.
          message i471.
        when others.
          message i619.
      endcase.
    endform." SEND''
    *&      Form  USE_SUBMIT''
    <nowiki>*   Use "submit <report> exporting list to memory"
    form use_submit changing contents_hex type solix_tab.
      data listobject type table of abaplist.
    get the list object by calling the list in another report
    F1 on submit gives more information
      submit balvsd03 exporting list to memory and return.
    import the list from memory and store it in table listobject
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = listobject
        EXCEPTIONS
          not_found  = 1
          others     = 2.
      if sy-subrc <> 0.
        message e105 with 'LIST_FROM_MEMORY'.
      endif.
    free memory
      CALL FUNCTION 'LIST_FREE_MEMORY'
        TABLES
          listobject = listobject
        EXCEPTIONS
          others     = 1.
      if sy-subrc <> 0.
        message e105 with 'LIST_FREE_MEMORY'.
      endif.
    it's always necessary to compress the table.
    SAPconnect will decompress it
      CALL FUNCTION 'TABLE_COMPRESS'
        TABLES
          in             = listobject
          out            = contents_hex
        EXCEPTIONS
          compress_error = 1
          others         = 2.
      if sy-subrc <> 0.
        message e105 with 'TABLE_COMPRESS'.
      endif.
    endform." USE_SUBMIT
    *&      Form  WRITE_A_LIST
          Create a new list within this report.
    form write_a_list changing contents_hex type solix_tab.
      data listobject type table of abaplist.
      perform write_list.
    Save the list and store table listobject
      CALL FUNCTION 'SAVE_LIST'
        EXPORTING
          list_index         = sy-lsind
        TABLES
          listobject         = listobject
        EXCEPTIONS
          list_index_invalid = 1.
      if sy-subrc = 1.
        message e105 with 'SAVE_LIST'.
      endif.
    It's always necessary to compress the table
    SAPconnect will decompress it
      CALL FUNCTION 'TABLE_COMPRESS'
        TABLES
          in             = listobject
          out            = contents_hex
        EXCEPTIONS
          compress_error = 1
          others         = 2.
      if sy-subrc <> 0.
        message e105 with 'TABLE_COMPRESS'.
      endif.
    endform." WRITE_A_LIST
    *&      Form  GET_LIST_FROM_SPOOL
          Get list from spool
    form get_list_from_spool changing contents_hex type solix_tab.
      data spool_number     type rspoid.
      data contents_bin     type soli_tab.
      data print_parameters type pri_params.
      data valid            type c.
    write a list into spool
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
       IMPORTING
         out_parameters         = print_parameters
         valid                  = valid
       EXCEPTIONS
         archive_info_not_found = 1
         invalid_print_params   = 2
         invalid_archive_params = 3
         others                 = 4.
    if sy-subrc <> 0.
       message e105 with 'GET_PRINT_PARAMETERS'.
    elseif valid is initial.
       return.
    endif.
    new-page print on parameters print_parameters no dialog.
    perform write_list.
    new-page print off.
      spool_number = spool.
      DATA:REAL_TYPE     LIKE     SOODK-OBJTP.
      DATA:BUFFER_PDF     LIKE     TLINE OCCURS 0 WITH HEADER LINE.
    you can also send OTF documents from spool with this function
    module. The importing parameter real_type gives you the doc type
    that you have to give to the send interface. The parameter is not
    used here
      CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
        EXPORTING
          rqident              = spool_number
         desired_type         = 'RAW'
        IMPORTING
           REAL_TYPE           = REAL_TYPE
        TABLES
          buffer               = contents_bin
         BUFFER_PDF           = BUFFER_PDF
        EXCEPTIONS
          no_such_job          = 1
          job_contains_no_data = 2
          selection_empty      = 3
          no_permission        = 4
          can_not_access       = 5
          read_error           = 6
          type_no_match        = 7
          others               = 8.
    *clear contents_bin[].
      if sy-subrc <> 0.
        message e105 with 'RSPO_RETURN_SPOOLJOB'.
      endif.
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = contents_bin
          objcont_new = contents_bin
        EXCEPTIONS
          others      = 0.
      data:TRANSFER_BIN        TYPE      SX_BOOLEAN."   occurs 0.
      data:CONTENT_BIN         TYPE      SOLIX_TAB."   occurs 0.
      data:OBJHEAD             TYPE      SOLI_TAB.
      data:LEN     TYPE     SO_OBJ_LEN.
    *len = '255'.
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PRT'
       EXPORTING
         FORMAT_SRC   = 'OTF'
         FORMAT_DST   = 'PRT'
         devtype = 'POSTSCPT'
       CHANGING
         TRANSFER_BIN = TRANSFER_BIN
         CONTENT_TXT  = contents_bin
         CONTENT_BIN  = contents_hex
         OBJHEAD      = OBJHEAD
         LEN          = len.
      CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
        EXPORTING
          FORMAT_SRC   = 'OTF'
          FORMAT_DST   = 'PDF'
          devtype = 'PRINTER'
        CHANGING
          TRANSFER_BIN = TRANSFER_BIN
          CONTENT_TXT  = contents_bin
          CONTENT_BIN  = contents_hex
          OBJHEAD      = OBJHEAD
          LEN          = len.
    convert to hex table
    CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
       EXPORTING
         ip_solitab  = CONTENT_BIN
       IMPORTING
         ep_solixtab = contents_hex.
    endform." GET_LIST_FROM_SPOOL
    *&      Form  WRITE_LIST
          Write a list of SAPconnect conversion rules
    form write_list.
      data lt_scarr type table of scarr.
      data carr type scarr.
      select * from scarr into table lt_scarr.
      format color = 1.
      uline at /1(46).
      write: / sy-vline,
             'CARRID',   10 sy-vline,
             'CARRNAME', 35 sy-vline,
             'CURRCODE', 46 sy-vline.
      format color = 2.
      uline at /1(46).
      loop at lt_scarr into carr.
        write: / sy-vline,
               carr-carrid,   10 sy-vline,
               carr-carrname, 35 sy-vline,
               carr-currcode, 46 sy-vline.
      endloop.
      uline at /1(46).
      new-line.
    endform." WRITE_LIST
    *&      Form  create_packlist_entry
          text
    form create_packlist_entry  using  contents type standard table
                                       format type so_obj_tp
                             changing  packlist_wa type sopcklsti1
                                       packlist_counter type i.
      data tab_lines type i.
      clear packlist_wa.
      DATA FORM2 TYPE so_obj_tp.
    get the table length of the attachment
      describe table contents lines tab_lines.
    set binary flag for binary content to mark that this packlist entry
    is meant for table contents_hex and not for contents_bin
      FORM2 = FORMAT.
      if format = 'ALI'.
      FORM2 = 'PRT'.
        FORM2 = 'PDF'.
        packlist_wa-transf_bin = 'X'.
      endif.
    attchment's description and format
      concatenate form2 'Document' into
         packlist_wa-obj_descr separated by space.
      packlist_wa-doc_type   = form2.
    describe start and length in contents_txt or contents_hex
    which table is meant is decided by the transf_bin flag set above
      packlist_wa-body_start = packlist_counter.
      packlist_wa-body_num   = tab_lines.
    increase counter to have the starting line for the next attachment
      packlist_counter = packlist_counter + tab_lines.
    endform." create_packlist_entry
    *&      Form  create_int_recipient
          text
    *form create_int_recipient changing receiver type somlreci1.
    field-symbols <receiver> type c.
    data recipient_int type sadrud.
    clear receiver.
    fill address type specific recipient structure
    cast structure to generic receiver field
    assign recipient_int to <receiver> casting.
    receiver-receiver = <receiver>.
    set address type for INT
    receiver-rec_type = 'U'.
    *endform."create_int_recipient
    *&      Form  create_fax_recipient
          text
    form create_fax_recipient changing receiver type somlreci1.
      field-symbols <receiver> type c.
      data recipient_fax type sadrfd.
      data name type soud3.
      clear receiver.
      name-sapnam = sy-uname.
      CALL FUNCTION 'SO_NAME_CONVERT'
        EXPORTING
          name_in  = name
        IMPORTING
          name_out = name
        EXCEPTIONS
          others   = 1.
      if sy-subrc <> 0.
        name-adrname = sy-uname.
      endif.
    fill address type specific recipient structure
      recipient_fax-rec_fax    = rec_fax."'7152414031'.
      recipient_fax-rec_state  = 'US'.
      recipient_fax-rec_title  = title."'Mr.'.
      recipient_fax-rec_name1  = name1."'Ytamar Fondeur'.
      recipient_fax-send_nam   = name-adrname.
      recipient_fax-send_cover = cover.
      recipient_fax-FORM_LANGU = sy-langu.
    cast structure to generic receiver field
      assign recipient_fax to <receiver> casting.
      receiver-receiver = <receiver>.
    set address type for FAX
      receiver-rec_type = 'F'.
    endform."create_fax_recipient
    *&      Form  create_rml_recipient
          text
    form create_rml_recipient changing receiver type somlreci1.
      field-symbols <receiver> type c.
      data recipient_rml type sadr7d.
      clear receiver.
    fill address type specific recipient structure
      recipient_rml-sdest = 'C11'.
      recipient_rml-umand = '001'.
      recipient_rml-uname = 'MYUSER'.
    cast structure to generic receiver field
      assign recipient_rml to <receiver> casting.
      receiver-receiver = <receiver>.
    set address type for RML
      receiver-rec_type = 'R'.
    endform."create_rml_recipient

  • How can we handle graphics in DITA source files in order to display them correctly both in PDF and H

    We are using FM9 to publish PDF and HTML output from DITA source files and we cannot find a way to display images correctly. By adjusting the appropriate DPI, the image gets correctly displayed in HTML but not in PDF where it appears cropped according to the the text frames of the source file in FM9, like this:
    We have tried to enlarge the text frame in the source file but for some reasons FrameMaker doesn't take these changes into account.
    By modifying the attribute of the element <fig> (expanse = page), it was possible to improve a bit the rendering in the PDF but not completely.
    Our graphics are in JPG format.
    Any help on this is highly appreciated.
    Thank you.

    Hi Al@s...
    DITA doesn't provide a way to store additional information about anchored frame properties (since there is no "frame" element, just image), that's why FrameMaker doesn't allow you to set the frame size to something other than the image dimensions.
    The "standard" DITA way to reference an image with two different DPIs is to insert multiple fig/image elements and conditionalize (via attributes and ditaval) each image so it shows up in the proper output. This can be a bit tedious to insert two images for each instance, but that's the typical way to handle it (unless you've got a CMS that switches the images for different output types).
    If you use DITA-FMx, it provides a "fmdpi" feature which allows you to tag an image with the DPI you want to use in the FrameMaker-generated output, but the DITA coding sets no DPI (or height/width), so it uses the default image size for your HTML output.
        http://leximation.com/dita-fmx/
    Cheers,
    ...scott
    Scott Prentice
    Leximation, Inc.
    www.leximation.com

  • Pattern swatches are shifting when exported to PDF and viewed in Preview/GoodReader

    I've tried for days to find an answer to this question, but haven't succeeded. Please also be aware that I'm a self-taught Adobe Creative Suite user. I'm working on a Mac with CS6.
    I work for a small publisher that produces knitting books. The problem is this: our tech editor has created charts in Illustrator using the pattern swatches feature. (These are knitting charts. Each square contains a pattern swatch representing the knitted stitch.)
    I am then placing these charts in their native .ai format into an Indesign file and exporting them to PDF. In Acrobat, the charts look fabulous. In the Mac Preview reader and in GoodReader, the charts do this...
    ... the pattern swatches shift around inside their squares. Each of those dots should be centered inside their squares. In Preview, when I resize the application frame, the pattern swatches move as I re-size the frame. Any ideas about what might be happening here?
    I've tried saving the charts as PDFs and placing those into the InDesign file. Doesn't help. Exporting the charts as images (jpg or tif) works, but I have to make the resolution/file size ridiculously large to get the quality of the vector image. I'd rather place the .ai files into the .indd file if possible.

    Try using File>Object>Expand on a copy of the original before making the PDF for placing.

  • Dark images when creating a PDF in Frame 10

    We're having an issue with dark images in the PDFs created from Framemaker files. I've been trying to solve it two different ways, but each solution seems to have it's own set of problems...
    1. When we print to PDF using a .ps file generated through Acrobat Distiller, our manuals print fine, but a large majority of the graphics are coming out WAY too dark, with some details being 100% illegible.
    2. I can take small documents and "Save as PDF," and the graphics come out fine. But when I try to do this with a large document (100-1,000 pages), Framemaker gives me the infamous "Framemaker has detected a serious problem and must quit" error and then crashes.
    Anyone else seen this? I have the latest (I believe) 10.0.2.419 patch.

    You might want to specify what kind of graphics are giving you problems.
    Frame drawings or imported files? If imported, what file type? RGB or
    CMYK? Any spot colors?
    The best graphics are EPS because FrameMaker passes them around the
    Windows GDI unchanged and EPS files can retain spot colors, too. Other
    types of graphics get passed through Windows GDI and converted to RGB
    where the result can sometimes be astounding. In Save as PDF, what's the
    setting for "Convert CMYK colors to RGB?"
    Check also "GetLibraryColorRGBFromCMYK=" in maker.ini and change it from
    "Printing" to
    "None". That seems to get the best results for having what you see on
    screen match what ends up in the PDF.
    There are also color management settings in your Distiller .joboptions
    file that can affect the result. Usually, you want to set Settings>Edit
    Adobe PDF Settings> Color> Color Management Policies to either "Leave
    Color Unchanged" or "Tag only Images for Color Management."

  • Convert smartform spool to 2 pdf and send it by mail

    Hi! Can someone show me some code how to call the smartform and use the spool to convert to pdf and then send it by mail?
    Thanks in advance,
    Regards

    hai
    its very useful for u
    Object ID          :  PTP_TS_FRM_202                                 *
    Description        :  Print Program For PO Goods Receipt Document    *
    Developer          :  Ganesh Shanker Vidyarthi                       *
    Date               :  11/06/2006                                     *
    Genentech Contact  :                                                 *
    Functional Contact :                                                 *
    Purpose            :  This program is driver program of Goods Receipt*
                          Printing.                                      *
    Program Logic      : The Goods Receipt form (Raw material worksheet) *
                         would be created once we entered the values of
                         MBLNR MJAHR ZEILE fields on the selection screen.
                       Modification Log                                  *
    Changed On    Developer         Transport No.    Description         *
    11/06/2006    G.S.Vidyarthi                      Creation            *
    REPORT  zptpfrm202p_pogr_pr_instr MESSAGE-ID zmm.
              TABLES                                                     *
    Database table made for getting information about PRINTPREVIEW and
    PRINT command more than one times
    TABLES:    zgr_table.
    TYPE-POOLS:syscr.
              GLOBAL TYPE DECLARATION                                    *
    DATA:  zdoc_output_info     TYPE     ssfcrespd,  "SF:Return Document Inf.
         zjob_output_info     TYPE     ssfcrescl,  "SF:Return value at end of
                                                    form printing
           i_control TYPE ssfctrlop ,
           i_output_options TYPE ssfcompop,
           zjob_output_opts     TYPE     ssfcresop.  "SF:Return value at start
                                                    of form printing
    *This internal table is used for storing Document Segment: Material
    DATA: BEGIN OF i_mseg.
            INCLUDE STRUCTURE mseg.
    DATA: END OF i_mseg.
    This internal table is used for storing  Header: Material Document
    DATA: BEGIN OF i_mkpf.
            INCLUDE STRUCTURE mkpf.
    DATA: END OF i_mkpf.
    *Variables
    DATA flag(1) TYPE c.
    DATA: vfile TYPE string.
                    SELECTION-SCREEN                                     *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    PARAMETERS:p_mblnr TYPE mkpf-mblnr OBLIGATORY MATCHCODE OBJECT zganesh,
               p_mjahr TYPE mkpf-mjahr OBLIGATORY MATCHCODE OBJECT zganesh1,
               p_zeile TYPE mseg-zeile OBLIGATORY MATCHCODE OBJECT zganesh2.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETER:r_disp RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X'.
    SELECTION-SCREEN:COMMENT 15(10) text-002 .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETERS: r_down RADIOBUTTON GROUP g1.
    SELECTION-SCREEN:COMMENT 15(10) text-003.
    *PARAMETERS: v_file LIKE rlgrap-filename .
    *SELECTION-SCREEN:COMMENT 70(50) text-005.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETERS: r_print RADIOBUTTON GROUP g1 .
    SELECTION-SCREEN:COMMENT 15(10) text-004.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: v_file LIKE rlgrap-filename MODIF ID g12.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR v_file.
      DATA : wlv_field_name LIKE dynpread-fieldname,
              wlv_file_name  LIKE ibipparms-path.
      wlv_field_name = v_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = wlv_field_name
        IMPORTING
          file_name  = wlv_file_name.
      IF sy-subrc EQ 0.
        vfile = wlv_file_name.
        v_file = wlv_file_name.
      ENDIF.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'V_FILE'.
          IF r_disp EQ 'X' OR r_print EQ 'X'.
            screen-input = 0.
          ELSE.
            screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
                        START-OF-SELECTION EVENT                         *
    START-OF-SELECTION.
      CALLING CONVERSION FUNCTION MODULE 'CONVERSION_EXIT_ALPHA_INPUT'   *
    *Conversion function module for appending 00 befor MBLNR FIELD
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = p_mblnr
        IMPORTING
          output = p_mblnr.
    Call subroutine for fetching data from database
      PERFORM get_data.
                        END-OF-SELECTION  EVENT                          *
    END-OF-SELECTION.
    Call subroutine for calling  and processing smartform
      PERFORM call_smartform.
    *&      Form  get_data
          Subroutine for fetching data from database
    FORM get_data .
    Fetching data from MKPF table with using parameters MBLNR and MJAHR
      SELECT SINGLE * FROM mkpf
                      INTO i_mkpf
                      WHERE mblnr = p_mblnr
                        AND mjahr = p_mjahr.
      IF sy-subrc EQ 0.
    Fetching data from MSEG with using parameters MBLNR,ZEILE and MJAHR
        SELECT SINGLE * FROM mseg
                        INTO i_mseg
                        WHERE mblnr = i_mkpf-mblnr
                          AND mjahr = i_mkpf-mjahr
                          AND zeile = p_zeile.
        IF sy-subrc NE 0.
          CLEAR i_mseg.
        ENDIF.
      ELSE.
        MESSAGE i000.
        EXIT.
      ENDIF.
    ENDFORM.                    " get_data
    *&      Form  call_smartform
         Subroutine for calling smartform
    FORM call_smartform .
    Local template used in the processing output of smartform
      TYPES: BEGIN OF lt_ztable,
              mandt TYPE sy-mandt,
              mblnr TYPE mseg-mblnr,
              flag(1) TYPE c,
              END OF lt_ztable.
      CONSTANTS: c_x(1) TYPE c VALUE 'X'.
    Workarea
      DATA: lw_ztable TYPE lt_ztable.
    *Variable used in the smartform
      DATA: lv_form(30)    TYPE c,
            lv_fm_name(30) TYPE c.
      lv_form = 'ZPTPFRM202L_POGR'.
    *Calling function module SSF_FUNCTION_MODULE_NAME which gives  new name
    *to the function module that will generated by smartform.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = lv_form
        IMPORTING
          fm_name            = lv_fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *Calling function module that will be generated by smartform
      IF r_disp = c_x.
        i_output_options-tdimmed       = space.
        i_output_options-tdnewid       = c_x.
        i_output_options-tddest        = 'LOCL'.
        i_control-no_dialog = 'X'.
        i_control-preview = 'X'.
      ELSEIF r_print = c_x.
        i_output_options-tdimmed       = c_x.
        i_output_options-tddest        = 'LOCL'.
        i_control-no_dialog = c_x.
      ELSE.
        i_output_options-tdimmed       = space.
        i_output_options-tdnewid       = c_x.
        i_output_options-tddest        = 'LOCL'.
        i_control-getotf    = 'X'.
        i_control-preview   = space.
        i_control-no_dialog = c_x.
        flag = c_x.
      ENDIF.
      CALL FUNCTION lv_fm_name
        EXPORTING
          control_parameters   = i_control
          output_options       = i_output_options
          user_settings        = space
          zmkpf                = i_mkpf
          zmseg                = i_mseg
        IMPORTING
          document_output_info = zdoc_output_info
          job_output_info      = zjob_output_info
          job_output_options   = zjob_output_opts
        EXCEPTIONS
          formatting_error     = 1
          internal_error       = 2
          send_error           = 3
          user_canceled        = 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.
    Modify the database table if it found the print command
      IF  zjob_output_opts-tdpreview NE c_x.
        lw_ztable-mandt = sy-mandt.
        lw_ztable-mblnr = p_mblnr.
        lw_ztable-flag = c_x.
        MODIFY zgr_table FROM lw_ztable.
        CLEAR lw_ztable.
      ENDIF.
      IF flag EQ c_x.
        DATA:   li_lines LIKE tline OCCURS 100 WITH HEADER LINE.
        DATA:   lv_file   TYPE string,
                lbin_fsiz TYPE i.
        lv_file = v_file.
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
          IMPORTING
            bin_filesize          = lbin_fsiz
          TABLES
            otf                   = zjob_output_info-otfdata
            lines                 = li_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.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            bin_filesize            = lbin_fsiz
            filename                = lv_file
            filetype                = 'BIN'
          TABLES
            data_tab                = li_lines
          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.
      ENDIF.
    ENDFORM.                    " call_smartform
    **Please reward suitable points***
    With Regards
    Navin Khedikar

  • R3 to Mail-PDF and Mail-PDF to R3

    Hi sdners!
    I have a doubt. well.. 2 really
    1- I have to send some data from R/3 to a supplier by mail, with a pdf document attached to it. Is it possible to convert IDoc data to pdf format, and send it throw mail (attached to it) to a recipient determined by the IDoc data?
    I think a solution would be to create a XSL Mapping to create PDF and send it throw mail (like Prakash's blog /people/community.user/blog/2006/09/07/email-reporting ), but I never did this.
    2- And I have to do the response too, asynchronous. I have to receive the mail, with a pdf attached to it, and use the pdf data to send an IDoc to R/3.
    Is it possible to use PayloadSwapBean module to use pdf attached file (like Michal's blog /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step) , and then use a module to parse the PDF file and frame a XML document  (like blog /people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter) ??
    Are these interfaces possible?
    I will reaaally apreciate your help
    Regards,
    Fede

    You can't do that. Couldn't you just export the data from the PDF after it's received?
    In order to attach the complete PDF with Reader, the document has to be Reader-enabled.

  • Complimentary PDF Photo Frames

    Downloaded Complimentary PDF Photo Frames and can not find it. Where do I look?

    TO: Mylenium
    From: Richard Corbet
    Sorry for the confusion, I thought I was responding to the sender of the E-mail promotion.
    Attached below are:
    Promotion page
    Close-up my selected product
    I hope this fills in the missing information.
    When I tried to download the selection there was no download. Please advise. Thanks
    DICK CORBET
    P.O. Box 376
    Ballwin, MO 63022
    O: 636-527-3040
    F: 636-386-3941
    M: 314-568-9755
    +++++++++++++

  • Using illustrator for iOS graphics and frame animations (beginner question)

    Hey there,
    Just want to get some opinions and advice.
    We are developing a sidescolling 2D game and I am creating 2D graphics in illustrator, ...so far so good, at this point in time I have a few characters designed.
    Now for the character poses, positions and frame by frame animations.... hmmmm.
    I have been searching for examples of ways to create character movements and positions in illustrator but as of yet have not found any good examples or explainations.
    Would anyone care to share (or point me to some examples) of workflows you use to create different poses and character postions using illustrator...
    (eg. should I be importing my artwork into flash to use the bone tool? Or should I create each variation in illustrator by copying my character and manipulating)

    Though the people I have talked to are using solely illustrator to do just that!?
    Maybe the people you've talked to just haven't taken opportunity to familiarize themselves with Bones. The artwork for cartooney walking animations can be done fairly easily in a drawing program, using Blends, Transform Again etc. So in many cases it's just not a big deal either way.
    What is the advantage of using just illustrator to create animations, I'm guessing that its because the drawing tools available are superior to flash?
    To me, it's not so much about "superior" drawing tools in a drawing program; it's more about a more complete set of drawing tools and commands. Flash has a Bezier drawing tool that works fine, so you can draw paths with control. But creating Blends on paths is just more convenient to do right on the page, without involving a timeline, keyframes, etc. Brushes and Transform Effect make it easy to repeat a series of objects. Flash's continual on-the-fly autotracing and auto merging of overlapping unselected and ungrouped objects can be cumbersome while drawing.
    See this example. Then click the Construction Notes link below it to view a 2-page PDF that shows how the majority of the artworks was accomplished with just two very simple ArtBrushes used in combination with pathBlends. That kind of stuff is often just easier/quicker to do in a drawing program, release to layers, and then copy/paste or otherwise import to Flash.
    Using Blends in AI for things like this experiment can save alot of tedium and time, as compared to working only with Flash's drawing tools. (Notes here.)
    Some things just can't be done with only Flash's drawing tools. Envelope distortions, for example, can be blended to create frame-by-frame shape tweens that would be difficult to do with just Flash's native tools, as in this experiment. (The animation is embedded on Page 11 of the PDF; you may have to click "Trust this host one time only" in Reader and then click the middle of the page to get it to play, depending on your OS version.)
    But as a general rule whenever using a drawing program in conjunction with Flash, avoid using more than ordinary flat fills and stokes in the drawing program before importing the paths to Flash. If you want to involve grads, shadows, transparency, etc., you'll generally be better off adding those things in Flash. Such effects are not the same constructs in different programs, and will most likley become rasterized in Flash (as is the case in the last example, above).
    So again, it depends on specifically what you are trying to do.
    JET

  • I cannot flatten my PDFs   and I just bought the adobe acrobat pro XI to flatten my pdfs

    how can I flatten my PDF????

    Hi Anubha,
    I received your email, and I followed your steps that you sent me.  I still
    cannot efficiently security my published PDFs files to prevent people from
    extracting (copying & pasting) images from the digital files I created.
    This is what I am doing:
    I create my document using power point
    I create a PDF using acrobat tab from my PPT
    I follow the steps that you gave me and I can copy the text, images and
    frames.
    I also used another step but it didn't work:
    I was told from the Adobe chat to open the file and click on print and
    select Adobe PDF,  OK, and save it .  Still not working
    Thank you,
    Mrs. Partida
    On Wed, Apr 29, 2015 at 10:20 PM, Anubha Goel <[email protected]>

  • How do I use PDF Picture Frames?

    How do I use the PDF Picture Frames for Acrobat XI? The download page says "To add your photos, simply open Acrobat XI and follow the instructions." but there are no instructions when you open Acrobat. The picture frames themselves are pdf files.

    Many of us (at least me) have no clue as to how to help you since our versions of AA XI did not come with this gift offer. I can't even find it on the Adobe site.
    I might guess that the frames are nothing but buttons as used in forms. You might try checking to see if selecting Forms>edit provides the frames at button objects. If that is the case, you simply go to the properties and change the photo to be displayed on the button.
    That is my best guess without having seen the gift PDF.
    As for Acrobat, there is a lot more to Acrobat than a gift PDF. Acrobat is designed for creating PDFs from other applications, providing minimal editing, and offereing forms and several other options. Hope that helps some.

  • Jasper report  for pdf and html

    Hi friends I am Gopi
    I am doing project in servlet and jasperreport in tomcat.
    I save my path jasperreport for Html and Pdf reports.
    when i click the jsp button Export to pdf and Export to Html,
    I need to open this files in new pdf application and new browser window .
    if(pdf1.equals("html"))
    JasperExportManager.exportReportToHtmlFile(jasperPrint, path +"\\" + reportName + ".html");
         exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
              exporter.exportReport();
         if(pdf1.equals("pdf"))
              System.out.println("PDF");
              response.setContentType("application/pdf");
              JasperExportManager.exportReportToPdfFile(jasperPrint,path +"\\" + reportName + ".pdf");
              exporter = new JRPdfExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
              exporter.exportReport();          
    pls help me...

    gopikannang wrote:
    when i click the jsp button Export to pdf and Export to Html,
    I need to open this files in new pdf application and new browser window . Use the target attribute of the <form> or the <a> element which opens the PDF file. Set its value to "_blank".
    Learn HTML. There is a nice tutorial at w3schools.com and a good specification at w3.org.

  • Dynamic CRM 2013 Online how to execute Report, generate PDF and email

    Dear All,
    I am using Dynamic CRM 2013 online. For quote, I have workflow and Dialogue processes for review process. On approval, I want the system to generate a PDF of quote report, attach the PDF and email it to the Customer.
    Better I would like, When approver, clicks on the approve button, the system should auto generate a PDF of quote report, attach the PDF and email it to the Customer, without any further input from the user. If its not possible, I may have to put button on
    quote form.
    I am using the attached code, but facing various issues.
    1. Under prepare the SOAP Message coding part, I am not sure what should be the below URL for CRM 2013 Online?
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    2. What should be the emailid here? Is it Recepient Contact id(Guid) ?
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    3. Using this code, not able to create Entity for "ActivityMimeAttachment", I am getting newEntity as undefined.
    Below is the code I am using. Please check and help me out, where I am going wrong. Let me know if any better way to implement it. At present, I have put one button on quote form, on click event, below code will get executed.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script type="text/javascript">
    var Xrm;
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    function getReportingSession() {
    var reportName = "Quotation_Report"; //set this to the report you are trying to download
    var reportId = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var recordid = Xrm.Page.data.entity.getId();
    // recordid = recordid.substring(1, 37); //getting rid of curly brackets
    alert(recordid);
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    retrieveEntityReq.send("id=%7B" + reportId + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false");
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    function createEntity(ent, entName, upd) {
    var jsonEntity = JSON.stringify(ent);
    var createEntityReq = new XMLHttpRequest();
    var ODataPath = Xrm.Page.context.getServerUrl() + "XRMServices/2011/OrganizationData.svc";
    createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
    createEntityReq.setRequestHeader("Accept", "application/json");
    createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    createEntityReq.send(jsonEntity);
    var newEntity = JSON.parse(createEntityReq.responseText).d;
    alert("new entity" + newEntity);
    return newEntity;
    function createAttachment() {
    var params = getReportingSession();
    var recordid = Xrm.Page.data.entity.getId();
    alert("recordid " + recordid);
    var orgName = Xrm.Page.context.getOrgUniqueName();
    var userID = Xrm.Page.context.getUserId();
    //create email record
    // Prepare the SOAP message.
    var xml = "<?xml version='1.0' encoding='utf-8'?>" +"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'" +
    " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" +
    " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" +
    "<soap:Header>" +
    "</soap:Header>" +
    "<soap:Body>" +
    "<Create xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
    "<entity xsi:type='email'>" +
    "<regardingobjectid type='quote'>" + recordid + "</regardingobjectid>" +
    "<subject>" + "Email with Attachment4" + "</subject>" +
    "</entity>" +
    "</Create>" +
    "</soap:Body>" +
    "</soap:Envelope>";
    // Prepare the xmlHttpObject and send the request.
    var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xHReq.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Create");
    xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xHReq.setRequestHeader("Content-Length", xml.length);
    xHReq.send(xml);
    // Capture the result
    var resultXml = xHReq.responseXML;
    // alert("resultXml " + resultXml);
    // Check for errors.
    var errorCount = resultXml.selectNodes('//error').length;
    if (errorCount != 0) {
    alert("ERROR");
    var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
    alert(msg);
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    //var emailid = userID;
    var post = Object();
    post.Body = encodePdf(params);
    var email = new Array();
    email[0] =new Object();
    email[0].id = emailid;
    email[0].entityType ='email';
    post.Subject ="File Attachment";
    post.AttachmentNumber = 1;
    post.FileName ="Report.pdf";
    post.MimeType ="application/pdf";
    post.ObjectId = Object();
    post.ObjectId.LogicalName ="email";
    post.ObjectId.Id = email[0].id;
    post.ObjectTypeCode ="email";
    alert(post.ObjectId.Id);
    createEntity(post,"ActivityMimeAttachment", "");
    alert("created successfully");
    email.Subject = "Your Order";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: customerId, // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerId, // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity). activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    </SCRIPT>
    <SCRIPT type=text/vbscript>
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </SCRIPT>
    </head>
    <body>
    <input type="button" onclick="createAttachment();" value="Attach Report" />
    </body>
    </html>
    Thanks. and waiting for your valuable comments.
    - Mittal

    Hello,
    Yes, I was able to make my code working as below. Tested on CRM online 2013.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
    <script type="text/javascript">
    if (typeof (SDK) == "undefined")
    { SDK = { __namespace: true }; }
    SDK.JScriptRESTDataOperations = {
    _context: function () {
    if (typeof GetGlobalContext != "undefined")
    { return GetGlobalContext(); }
    else {
    if (typeof Xrm != "undefined") {
    return Xrm.Page.context;
    else { return new Error("Context is not available."); }
    _getServerUrl: function () {
    var serverUrl = this._context().getServerUrl()
    if (serverUrl.match(/\/$/)) {
    serverUrl = serverUrl.substring(0, serverUrl.length - 1);
    return serverUrl;
    _ODataPath: function () {
    return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
    _errorHandler: function (req) {
    return new Error("Error : " +
    req.status + ": " +
    req.statusText + ": " +
    JSON.parse(req.responseText).error.message.value);
    _dateReviver: function (key, value) {
    var a;
    if (typeof value === 'string') {
    a = /Date\(([-+]?\d+)\)/.exec(value);
    if (a) {
    return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
    return value;
    Create: function (object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 201) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Retrieve: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    Update: function (id, object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "MERGE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Delete: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "DELETE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
    if (filter != null) {
    filter = "?" + filter;
    else { filter = ""; }
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set" + filter, true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    __namespace: true
    </script>
    <script type="text/javascript">
    //Create Email and link it with Order as Regarding field
    var Xrm;
    var email = new Object();
    var ownerID = "";
    var CustomerId = "";
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    //Get ownerid who send email of quotation to customer
    function GetOwnerID() {
    var owner = Xrm.Page.getAttribute("ownerid").getValue();
    ownerID = owner[0].id;
    var ownerName = owner[0].name;
    var entityType = owner[0].entityType;
    GetToEmailGUID();
    //Get customerid who receive email of quotation from owner
    function GetToEmailGUID() {
    var Customer = Xrm.Page.getAttribute('customerid').getValue();
    CustomerId = Customer[0].id;
    var CustomerName = Customer[0].name;
    var entityType = Customer[0].entityType;
    //if CustomerId is type of "Account" then get Primary Contact id of that account
    if (entityType == "account") {
    var contact = Xrm.Page.getAttribute("customerid").getValue();
    if (contact === null) return;
    var serverUrl = Xrm.Page.context.getClientUrl();
    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
    var req = new XMLHttpRequest();
    req.open("GET", oDataSelect, false);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    req.onreadystatechange = function () {
    if (req.readyState === 4) {
    if (req.status === 200) {
    var retrieved = JSON.parse(req.responseText).d;
    CustomerId = retrieved.PrimaryContactId.Id;
    else {
    alert(this.statusText);
    req.send();
    function CreateEmail() {
    GetOwnerID();
    email.Subject = "Email with Report Attachment";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    GetReportId('Quotation');
    //Create attachment for the created email
    function CreateEmailAttachment() {
    //get reporting session and use the params to convert a report in PDF
    var params = getReportingSession();
    //Email attachment parameters
    var activitymimeattachment = Object();
    activitymimeattachment.ObjectId = Object();
    activitymimeattachment.ObjectId.LogicalName = "email";
    activitymimeattachment.ObjectId.Id = email.ActivityId;
    activitymimeattachment.ObjectTypeCode = "email",
    activitymimeattachment.Subject = "File Attachment";
    activitymimeattachment.Body = encodePdf(params);
    activitymimeattachment.FileName = "Report.pdf";
    activitymimeattachment.MimeType = "application/pdf";
    //Attachment call
    SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
    //ActivityMimeAttachment CallBack function
    function ActivityMimeAttachmentCallBack(result) {
    var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
    var width = "800px";
    var height = "600px";
    window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
    // To open window which works in outlook and IE both
    //openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width, height, features);
    //This method will get the reportId based on a report name that will be used in getReportingSession() function
    function GetReportId(reportName) {
    var oDataSetName = "ReportSet";
    var columns = "ReportId";
    var filter = "Name eq '" + reportName + "'";
    retrieveMultiple(oDataSetName, columns, filter, onSuccess);
    function retrieveMultiple(odataSetName, select, filter, successCallback) {
    var serverUrl = Xrm.Page.context.getServerUrl();
    var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
    var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
    if (select) {
    odataUri += "$select=" + select + "&";
    if (filter) {
    odataUri += "$filter=" + filter;
    $.ajax({
    type: "GET",
    contentType: "application/json; charset=utf-8",
    datatype: "json",
    url: odataUri,
    beforeSend: function (XMLHttpRequest) {
    XMLHttpRequest.setRequestHeader("Accept", "application/json");
    success: function (data) {
    if (successCallback) {
    if (data && data.d && data.d.results) {
    successCallback(data.d.results);
    else if (data && data.d) {
    successCallback(data.d);
    else {
    successCallback(data);
    error: function (XmlHttpRequest, errorThrown) {
    if (XmlHttpRequest && XmlHttpRequest.responseText) {
    alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
    function onSuccess(data) {
    reportId = data[0].ReportId.replace('{', ").replace('}', ");
    CreateEmailAttachment(); // Create Email Attachment
    //Gets the report contents
    function getReportingSession() {
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    var Id = Xrm.Page.data.entity.getId();
    var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
    quotationGUID = quotationGUID.replace('}', "");
    var reportName = "Quotation"; //set this to the report you are trying to download
    var reportID = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var rptPathString = ""; //set this to the CRMF_Filtered parameter
    var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" +
    reportName + "&isScheduledReport=false&p:CRMAF_Filteredquote=" + strParameterXML;
    //remove the part starting from &p:salesorderid if your report has no parameters
    retrieveEntityReq.send(rptPathString);
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
    "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
    "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    } else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    </script>
    <script type="text/vbscript">
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </script>
    </head>
    <body>
    <input type="button" onclick="CreateEmail();" value="Attach Report" />
    </body>
    </html>
    Thank you,
    Mittal.

  • HELP: I need to link a PDF within PDF and be able to open and return to original PDF

    I have a master PDF and have attached 7 supplemental PDF documents. I created "click here" icons and used the steps below so that the linked document would open. The problem is, once I open the supplemental PDF, it closes the original master. I would like to close the linked document and return to the master view. Is there a way to do this?
    Or is there a way to do this from InDesign? I created master file in InDesign and exported as an Interactive PDF.  I created the buttons and linked them to external files. This works great as long as the master PDF and the links are all in one file, but that is a pain to send to a viewer. Ideally, I want to be able to send the master PDF to a viewer and not have to send a links folder. Is there a way to embed the supplemental PDFs into the master so that they are all combined into one file AND have the ability to use buttons to call up one of the attachments, close, and return to the original?
    Thanks in advance!!

    I want to do the same thing that the original poster of this question wants to do. I haven't worked extensively with Acrobat so am finding by trial and error the several ways PDFs within PDFs can be accomplished. I'm using a trial version of Acrobat Pro X and have experimented with three options.
    1 - I've created a Portfolio and am impressed with what that can do, though I think it may be "overkill" for the current size of my project.
    2 - I've also tried creating this project as an index but discovered that the links I'd created in the original docs didn't work when I moved the index and its contents (keeping the file structure the same). I presume this means the links are absolute? I also don't understand how it is that users search a .pdx file, or how to present what I want to be the original opening PDF of indexed docs.
    3 - I've also thought to create one PDF with attached PDFs, so I'd like to have you expand on your comment about creating a master document and attaching documents to it.
    The specifics of my project are these: I have created a master directory that contains approximately 120 links. Most of the links are repeated three times (users can find in the directory the item they need in three different ways: alphabetically, by application, or by module; hence each item listed once in each of three categories). I want to make that directory the "master" PDF that users open first, and then locate within that PDF the 5-8 PDF documents that contain all of the places to which the directory links. I want the "master" directory to be self-contained and completely "portable" as far as all of the documents and links are concerned so that when I make the PDF available from our website users can open the master from there or copy it and have all of the docs they need with all of the links intact. I think I prefer that all docs open in new windows, since returning to the original doesn't seem very user friendly in Acrobat (I like the tabs feature in FoxIt when multiple PDFs are open...).
    I'd like an opinion about the best way to accomplish what I need to do, and am also wondering whether there are other options I am unaware of. BTW, the reason we've decided to document this whole project in PDFs rather than HTML is because this project contains a big number of tables, which do not look consistent across various browsers (i.e., most of our tables look fine in IE and Firefox, but awful in Google Chrome...). In researching my issue on the Acrobat Windows forum I see that rendering tables in Acrobat is also an issue that seems to be unresolved.
    Thank you!

  • How can I copy text from PDF and include the source filename in the pasted selection?

    I'm a biologist and frequently cut-and-paste notes from PDFs of scientific articles.  I name all of the PDF articles with their PubMed ID, a short unique identifier (e.g. 19397482.pdf).  When I take notes, I will select a few sentences from the PDF and then paste them into a text editor for later reference. 
    Can anyone suggest a method or script that would allow me to paste the copied text with the Pubmed filename included in a single action?  I would want the pasted output it to look something like this, with the filename appended to the end:
    Of the transcripts that were significantly different, there was a greater number of transcripts that were down-regulated in the IVC embryos (380) than the number of transcripts that were up-regulated (208).  [20668257.pdf]
    This would really help me to properly cite information sources during the writing process.  I know there are bibliography managers that might be able to do something like this, but I prefer to read the PDF articles directly in Preview and select the text as I am reading. 
    Thanks very much for any suggestions / ideas.
    jjw

    To copy and paste in a single action:
    tell application "Preview" to activate
    tell application "System Events" to tell process "Preview"
        -- Get the PubMed ID:
        get the title of the front window
        set thePubMedID to word 1 of result
        -- Copy the selected text to the clipboard:
        keystroke "c" using {command down} -- ⌘C
        delay 0.25 -- adjust if necessary
        -- Add the PubMed ID to the contents of the clipboard:
        set theNotes to the clipboard
        set the clipboard to (theNotes & space & "[" & thePubMedID & ".pdf]")
    end tell
    tell application "Notational Velocity" to activate
    tell application "System Events"
        -- Paste the contents of the clipboard to the end of the Notational Velocity document
        key code 125 using command down -- ⌘↓
        keystroke return & return
        keystroke "v" using {command down} -- ⌘V
    end tell

Maybe you are looking for

  • Wy douse the bridge override time to live for individual jms-messages?

    Hi, we have a problem with time to live for individual jms-messages.           We have a JMS-bridge (ASYNC) between two wls, one application publish a jms masseage on a jms queue with the QueueSender. When the message i sent we set the time to live f

  • Cheap Camera Won't Unmount!

    For my daughter's sixth birthday we bought her an inexpensive digital camera to introduce her to the world of photography. The instructions that came with the driver download noted that when connecting the camera to a computer running Mac OS X, one c

  • Cd/dvd drive ejecting discs

    all of a sudden my powerbook ejects cds and dvds without reading the media. the motor goes through its few second start up process but spits the disc out. not media related as these are discs that have played before. any ideas?

  • To Check or Uncheck? That is the Question

    In my Itunes music on my computer I have a lot of songs. I noticed that to the left of the song titles there is a check box. Some of my songs are checked and some are not, what does this mean to me? Should they all be checked or unchecked?

  • Opening balance and changes

    Hi all, For reporting purpose, I need to populate data for opening balance and the changes for all the balance sheet items after consolidation. I believe we can do this by using movement type as an indicator. My problem now is for the data extracted