Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Smartforms (OTF) converted in PDF, but BOLD dosen't work

Hello SAP masters,

I'm generating a PDF by a Smartform.

The font taht i'm using in the form is TIMES.

When doing the preview, or even printing the form the bold text appears correctly, but when generating the PDF, it just don't work.

I used both functions CONVERT_OTF_2_PDF and CONVERT_OTF, and they failed to generate the bold text.

Here's the code:

.........................CONVERTE OTF PARA PDF.......................

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = v_bin_filesize

TABLES

otf = st_job_output_info-otfdata

doctab_archive = it_docs

lines = it_lines

EXCEPTIONS

err_conv_not_possible = 1

err_otf_mc_noendmarker = 2

OTHERS = 3.

IF sy-subrc NE 0.

WRITE:/ 'A conversão do arquivo OTF para PDF falhou.'.

EXIT.

ENDIF.

........................ADQUIRI O NOME DO ARQUIVO....................

CONCATENATE v_delegado '-' v_delegacia '-' v_endereco1 ', ' v_endereco2 INTO v_namef.

CREATE OBJECT v_guiobj.

CALL METHOD v_guiobj->file_save_dialog

EXPORTING

default_extension = 'pdf'

default_file_name = v_namef

file_filter = v_filter

CHANGING

filename = v_namef

path = v_path

fullpath = v_fullpath

user_action = v_uact.

IF v_uact = v_guiobj->action_cancel.

EXIT.

ENDIF.

..................................DOWNLOAD COMO ARQUIVO....................

MOVE v_fullpath TO v_filename.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = v_bin_filesize

filename = v_filename

filetype = 'BIN'

confirm_overwrite = 'X'

TABLES

data_tab = it_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.

Former Member
Not what you were looking for? View more on this topic or Ask a question