cancel
Showing results for 
Search instead for 
Did you mean: 

Unwanted line breaks in pdf documents after 132th character

boolan
Participant
0 Kudos

Hello,

I have a problem with smartforms.

When I try to output a text in the table cell that is longer than 132 characters and does not have CR LF in it, it breaks after 132th sign and the remaining part is displayed in the next line.

I use call 'CONVERT_OTF' to generate pdf file.

How can one fix it without inserting extra CR LF ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

When converting OTF to PDF, there is a piece of code you should add to convert 132 length to 255. The code looks like below.


FORM f_convert_132_255 USING p_pdf         TYPE tlinetab
                    CHANGING p_content_bin TYPE swuoconttab.

  DATA: lv_buffer       TYPE string,
        lwa_pdf         TYPE tline,
        lwa_content_bin TYPE solisti1.

  REFRESH p_content_bin[].

  LOOP AT p_pdf INTO lwa_pdf.
    TRANSLATE lwa_pdf USING '~'.
    CONCATENATE lv_buffer lwa_pdf INTO lv_buffer.
  ENDLOOP.
  TRANSLATE lv_buffer USING '~'.

  DO.
    lwa_content_bin = lv_buffer.
    APPEND lwa_content_bin TO p_content_bin.
    SHIFT lv_buffer LEFT BY 255 PLACES.
    IF lv_buffer IS INITIAL.
      EXIT.
    ENDIF.
  ENDDO.

ENDFORM.

For more clearer explanation, please try to search "Smartform to PDF" in this forum. There is a blog or wiki showing a complete code for converting smartform to PDF.

Regards,

Teddy Kurniawan