Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in converting Spool Request into PDF format

Former Member
0 Likes
1,538

Hi,

I am facing problem to convert spool request (which store output of sap script) in to PDF format. Actually I have converted it with function module 'CONVERT_OTFSPOOLJOB_2_PDF' and it is working properly but the problem occurs where the BOLD fonts are used. I am unable to see the Text/Address where i have used Bold Font in script (PDF FORMAT). Even though in (SPO1) spool request shows every thing perfectly (along with Bold Font). It will great if you could suggest me something.

Thanks,

Pradeep

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,021

Hi Pradeep,

Hope these will work out for....

DATA: t_otfdata_tab LIKE ITCOO OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'CLOSE_FORM'

TABLES

OTFDATA = t_otfdata_tab

fill the exceptions..

IF SY-SUBRC = 0.

ENDIF.

then pass the t_otfdata_tab to this function module..

CONSTANTS: c_pdf(03) VALUE 'PDF'.

  • PDF File size

DATA: w_file_size TYPE I.

  • Internal Table to hold Form contents in PDF format

DATA: t_pdfdata_tab LIKE tline OCCURS 0 WITH HEADER LINE.

  • for converting. the output format from OTF to PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT eq c_pdf

IMPORTING

BIN_FILESIZE = w_file_size

TABLES

OTF eq t_otfdata_tab

LINES eq t_pdfdata_tab

EXCEPTIONS...

Cheers,

Amitav Mohapatra

6 REPLIES 6
Read only

Former Member
0 Likes
1,022

Hi Pradeep,

Hope these will work out for....

DATA: t_otfdata_tab LIKE ITCOO OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'CLOSE_FORM'

TABLES

OTFDATA = t_otfdata_tab

fill the exceptions..

IF SY-SUBRC = 0.

ENDIF.

then pass the t_otfdata_tab to this function module..

CONSTANTS: c_pdf(03) VALUE 'PDF'.

  • PDF File size

DATA: w_file_size TYPE I.

  • Internal Table to hold Form contents in PDF format

DATA: t_pdfdata_tab LIKE tline OCCURS 0 WITH HEADER LINE.

  • for converting. the output format from OTF to PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT eq c_pdf

IMPORTING

BIN_FILESIZE = w_file_size

TABLES

OTF eq t_otfdata_tab

LINES eq t_pdfdata_tab

EXCEPTIONS...

Cheers,

Amitav Mohapatra

Read only

Former Member
0 Likes
1,021

Hi Pradeep,

Use ,

  • Closing the Sapscript, we save data (OTF) in a table

CALL FUNCTION 'CLOSE_FORM'

TABLES

otfdata = t_otfdata

EXCEPTIONS

unopened = 1

bad_pageformat_for_print = 2

send_error = 3

spool_error = 4

OTHERS = 5.

DATA: BEGIN OF t_otfdata2 OCCURS 0.

INCLUDE STRUCTURE solisti1.

DATA: END OF t_otfdata2.

  • Move OTF data to another table with lenght 255

LOOP AT t_otfdata.

CONCATENATE t_otfdata-tdprintcom t_otfdata-tdprintpar INTO t_otfdata2.

APPEND t_otfdata2.

ENDLOOP.

  • Convert OTF format to PDF

CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'

EXPORTING

format_src = 'OTF'

format_dst = 'PDF'

devtype = 'PRINTER'

  • FUNCPARA =

len_in = len_in

IMPORTING

len_out = len_out

TABLES

content_in = t_otfdata2

content_out = t_pdfdata

EXCEPTIONS

err_conv_failed = 1

OTHERS = 2.

Have a look at Progs. RSTXPDF4 and RSTXPDFT2 for converting the Spool to PDF.

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

Message was edited by: Rajasekhar Dinavahi

Read only

Former Member
0 Likes
1,021

Hi!

You can check that appropriate fonts variations have been loaded with report RSTXPDF2 - "Administration of softfonts for SAPscript and PDF converter".

If there is no one for specific SAP font family (exactly one you are using in your smartform) try to upload it. You can find various TrueType fonts in your C:\WINDOWS\Fonts directory for example.

Regards,

Maxim.

Read only

0 Likes
1,021

Hi Maxim,

Thanks for the reply. I think it can solve my problem.

thanks a lot.

Pradeep

Read only

0 Likes
1,021

Hi Maxim,

I have done as you have suggested and uploaded the fonts via RSTXPDF2 program. But still while I am opening PDF file, I am getting an error message "Can not Extract the embedded font 'Humnst777LTBT'. Some character may not display or print correctly." even though I am able to see the fonts 'Humnst777LTBT' in system.

Pls suggest what can be the problem.

Thanks for your kind co operation.

Regards,

Pradeep

Read only

0 Likes
1,021

Hi!

Here you can try the following - delete and re-upload your fonts with option "Do not insert font in PDF" and ensure you use Adobe Reader version 7 or higher - there are problems in earlier versions of Reader with display of PDF with not embedded fonts. One more option you can try - select another font for converter.

Regards,

Maxim.