<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Wrong PDF layout when it is saved into the server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-pdf-layout-when-it-is-saved-into-the-server/m-p/741391#M35429</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I am trying to save a spool output into the server as PDF file. For that I am using the next code:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'&lt;BR /&gt; EXPORTING&lt;BR /&gt; src_spoolid = gv_spoolid&lt;BR /&gt; use_cascading = 'X'&lt;BR /&gt; * no_dialog = 'X'&lt;BR /&gt; TABLES&lt;BR /&gt; pdf = gt_pdf&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; err_no_abap_spooljob = 1&lt;BR /&gt; err_no_spooljob = 2&lt;BR /&gt; err_no_permission = 3&lt;BR /&gt; err_conv_not_possible = 4&lt;BR /&gt; err_bad_destdevice = 5&lt;BR /&gt; user_cancelled = 6&lt;BR /&gt; err_spoolerror = 7&lt;BR /&gt; err_temseerror = 8&lt;BR /&gt; err_btcjob_open_failed = 9&lt;BR /&gt; err_btcjob_submit_failed = 10&lt;BR /&gt; err_btcjob_close_failed = 11&lt;BR /&gt; OTHERS = 12.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt; IF sy-subrc = 0.&lt;BR /&gt; &lt;BR /&gt; CALL FUNCTION 'HR_JP_CONV_TAB_TO_CP_XSTR'&lt;BR /&gt; IMPORTING&lt;BR /&gt; ev_xstring_stream = gv_contentbin&lt;BR /&gt; TABLES&lt;BR /&gt; it_datatab = gt_pdf&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; OTHERS = 3.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;ENDIF.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;After that I save the content of GV_CONTENTBIN into the Server in BINARY MODE. &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;The problem is that the file is not being saved correctly (in the Spool is perfectly shown) when I see it in the OS or downloading using G3CY. The text and the layout is not being shown correctly when I open it with Adobe reader.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Another point is that I have copied this code from another system where works perfectly... I have noticed that in the system which works is is a Unicode system and the one which is not working is a Non-Unicode System (though maybe it has nothing to do with the problem).&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I have tried different FMs but everything keeps going wrongly... could you please help me with this?&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Thanks in advance,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Pablo del Pino&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Thu, 16 Aug 2018 08:54:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-08-16T08:54:44Z</dc:date>
    <item>
      <title>Wrong PDF layout when it is saved into the server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-pdf-layout-when-it-is-saved-into-the-server/m-p/741391#M35429</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I am trying to save a spool output into the server as PDF file. For that I am using the next code:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'&lt;BR /&gt; EXPORTING&lt;BR /&gt; src_spoolid = gv_spoolid&lt;BR /&gt; use_cascading = 'X'&lt;BR /&gt; * no_dialog = 'X'&lt;BR /&gt; TABLES&lt;BR /&gt; pdf = gt_pdf&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; err_no_abap_spooljob = 1&lt;BR /&gt; err_no_spooljob = 2&lt;BR /&gt; err_no_permission = 3&lt;BR /&gt; err_conv_not_possible = 4&lt;BR /&gt; err_bad_destdevice = 5&lt;BR /&gt; user_cancelled = 6&lt;BR /&gt; err_spoolerror = 7&lt;BR /&gt; err_temseerror = 8&lt;BR /&gt; err_btcjob_open_failed = 9&lt;BR /&gt; err_btcjob_submit_failed = 10&lt;BR /&gt; err_btcjob_close_failed = 11&lt;BR /&gt; OTHERS = 12.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt; IF sy-subrc = 0.&lt;BR /&gt; &lt;BR /&gt; CALL FUNCTION 'HR_JP_CONV_TAB_TO_CP_XSTR'&lt;BR /&gt; IMPORTING&lt;BR /&gt; ev_xstring_stream = gv_contentbin&lt;BR /&gt; TABLES&lt;BR /&gt; it_datatab = gt_pdf&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; OTHERS = 3.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;ENDIF.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;After that I save the content of GV_CONTENTBIN into the Server in BINARY MODE. &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;The problem is that the file is not being saved correctly (in the Spool is perfectly shown) when I see it in the OS or downloading using G3CY. The text and the layout is not being shown correctly when I open it with Adobe reader.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Another point is that I have copied this code from another system where works perfectly... I have noticed that in the system which works is is a Unicode system and the one which is not working is a Non-Unicode System (though maybe it has nothing to do with the problem).&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I have tried different FMs but everything keeps going wrongly... could you please help me with this?&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Thanks in advance,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Pablo del Pino&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 08:54:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-pdf-layout-when-it-is-saved-into-the-server/m-p/741391#M35429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-08-16T08:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong PDF layout when it is saved into the server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-pdf-layout-when-it-is-saved-into-the-server/m-p/741392#M35430</link>
      <description>&lt;P&gt;Dear Pablo, &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;I think the problem is the call of function module HR_JP_CONV_TAB_TO_CP_XSTR. &lt;/P&gt;
  &lt;P&gt;Function module CONVERT_ABAPSPOOLJOB_2_PDF creates the PDF data in the final format. This means the PDF data must not be changed. If you change any byte of the PDF data, you can destroy them.&lt;/P&gt;
  &lt;P&gt; In general, it is recommended to use the export parameter BIN_FILE when calling the function module CONVERT_ABAPSPOOLJOB_2_PDF. &lt;/P&gt;
  &lt;P&gt;The advantage of the parameter BIN_FILE is that it automatically returns the PDF data in XSTRING format in parameter BIN_FILE. So you don't need the function HR_JP_CONV_TAB_TO_CP_XSTR.&lt;/P&gt;
  &lt;P&gt; (see note &lt;A href="https://launchpad.support.sap.com/#/notes/2339019"&gt;2339019&lt;/A&gt;)&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; Best regards,&lt;/P&gt;
  &lt;P&gt; Hedvig&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 13:38:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-pdf-layout-when-it-is-saved-into-the-server/m-p/741392#M35430</guid>
      <dc:creator>hedvig_rohonyi</dc:creator>
      <dc:date>2018-08-16T13:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong PDF layout when it is saved into the server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-pdf-layout-when-it-is-saved-into-the-server/m-p/741393#M35431</link>
      <description>&lt;P&gt;Thank you so much Hedvig, now is working fine... I suppose that the FM HR_JP_CONV_TAB_TO_CP_XSTR includes some conversion in unicode and as this system is an old one it introduced some changes... taking the BIN_FILE directly from the FM CONVERT_ABAPSPOOLJOB_2_PDF without any transformation it is perfect.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;Have a nice day!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 06:53:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-pdf-layout-when-it-is-saved-into-the-server/m-p/741393#M35431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-08-17T06:53:54Z</dc:date>
    </item>
  </channel>
</rss>

