Script PDF output is printing distorted

Hi,
At the time of printing script output I have set Option paramter 'ITPO' to generate spool request.I sent this spool request PDF output to external mail by SP01. But when I download this PDF output form mail and print, priting quality gets distorted. Why this is happening? Please help how to overcome this issue.
Regards

Hi,
Thanks for ur reply.
What I deed and what I want is explained below:
1. I have developed a script form and driver program which is used for invoice printing.
2. Our client wants to send this invoice on external mail. What i deed for this that I am using the spool request which is created during the print of output.
3. Then I am using transaction code SP01 to send spool PDF to external mail.
4. This script PDF output is sent successfully on external mail as an attachment. User saves this PDF attachement and print on their printer.
5. PROBLEM is when user open this attachment and prints this PDF, the printing gets distorted.
Note: I have also used another way by function module and program, but the result is same, PDF attachemnt printing gets distorted. It is not the same as get printing through ZTCODE printing of this script.
  CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
      src_spoolid                    = SPOOLID
      NO_DIALOG                      = ' '
    DST_DEVICE                     =
    PDF_DESTINATION                =
  IMPORTING
    PDF_BYTECOUNT                  =
    PDF_SPOOLID                    =
    OTF_PAGECOUNT                  =
    BTC_JOBNAME                    =
    BTC_JOBCOUNT                   =
   TABLES
      PDF                            = PDF
  LOOP AT PDF.
    TRANSLATE PDF USING ' ~'.
    CONCATENATE gd_buffer PDF INTO gd_buffer.
  ENDLOOP.
  TRANSLATE gd_buffer USING '~ '.
  DO.
    it_mess_att = gd_buffer.
    APPEND it_mess_att.
    SHIFT gd_buffer LEFT BY 255 PLACES.
    IF gd_buffer IS INITIAL.
      EXIT.
    ENDIF.
  ENDDO.
PERFORM process_email.
FORM process_email.
  DESCRIBE TABLE it_mess_att LINES gd_recsize.
  CHECK gd_recsize > 0.
  PERFORM send_email USING p_email1.
ENDFORM.
FORM send_email USING p_email.
  CHECK NOT ( p_email IS INITIAL ).
  REFRESH it_mess_bod.
Default subject matter
  gd_subject         = 'Subject'.
  gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
  it_mess_bod        = 'PDF Attachment'.
  APPEND it_mess_bod.
it_mess_bod        = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
  IF p_sender EQ space.
    gd_sender_type  = space.
  ELSE.
    gd_sender_type  = 'INT'.
  ENDIF.
Send file by email as .xls speadsheet
  PERFORM send_file_as_email_attachment
                               tables it_mess_bod
                                      it_mess_att
                                using p_email
                                      'Example .xls documnet attachment'
                                      'PDF'
                                      gd_attachment_name
                                      gd_attachment_desc
                                      p_sender
                                      gd_sender_type
                             changing gd_error
                                      gd_reciever.
ENDFORM.
FORM send_file_as_email_attachment tables it_message
                                          it_attach
                                    using p_email
                                          p_mtitle
                                          p_format
                                          p_filename
                                          p_attdescription
                                          p_sender_address
                                          p_sender_addres_type
                                 changing p_error
                                          p_reciever.
  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 ,
        ld_attfilename TYPE  so_obj_des ,
        ld_sender_address LIKE  soextreci1-receiver,
        ld_sender_address_type LIKE  soextreci1-adr_typ,
        ld_receiver LIKE  sy-subrc.
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,
        w_cnt type i,
        w_sent_all(1) type c,
        w_doc_data like sodocchgi1.
  ld_email   = p_email.
  ld_mtitle = p_mtitle.
  ld_format              = p_format.
  ld_attdescription      = p_attdescription.
  ld_attfilename         = p_filename.
  ld_sender_address      = p_sender_address.
  ld_sender_address_type = p_sender_addres_type.
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
            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.
ENDFORM.
Regards
Dinesh Singh

Similar Messages

  • PDF output not printing specific Czech character

    Hi,
    On the XML template i have harcoded some Czech characters like, měna & Peněžní
    if any Czech character has small v on top of the character, then the report output prints as ? instead of that character. For examplae, měna & Peněžní in PDF output prints as m?na & Pen??ní . It prints rest of the Czech characters correctly. The issue happens only with PDF output. When i keep the Format as EXCEL then it prints the Czech characters correctly. Can any one help me on this issue.
    Thanks
    Shankar

    Can somebody help me on this.
    Thanks,
    Shankar

  • Actual layout of PDF output from printer is very small

    Hi there,
    I am currently sucessfully migrate Oracle reports from 6i to 10g (10,1,2) and the result looks fine from IE browser. When I try to print the report from printer, the image is occupied upper part of Letter size pager and it is very small which I even cannot read it. The following is my code snap:
    SET_REPORT_OBJECT_PROPERTY(p_repid,REPORT_EXECUTION_MODE,BATCH);
         SET_REPORT_OBJECT_PROPERTY(p_repid,REPORT_COMM_MODE,SYNCHRONOUS);
         SET_REPORT_OBJECT_PROPERTY(p_repid,REPORT_DESTYPE,CACHE);
         SET_REPORT_OBJECT_PROPERTY(p_repid,REPORT_DESFORMAT,'PDF');
         SET_REPORT_OBJECT_PROPERTY(p_repid,REPORT_SERVER,g_server);
         v_rep := RUN_REPORT_OBJECT(p_repid);
    I didn't change any in my report rdf from 6i but only open and save it using 10g report builder. I also read threads posted but couldn't find the answer. Can anyone help me to resolve my issue.
    Thanks
    Jeffrey

    It happens on all machine. We use browser to launch the application and the report is called from forms (10.1.2). We didn't change any code in report and neither the fonts (Tahoma). In 6i, client server environment, windows can find the font. I guess in 10g web environment, the font is not as default. HP Laserjet 8000N is a network printer which I use to testing my report. everything is fine in 6i but not 10g. Here is my question.
    1. How to check printer setup? Should I use the default font from Linux instead of Tahoma?
    2. I found a note in metalink, Note:356221.1 which explains the procedures to deploy reports from windows to Linux. I am not sure my problem is related to the font or something else...
    Thanks for you reponse.

  • Barcode printing in XML report PDF output

    Hi All,
            I want to print barcode of invoice number / purchase order number in the XML report PDF output.
            Anyone please suggest me with your ideas and experience.

    Hi Bogdan,
    The steps mentioned in the doc is what i did in order.
    I couldn't understand the step # 13 & 14.
    Log in as XML Publisher Administrator
    Navigate to Administration --> Font Files --> Create Font File
    Available fields are Font Name and File
    --> for Font Name, choose any descriptive name
    --> file will browse your PC to locate the font file
    Navigate to Font Mappings -->Create Font Mapping Set
    Mapping name is the name you will give to a set of fonts.
    Mapping code is the internal name you will give to this set
    Type: 'PDF Form' for PDF templates. 'FO to PDF' for all other template types.
    Create Font Mapping (this allows you to add fonts to a set)
    Font Family is the exact same name you see in MS Word under Font. If you don't use the same name the font will not be picked up at runtime.
    Style and weight must also match how you use the font in the RTF or PDF layout template. Normal and Normal are good defaults.
    Language and Territory should remain blank (NULL) unless you have a strong business reason, as these fields can cause the font not to be picked up at runtime.
    Navigate to Configuration General -> FO Processing -->Font Mapping Set. This can also be done at Data Definition and Template level, via the corresponding Edit Configuration button on those pages. The hierarchy is Site-> Data Def -> Template.
    Select your new mapping set.
    Make sure the font is not referenced under File --> Properties --> Custom in the RTF template file.
    Under General, set a Temporary Directory. The font will be stored under a /fonts directory at runtime, initially created the first time the font is used.
    Upload a template that uses your special font and test using preview or by submitting a concurrent request.

  • Output is not going to Printer Directly for XML (PDF) Output

    Hi,
    I am trying to print the AP Check Advice output directly to printer,using FND_REQUEST.set_print_options before submission of concurrent request. This was working perfectly,when report was RDF(with PDF) output. I changed it as XML with PDF output. Please help here.
    CREATE OR REPLACE PROCEDURE <NAME>(ERRBUFF OUT VARCHAR2,
    RETCODE OUT VARCHAR2,
    P_PAYMENT_BATCH IN VARCHAR2) IS
    L_REQUEST_NO NUMBER := 0;
    L_PRINTER BOOLEAN := TRUE;
    L_OUPTPUT_FORMAT VARCHAR2(100);
    XML_LAYOUT BOOLEAN;
    BEGIN
    -- Submit the request to Run the report
    L_OUPTPUT_FORMAT := 'PDF';
    XML_LAYOUT := FND_REQUEST.ADD_LAYOUT(TEMPLATE_APPL_NAME => 'SQLAP',
    TEMPLATE_CODE => 'SDAPBFAD',
    TEMPLATE_LANGUAGE => 'en',
    TEMPLATE_TERRITORY => 'IN',
    OUTPUT_FORMAT => L_OUPTPUT_FORMAT);
    IF XML_LAYOUT THEN
    IF l_printer = FND_REQUEST.set_print_options('bapr001',
    'PDF_PORT',
    1,
    TRUE,
    'N',
    'RESOLVE') then
    FND_FILE.PUT_LINE(FND_FILE.LOG, 'Printer Setup Completed');
    END IF;
    L_REQUEST_NO := FND_REQUEST.SUBMIT_REQUEST(APPLICATION => 'SQLAP',
    PROGRAM => 'SDAPBFAD',
    START_TIME => NULL,
    SUB_REQUEST => FALSE,
    ARGUMENT1 => P_PAYMENT_BATCH,
    ARGUMENT2 => FND_GLOBAL.LOCAL_CHR(0));
    END IF;
    COMMIT;
    END ;

    Payables: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    SDAPBFAD module: SDD Format Payments (Advice Print)
    Current system time is 01-JUL-2009 11:20:31
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    P_PAYMENT_BATCH='Quick Payment: ID=461458'
    Environment will now switch to UTF-8 code-set.
    Parts of this log file may not display correctly
    as a result. This is an expected behavior.
    XML_REPORTS_XENVIRONMENT is :
    /app/oapps/11.5.5/opm7ora2/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    XENVIRONMENT is set to /app/oapps/11.5.5/opm7ora2/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    AMERICAN_AMERICA.UTF8
    MSG-00001: After SRWINIT
    MSG-00002: After Get_Company_Name
    MSG-00003: After Get_NLS_Strings
    MSG-00004: After Get_Base_Curr_Data
    MSG-00800: Getting Payment Batch details....
    MSG-00007: After Custom_Init
    MSG-00020: After SRWEXIT
    MSG-00010: L_REQUEST_ID
    MSG-00020: Printer Setup Compeltedbapr002SDDCHECK
    MSG-00010: L_REQUEST_ID23907445
    MSG-01001: Quickcheck - deleting temporary records....
    Report Builder: Release 6.0.8.27.0 - Production on Wed Jul 1 11:20:31 2009
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter Username:
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 23907442 on node HOUN35 at 01-JUL-2009 11:20:42.
    Post-processing of request 23907442 completed at 01-JUL-2009 11:20:48.
    ------------- 2) PRINT   -------------
    Printing output file.
    Request ID : 23907442      
    Number of copies : 1      
    Printer : bapr001
    Finished executing request completion options.
    Concurrent request completed successfully
    Current system time is 01-JUL-2009 11:20:49
    <stdin>: The file is damaged and could not be repaired.

  • Can't able to print Non English data properly in PDF Output

    Can't able to print non english data properly
    Example:
    I want to print the germen data (Währung),But it printing like this (Währung) in PDF out put
    What the changes i have to do to achive this
    Thanks&regards
    yamini

    Hi Yamini,
    I think this happens when you look at utf-8 in Windows wiith another character set. I've noticed that the XML file (and hence the PDF output) displays those characters when I preview reports on the BI desktop, but the output from the server is fine, so I don't worry about it.
    Tore.

  • Jfmerge:Invalid printer Type (98) when generating  a pdf output.

    I am receiving "Invalid Printer Type (98)" error message when i call jfmerge from my servlet to generate a pdf output. Any idea?
    Thx,
    Anupam

    Hi Frazer,
    I am indeed using Central Output Server not the Central Pro. Is there any trial version available for Central Pro? Any information on this will be greatly appreciated.
    Thanks,
    Anupam

  • Printing small legal document in front of every pdf output

    Hi ,
    I have a small documeent ( either doc or pdf) that needs to be printed in front of every pdf output of the report. This works fine in HTML output because we can add the name of the file to be pre-printed in the Report properties . But there is no such property for PDF output . Any workarounds ?

    I can store simple text in the DB . But i need to store Bold / Underline texts which must appear exactly in the report. I can store with tags . But that works only in HTML output . I need in PDF output.

  • £ and € are printing as # and ? in Reports 6i PDF output

    hi all
    £ and € are printing as # and ? in Reports 6i PDF output, can some one please tell me the solution.
    Thanks in Advance

    It depends on Acrobat's Fonts, you have to see which font PDF reader use.
    Open PDF report , File then Property and Fonts Tab.
    Hope helps you

  • Output to Printer or PDF File Comes Out Small, Like Zoomed Out

    I'm trying to print a 60 page family cookbook with text and pictures (17 mb, using the blank template). Everything looks fine on the screen as measured by the rulers, except for a large suspicious grey strip outside of the horizontally ruled area, along the left side of each page, inbetween the page and the left ruler (in 2-up view, there is a grey strip on the right side of the right hand page as well). In any files with these strips, the output to Print Preview, or the printer, or to PDF files is zoomed out so that the print area is about 70% of the original. I have some early versions of the files that look normal on the screen and which Pages outputs fine. In other words, there appears to be something wrong with these particular files. What?
    I thought that since I had originally placed some objects that stuck outside of the margins that may have caused this change, but everything now seems to be within the page margins. The scale is set to 100%. I can't duplicate the problem, and I can't fix it.
    Will the recipes get out on time?
    iMac G4   Mac OS X (10.3.9)   256 mg ram

    Welcome to the forums ShawnM. This problem is fortunately very easy to solve -- somehow Show Comments got turned on for your document. Go to the View menu and select Hide Comments, and that should do the trick.

  • Printing PDF output in 11.5.10.2

    We cannot seem to be able to print PDF output to a laser printer without opening the output in Adobe and printing from Adobe.
    Any help would be greatly appreciated as these extra steps are impacting our shipment times.
    Sanjib

    Please run "Pasta Printing Setup Test" and check if it returns any error/warning messages.
    Note: 264118.1 - Pasta Pasta Printing Setup Test
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=264118.1
    In addition, please review the following note.
    Note: 297522.1 - How to investigate printing issues and work towards its resolution ?
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=297522.1

  • Generating pdf output with webhelp look and functionality not like a print documentation

    Hi I have been using robohelp webhelp for our company online help documentation. Can I generate pdf output which has the same look and functionality as that of webhelp, using robohelp??

    Welcome to our community
    While you may certainly generate a PDF that contains the same information, it likely will not look exactly like WebHelp and it certainly will not behave as WebHelp.
    WebHelp is intended for on-line use while the PDF is really intended for printing if one chooses to.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Barcode not printing in pdf output

    Hi,
    Iam working on report which has to display barcode.
    When i run the report iam getting barcode displayed in RTF output but its not displaying in PDF format ouput.
    Can you please suggest?
    Thanks,
    Nishi

    plz see http://www.oracle.com/technetwork/middleware/bi-publisher/learnmore/demo-library-toc-173301.html
    - External Fonts
    - Font Mappings (for PDF output)

  • FireFox 3.6.13 Locks up Microsoft XPS Document Writer, PDF995 (created Acrobat pdf file output) stops printing mid document, and Internet Explorer works fine

    Microsoft XPS Document Writer locks up and PDF995.com (creates acrabat pdf file) stops printing after the second page from this site http://super.nova.org/DPR/CinematicApproach/. This was a Windows 7, 64 bit machine that had the issue. Microsoft Internet explorer works fine and printed the document with Internet Explorer.
    The machine that displayed FireFox printing issues was a up to date Win 7, 64 bit, Quad Core, 8 Gig Ram. Don't really have a question just reporting a FireFox Bug.

    Hi,
    do you have a solution for the problem? We have actually a similar problem with locked IE8 when using a zoom factor > 100% (it's a customer WD4A).
    Regards,
    Steffen Brauner
    Edited by: Steffen Brauner on Jul 7, 2011 6:54 AM
    I found the notes 1534606+1534610 that solved my prob.
    Edited by: Steffen Brauner on Jul 7, 2011 6:55 AM

  • PDF: Unable to print a document as PDF from APEX when using the BI Publishe

    Hi,
    From an APEX application, I am unable to print a document in a PDF format when using the Oracle BI Publisher.\
    Here is the configuration:
    1) Server A is W2K3 and hosts the Oracle BI Publisher server, with IP address ip01.
    2) Server B is a OEL5.2 and hosts the database server of the APEX application, with IP address ip02.
    3) Machine C is a W7 desktop from which through an URL both the APEX applicationn and the BI server are accessed, with IP address ip03.
    4) The APEX application is configured with the following to use the Oracle BI Publisher:
    - Printer server: Advanced (requires Oracle BI Publisher)
    - Printer server protocol: HTTP
    - Printer server host address: ip01
    - Printer server port: 9704
    - Printer server script: /xmlpserver/convert
    - Network services are enabled (at least I did get any warning/error message)
    From C, I access the the APEX application through its URL, if I try to download a page by selecting PDF in the download section of the interative report section for that page, I am unable to open if and get the error:
    <file>. pdf file can not be opened because the file type is not supported or because it is damaged (because, for example as an e-mail attachment is not sent and correctly decoded)
    Yet, still from C, I am able to open any other PDF document.
    The same way, still from C, acessing the APEX application through its URL, I have a query report defined with a PDF output format. Then, when I test the report (Test Report in the Report query) for that query, I get the error:
    ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.
    At first sight this could be a wong entry in the priinter configuration for APEX. But with this address, through the URL I can log in to the Oracle BI Publisher server.
    Does someone has an idea what the problem could be?
    Thanks for any tips.

    How are you trying to print to pdf?
    Don't go via PostScript or Acrobat Distiller, which are old deprecated technology.
    You use:
    Menu > File > Print > PDF (button bottom left) > Save as PDF…
    Peter

Maybe you are looking for

  • Report for collect statistics of scenarios in PI

    Hi colleagues, I would like to know if there is any specific report i can execute in my box (PI 7.1) in order to get statistics regarding: Number of messages per scenario Average message size per scenario Ellapsed time Etc The aim is to prepare a doc

  • Two sided print option is grey out

    Recently, I noticed that when I need to print two-sided documents, the "two-sided" print option is greyed out.  I have gone into System Preferences  Printers & Scanners- and under "options" for the printer enabled the HP Two-sided Printing Accesory (

  • Final Cut Studio Educational version serial number

    I've been using an educational version of Final Cut Studio for years, and now it is asking me for my name and serial number before I open the program.  I've looked at the box that the discs come in, and have found some numbers, but they don't seem to

  • Service call exception java.lang. missing soap end tag..

    Hi Experts, I did the soap to rfc sync interface and Create the java deployble client proxy application in nwds. In Nwds i maintaine the PI parameters message server host,port and exectue the application. it is working fine. but i was deploying the a

  • Iphoto and hp475 photosmart

    Hi Just purchased hp 475 and would like to print pix directly from iphoto. Pix will print but the image does not fit the 4x6 photo paper that the printer uses. When I tried the advance tab of the printer menu to try and shrink the image to fit 4x6, t