Skip to Content
author's profile photo Former Member
Former Member

Converting PDF to RAW for display in the portal

Hi all,

We have an application that took a pdf and converted it into a raw datastring to pass to the portal for display purposes.

We have migrated this function to a unicode system and are now struggling to get this to work.

Code in non-unicode system

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = e_filesize

TABLES

otf = lt_otf

doctab_archive = lt_doctab_archive

lines = lt_pdf.

LOOP AT lt_pdf INTO wa_pdf.

CLEAR et_pdf.

MOVE wa_pdf TO et_raw.

APPEND et_raw.

ENDLOOP.

Now in the unicode system.

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = e_filesize

TABLES

otf = lt_otf

doctab_archive = lt_doctab_archive

lines = lt_pdf.

FIELD-SYMBOLS: <x_wrk_line> TYPE rmps_raw134,

<x_struc> TYPE xstring.

DATA: buffer1 TYPE xstring,

conv TYPE REF TO cl_abap_conv_out_ce.

  • Convert PDF to RAW Type

LOOP AT lt_pdf INTO ls_pdf.

CLEAR et_raw.

MOVE ls_pdf TO lv_pdf_line.

ASSIGN buffer1 TO <x_struc> CASTING.

ASSIGN et_raw-rawline TO <x_wrk_line> CASTING.

conv = cl_abap_conv_out_ce=>create(

encoding = 'UTF-8'

).

conv->convert( EXPORTING data = lv_pdf_line

IMPORTING buffer = buffer1 ).

<x_wrk_line> = <x_struc>.

APPEND et_raw.

ENDLOOP.

If we simply download the pdf after we have tun the 'CONVERT_OTF_2_PDF' Fm the pdf created is fine. However when we view the output in the portal of the pdf (as streamed in the raw format) we just get chinese looking (they may well not be any language) characters in the pdf.

With a non-unicode R/3 system the pdf was displayed without any issues in the portal.

Any help appreciated.

Thanks,

Paul

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jun 18, 2008 at 01:01 AM

    Hi, could you kindly share the complete set of this conversion? i also need similar requirement.

    thx so much.

    regards,

    Rudy.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.